docs: add document for FlatCompat use #201
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 README > Usage section describes how to add an
.eslintrc.json
configuration file to use theeslint-plugin-cypress
plugin. With the announcement and release of ESLint v9 on Apr 5, 2024, configuration files in the format.eslintrc.*
have become deprecated (see ESLint 8.x Configuration Files).The plugin needs to document how to set up and use non-deprecated Configuration Files (New) for ESLint
v8
. These are JavaScript files using aneslint.config.*js
naming convention. Users of the plugin may otherwise be blocked from preparing to update to ESLintv9
through lack of information.Constraints
Plugins
eslint-plugin-cypress
has not yet implemented the instructions in Plugin Migration to Flat Config (see issue Upgrade to new ESLint Flat configuration files #146). It is compatible with ESLintv7
andv8
.import
a flat config. It is compatible with ESLintv7
tov9
..eslintrc.*
legacy config file. The latest version [email protected] is not compatible with the ESLintv9
API due to usage ofcontext.getAncestors
. It is compatible with ESLintv3
tov8
.Node.js
eslint-plugin-cypress
has no package type defined and so it defaults to CommonJS.import
statements are supported only in ECMAScript (ES module / ESM)..mjs
extension for the ESLint configuration file in order to useimport
statements.ESLint usage
FlatCompat
class from the npm module @eslint/eslintrc, is required to use legacy plugins in a flat config environment.eslint.config.mjs
configuration file (see ESLint CHANGELOG and ESLint 8.x > Configuration File Resolution).Change
In order to provide clear, readable instructions for both legacy (
.eslintrc.*
) and new, flat config (eslint.config.*js
) users, a separate documentFLAT-CONFIG.md
is created for the new flat config instructions.Future steps
eslint-plugin-cypress
plugin inFlatCompat
compatibility mode together with ESLintv9
in addition to ESLint8.57.0
.References
ESLint 8.x