test: update eslint config to flat on eslint v8 #836
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.
Issue
The ESLint configuration file .eslintrc, used with ESLint
v8
, is deprecated in ESLintv9
(see ESLint 8.x configuration files).ESLint v9 was released on Apr 5, 2024 and the announcement stated that "Flat config" is now the default.
This repo currently uses the following plugins. The table also shows if they offer flat config options:
1.7.2
8.57.0
pluginJs.configs.recommended
3.1.1
2.15.1
...eslintPluginJsonc.configs['flat/recommended-with-json']
10.4.3
mochaPlugin.configs.flat.recommended
eslint-plugin-cypress in the current
3.1.1
release offers no out-of-the-box flat config option.Changes
eslint.config.mjs
according to the documentation ESLint 8.x configuration files (new) and the documentation of each plugin.eslint-plugin-cypress
Integrate the eslint-plugin-cypress plugin using the ESLint Backwards compatibility utility: using the
FlatCompat
class from the npm module @eslint/eslintrc as an interim solution.Migration to ESLint v9
The next planned step will be the migration to ESLint
v9
after eslint-plugin-cypress has released a version compatible with ESLintv9
.References
Verification