fix(linter): respect the --quiet option when running with --fix (#31403)

## Current Behavior

`nx run lint --quiet --fix` doesn't respect `--quiet` and fixes all
issues, even silenced ones. This is different from how `eslint --quiet
--fix` behaves.

## Expected Behavior

`nx run lint --quiet --fix` should only fix issues that aren't silenced
by `--quiet`, like `eslint` does

## Related Issue(s)

Fixes #31401
This commit is contained in:
bkp-ttd 2025-06-18 03:33:02 -06:00 committed by GitHub
parent 578405862d
commit 9406d2bfdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,15 +170,15 @@ Please see https://nx.dev/recipes/tips-n-tricks/eslint for full guidance on how
);
}
// output fixes to disk, if applicable based on the options
await ESLint.outputFixes(lintResults);
// if quiet, only show errors
if (normalizedOptions.quiet) {
console.debug('Quiet mode enabled - filtering out warnings\n');
lintResults = ESLint.getErrorResults(lintResults);
}
// output fixes to disk, if applicable based on the options
await ESLint.outputFixes(lintResults);
const formatter = await eslint.loadFormatter(normalizedOptions.format);
const formattedResults = await formatter.format(lintResults);