Skip to content

Commit

Permalink
fix: Fix backwards compatibility for Reporters (#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Jan 7, 2022
1 parent 8f55c0f commit 38d17b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/cspell-types/src/CSpellReporter.ts
Expand Up @@ -58,7 +58,7 @@ export interface RunResult {
/** Number of processing errors. */
errors: number;
/** Number files that used results from the cache. */
cachedFiles: number;
cachedFiles?: number;
}

export type ResultEmitter = (result: RunResult) => void | Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion packages/cspell/src/lint/lint.ts
Expand Up @@ -139,7 +139,7 @@ export async function runLint(cfg: LintRequest): Promise<RunResult> {
for await (const fileP of loadAndProcessFiles()) {
const { filename, fileNum, result } = await fileP;
status.files += 1;
status.cachedFiles += result.cached ? 1 : 0;
status.cachedFiles = (status.cachedFiles || 0) + (result.cached ? 1 : 0);
emitProgress(filename, fileNum, result);
// Show the spelling errors after emitting the progress.
result.issues.filter(cfg.uniqueFilter).forEach((issue) => reporter.issue(issue));
Expand Down

0 comments on commit 38d17b2

Please sign in to comment.