File tree Expand file tree Collapse file tree
packages/plugin-knip/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ async function saveRawReport(
4242 *
4343 * @example
4444 * run the following command to test it:
45- * npx knip --reporter ./dist/packages/plugin-knip/reporter.js --reporter-options='{\ "outputFile\":\ "my-knip-report.json\ "}'
45+ * npx knip --reporter ./dist/packages/plugin-knip/reporter.js --reporter-options='{"outputFile": "my-knip-report.json"}'
4646 *
4747 */
4848export const knipReporter = async ( knipReporterOptions : ReporterOptions ) => {
Original file line number Diff line number Diff line change @@ -64,11 +64,13 @@ export function createRunnerConfig(options: RunnerOptions = {}): RunnerConfig {
6464 '--no-progress' ,
6565 // code-pushup reporter is used from the installed package
6666 `--reporter=${ reporterPath } ` ,
67- // code-pushup reporter options are passed as string. See
68- `--reporter-options='${ JSON . stringify ( {
69- outputFile,
70- rawOutputFile,
71- } satisfies CustomReporterOptions ) } '`,
67+ // code-pushup reporter options are passed as string. Double JSON.stringify ensures proper escaping on all platforms
68+ `--reporter-options=${ JSON . stringify (
69+ JSON . stringify ( {
70+ outputFile,
71+ rawOutputFile,
72+ } satisfies CustomReporterOptions ) ,
73+ ) } `,
7274 ] ,
7375 outputFile,
7476 } ;
You can’t perform that action at this time.
0 commit comments