chore(docs): update documents and example to use defineConfig() #277
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.
defineConfig()
helper in examples #276Situation
The ESLint Configuration Files documentation and the ESLint README now include the use of the helper function
defineConfig()
as standard configuration suggestions.The ESLint 9.22.0 release, from Mar 7, 2025, introduced the
defineConfig()
andglobalIgnores()
helpers for configuration files. The blog article Evolving flat config with extends provides background information, including a discussion on the reintroduction ofextends
in configurations.The repo
eslint-plugin-cypress
configurations use conventional examples withoutdefineConfig()
Change
Migrate configurations in the following to use the
defineConfig()
helper function:In the test-project also migrate configurations and rename test configurations in test-project/eslint-configs to better reflect their contents.
Extending Configurations recommends to always use a
files
key with theextends
key. Examples are written to conform to this recommendation, usingcypress/**/*.js
.Verification
Confirm that there are no errors or format changes suggested.
cd test-project npm install eslint ../. --no-package-lock npx eslint -c ./eslint-configs/eslint.globals.mjs npx eslint -c ./eslint-configs/eslint.one-rule-deprecated.mjs npx eslint -c ./eslint-configs/eslint.one-rule.mjs npx eslint -c ./eslint-configs/eslint.recommended.mjs rm -rf node_modules git restore package.json