Skip to content

Conversation

MikeMcC399
Copy link
Collaborator

Situation

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() and globalIgnores() helpers for configuration files. The blog article Evolving flat config with extends provides background information, including a discussion on the reintroduction of extends in configurations.

The repo eslint-plugin-cypress configurations use conventional examples without defineConfig()

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 the extends key. Examples are written to conform to this recommendation, using cypress/**/*.js.

Verification

npm ci
npm run format:check
npm run lint

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

@cypress-app-bot
Copy link

@MikeMcC399

This comment was marked as outdated.

@jennifer-shehane jennifer-shehane merged commit 9015c2e into cypress-io:master Sep 23, 2025
12 checks passed
@MikeMcC399 MikeMcC399 deleted the migrate/eslint-defineconfig branch September 23, 2025 16:30
@jennifer-shehane
Copy link
Member

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document and use defineConfig() helper in examples

3 participants