From f85b45bfdc52c609eda5168346ed81c214c14e0e Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Wed, 16 Mar 2022 10:26:03 +0100 Subject: [PATCH] fix(linter): ensure fixes are applied before results are filtered --- packages/linter/src/executors/eslint/lint.impl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/linter/src/executors/eslint/lint.impl.ts b/packages/linter/src/executors/eslint/lint.impl.ts index 0cd6d460d4f41..81869dd31a547 100644 --- a/packages/linter/src/executors/eslint/lint.impl.ts +++ b/packages/linter/src/executors/eslint/lint.impl.ts @@ -99,6 +99,9 @@ Please see https://nx.dev/guides/eslint for full guidance on how to resolve this ); } + // output fixes to disk, if applicable based on the options + await projectESLint.ESLint.outputFixes(lintResults); + // if quiet, only show errors if (options.quiet) { console.debug('Quiet mode enabled - filtering out warnings\n'); @@ -110,9 +113,6 @@ Please see https://nx.dev/guides/eslint for full guidance on how to resolve this let totalErrors = 0; let totalWarnings = 0; - // output fixes to disk, if applicable based on the options - await projectESLint.ESLint.outputFixes(lintResults); - for (const result of lintResults) { if (result.errorCount || result.warningCount) { totalErrors += result.errorCount;