Skip to content

Commit 1a19087

Browse files
committedOct 18, 2023
Add finalData.counters and use finalData.report (#300)
1 parent 1a66d6a commit 1a19087

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎src/cli.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const run = async () => {
6161
const initialData: ReporterOptions = {
6262
report,
6363
issues,
64+
counters,
6465
configurationHints,
6566
noConfigHints,
6667
cwd,
@@ -75,8 +76,8 @@ const run = async () => {
7576
await runReporters(finalData);
7677

7778
const totalErrorCount = (Object.keys(finalData.report) as IssueType[])
78-
.filter(reportGroup => report[reportGroup] && rules[reportGroup] === 'error')
79-
.reduce((errorCount: number, reportGroup) => errorCount + counters[reportGroup], 0);
79+
.filter(reportGroup => finalData.report[reportGroup] && rules[reportGroup] === 'error')
80+
.reduce((errorCount: number, reportGroup) => errorCount + finalData.counters[reportGroup], 0);
8081

8182
if (isObservePerf) {
8283
await perfObserver.finalize();

‎src/types/issues.ts

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export type Counters = Record<IssueType | 'processed' | 'total', number>;
5252
export type ReporterOptions = {
5353
report: Report;
5454
issues: Issues;
55+
counters: Counters;
5556
configurationHints: ConfigurationHints;
5657
noConfigHints: boolean;
5758
cwd: string;

0 commit comments

Comments
 (0)
Please sign in to comment.