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:
parent
578405862d
commit
9406d2bfdb
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user