Skip to content

Commit

Permalink
Add finalData.counters and use finalData.report (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 18, 2023
1 parent 1a66d6a commit 1a19087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli.ts
Expand Up @@ -61,6 +61,7 @@ const run = async () => {
const initialData: ReporterOptions = {
report,
issues,
counters,
configurationHints,
noConfigHints,
cwd,
Expand All @@ -75,8 +76,8 @@ const run = async () => {
await runReporters(finalData);

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

if (isObservePerf) {
await perfObserver.finalize();
Expand Down
1 change: 1 addition & 0 deletions src/types/issues.ts
Expand Up @@ -52,6 +52,7 @@ export type Counters = Record<IssueType | 'processed' | 'total', number>;
export type ReporterOptions = {
report: Report;
issues: Issues;
counters: Counters;
configurationHints: ConfigurationHints;
noConfigHints: boolean;
cwd: string;
Expand Down

0 comments on commit 1a19087

Please sign in to comment.