From 996e2decc7ef3308387540ae66ab7bc2cb5e2f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Wed, 16 Mar 2022 10:59:08 +0100 Subject: [PATCH] fix(linter): ensure eslint fixes are stored before results are filtered (#9348) --- 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;