Skip to content

Commit 57bd07f

Browse files
committed
fix format
1 parent add9f33 commit 57bd07f

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

nx.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"@nx/vite:test": {
2020
"cache": true,
21-
"inputs": ["default", "^default"],
21+
"inputs": ["default", "^default"]
2222
},
2323
"@nx/js:tsc": {
2424
"cache": true,

packages/plugin-knip/src/lib/reporter/reporter.ts

+40-40
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,49 @@ import { knipToCpReport } from './utils';
1616
*
1717
*/
1818
export const knipReporter = async (knipReporterOptions: ReporterOptions) => {
19-
const { options, report, issues } = knipReporterOptions;
20-
const customReporterOptions = parseCustomReporterOptions(options);
21-
const {
22-
verbose,
23-
outputFile = KNIP_REPORT_NAME,
19+
const { options, report, issues } = knipReporterOptions;
20+
const customReporterOptions = parseCustomReporterOptions(options);
21+
const {
22+
verbose,
23+
outputFile = KNIP_REPORT_NAME,
24+
rawOutputFile,
25+
} = customReporterOptions;
26+
if (verbose) {
27+
ui().logger.info(
28+
`Reporter called with options: ${JSON.stringify(
29+
customReporterOptions,
30+
null,
31+
2,
32+
)}`,
33+
);
34+
}
35+
if (rawOutputFile != null) {
36+
await ensureDirectoryExists(dirname(rawOutputFile));
37+
await writeFile(
2438
rawOutputFile,
25-
} = customReporterOptions;
26-
if (verbose) {
27-
ui().logger.info(
28-
`Reporter called with options: ${JSON.stringify(
29-
customReporterOptions,
30-
null,
31-
2,
32-
)}`,
33-
);
34-
}
35-
if (rawOutputFile != null) {
36-
await ensureDirectoryExists(dirname(rawOutputFile));
37-
await writeFile(
38-
rawOutputFile,
39-
JSON.stringify(
40-
{
41-
...knipReporterOptions,
42-
issues: {
43-
...issues,
44-
files: [...issues.files], // files is a Set<string>
45-
},
46-
options: customReporterOptions,
39+
JSON.stringify(
40+
{
41+
...knipReporterOptions,
42+
issues: {
43+
...issues,
44+
files: [...issues.files], // files is a Set<string>
4745
},
48-
null,
49-
2,
50-
),
51-
);
52-
if (verbose) {
53-
ui().logger.info(`Saved raw report to ${rawOutputFile}`);
54-
}
46+
options: customReporterOptions,
47+
},
48+
null,
49+
2,
50+
),
51+
);
52+
if (verbose) {
53+
ui().logger.info(`Saved raw report to ${rawOutputFile}`);
5554
}
55+
}
5656

57-
const result = await knipToCpReport({ issues, report });
57+
const result = await knipToCpReport({ issues, report });
5858

59-
await ensureDirectoryExists(dirname(outputFile));
60-
await writeFile(outputFile, JSON.stringify(result, null, 2));
61-
if (verbose) {
62-
ui().logger.info(`Saved report to ${outputFile}`);
63-
}
59+
await ensureDirectoryExists(dirname(outputFile));
60+
await writeFile(outputFile, JSON.stringify(result, null, 2));
61+
if (verbose) {
62+
ui().logger.info(`Saved report to ${outputFile}`);
63+
}
6464
};

0 commit comments

Comments
 (0)