Skip to content

Conversation

@MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Nov 19, 2025

Situation

Several JavaScript source files in the src directory include the ESLint configuration comment:

/* eslint-env mocha */

This is no longer used in ESLint flat configurations, and will cause an error in ESLint 10.x and a warning in ESLint >=9.39.2.

See Configuration Migration Guide eslint-env Configuration Comments which says:

... when migrating from eslintrc to flat config, eslint-env configuration comments should be removed from all files.

This repo is already using an ESLint 9.x flat configuration and the mocha globals are provided by using mochaPlugin.configs.recommended.

Change

Remove the unused eslint-env configuration comment from source files in the src directory.

Verification

npm ci
npx eslint

Confirm no errors reported.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review November 19, 2025 11:05
@MikeMcC399
Copy link
Contributor Author

@AtofStryker

This is a non-urgent PR from last month, if you could take a look when convenient.

The latest version of ESLint 9.x (9.39.2) will flag this misconfiguration as a warning.

@AtofStryker AtofStryker self-requested a review December 15, 2025 20:28
@AtofStryker AtofStryker merged commit 807559b into cypress-io:master Dec 15, 2025
1 check passed
@MikeMcC399 MikeMcC399 deleted the remove/eslint-env-comments branch December 16, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants