Update ESLint warning thresholds, and produce them consistently #5151
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
The ESLint warning thresholds file records warnings that were produced the last time that
eslint
was run, categorizing them by rule. This file should be kept up to date at all times so we can know whether new code changes introduce a regression in the number of warnings or an improvement. Specifically, the lint step will now fail if more warnings are introduced to the codebase.However, in the past we have observed inconsistencies in the behavior of ESLint across different people's machines as well as in CI. With the addition of the quality gate this means that some people are unable to merge PRs because warnings are produced that are not seen in development, and the warnings may not be reproducible by other developers.
With that said, we recently learned that if
dist
directories are present from a previous run ofyarn build
, it could affect the behavior of the TypeScript-specific lint rules and cause the observed inconsistencies. To mitigate this problem, this commit ensures that alldist
directories are removed before runningeslint
. This indeed does change the number of warnings produced, and the thresholds file has been updated to reflect this.References
Changelog
(N/A)
Checklist