test(deps): reconfigure for ESLint v9 #1643
Merged
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.
Situation
ESLint in this repo does not trigger from
yarn lint
and if it is run manually, it produces many linting errors. It is also based on outdated, unsupported linting components. In summary, it is in a non-working state and so it is neither useful for contributors, nor as an example of how to configure ESLint for Cypress using supported components.In detail:
eslint@^8.44.0
, configured in package.json, reached end-of-life on Oct 5, 2024. The supported current release line is ESLint9.x
.The package.json script definition
lint
does not lint any files with ESLint8.x
since none are specifiedcypress-realworld-app/package.json
Line 158 in a7de449
peerDependencies
"eslint": "^8.0.0"
(now unsupported)Change
Dependencies
Configuration
eslint.config.mjs
eslint-plugin-prettier
is removed, as prettier no longer recommends it on their Integrating with Linters pageCode changes
Remove disable of rules:
react-hooks/*
import/first
Verification
Ubuntu
24.04.2
LTS, Node.js22.15.0
LTS, Yarn1.22.22
git clean -xfd yarn yarn run prettier yarn eslint --report-unused-disable-directives-severity 'off'
Confirm that no linting issues are reported.
When running
"Unused eslint-disable directive" may be reported as a warning.
TO-DOs
The following rules are disabled, since they produce errors against the current code. These can be addressed individually by reviewing the rule violations and either leaving the rule globally disabled, modifying code which provokes an error or disabling individual application of any particular rule: