chore(deps-dev): bump Eslint from 8.53.0 to 9.17.0 #36
+6,075
−3,031
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.
Describe your changes
I'm upgrading Eslint to the version
9
. As it's a major version change, the code has additional changes.Config file format and rules
The Eslint version
9
is replacing the old rc format with a newer flat one (docs). I also replaced the outdatedeslint-plugin-vitest
with official Vitesteslint-plugin-vitest
.I used the previous rules setup and added two new ones:
sonarjs/todo-tag
— I set the rule to warn. The previous setup didn't error on TODO comments for unknown reasons. I see the value in highlighting them, but I don't believe they should throw a linting error.sonarjs/no-nested-functions
— I disabled the rule for tests. The rule does not add value to tests as the test format is nested functions.Eslint Typescript
To keep the tests outside the build but allow Eslint to handle them, I'm adding the custom config used only by the lintner.
Code changes
Sonar complained about
sonarjs/function-return-type
for some of the helper functions. I added explicit typing that covers the error case, but as it didn't fix the issue, I silenced the rule for those helpers. Functions are not complex, and generic helpers are part of every Grammar library.Sonar also complained about
/-?\d+\.\d+/
regex being vulnerable to super-linear runtime due to backtracking.Issue ticket number/link
#35
Checklist before requesting a review