Skip to content

Commit ed0251b

Browse files
committed
fix: resolve restrict-template-expressions warnings
Use String(error) for unknown-typed catch variables in template literals.
1 parent f62ecfb commit ed0251b

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

dist/index.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/cache-save.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ export async function saveCache(): Promise<void> {
3939
info(`Cache saved with key: ${primaryKey}`);
4040
} catch (error) {
4141
// Don't fail the action if cache save fails
42-
warning(`Failed to save cache: ${error}`);
42+
warning(`Failed to save cache: ${String(error)}`);
4343
}
4444
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function printViteVersion(): Promise<void> {
4747
saveState(State.InstalledVersion, version);
4848
setOutput(Outputs.Version, version);
4949
} catch (error) {
50-
warning(`Could not get vp version: ${error}`);
50+
warning(`Could not get vp version: ${String(error)}`);
5151
setOutput(Outputs.Version, "unknown");
5252
}
5353
}

src/run-install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function runViteInstall(inputs: Inputs): Promise<void> {
2626
info(`Successfully ran ${cmdStr}`);
2727
}
2828
} catch (error) {
29-
setFailed(`Failed to run ${cmdStr}: ${error}`);
29+
setFailed(`Failed to run ${cmdStr}: ${String(error)}`);
3030
} finally {
3131
endGroup();
3232
}

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async function getCommandOutput(command: string, args: string[]): Promise<string
9696
debug(`Command "${cmdStr}" exited with code ${result.exitCode}`);
9797
return undefined;
9898
} catch (error) {
99-
warning(`Failed to run "${cmdStr}": ${error}`);
99+
warning(`Failed to run "${cmdStr}": ${String(error)}`);
100100
return undefined;
101101
}
102102
}

0 commit comments

Comments
 (0)