Reorganize ESLint warning thresholds and output #5159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
Some lint rules are disabled because they generate many violations across the monorepo (mostly thanks to the recent ESLint upgrade). To be able to identify them and remove them, we have set these rules to generate warnings instead, and we have also implemented a quality gate to ensure that no new instances of these warnings occur in the codebase.
However, currently there are so many warnings and the output from ESLint is so large, that if changes are made in a branch that do end up producing new violations, it is basically impossible to know where those violations occurred. The format of the warning thresholds file, which is used to track changes to warnings, does not help things, either, because it only records the rules for which violations occurred and not the files that have those violations.
To address this, this commit reorganizes the warning thresholds file so that warning counts are filed first by file path and then by rule. A regression or improvement in lint violations is still determined by calculating a total and comparing it to the file, but then the script is able to show where new violations occurred. (As a plus, this commit also hides improvements if there are regressions.)
For instance, instead of saying something like:
it might now say:
References
Changelog
(N/A, developer-only change)
Checklist