Skip to content

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Jun 23, 2025

Situation

ESLint in this repo does not trigger from yarn lint and if it is run manually, it produces many linting errors. It is also based on outdated, unsupported linting components. In summary, it is in a non-working state and so it is neither useful for contributors, nor as an example of how to configure ESLint for Cypress using supported components.

In detail:

  • eslint@^8.44.0, configured in package.json, reached end-of-life on Oct 5, 2024. The supported current release line is ESLint 9.x.

  • The package.json script definition lint does not lint any files with ESLint 8.x since none are specified

"lint": "eslint && prettier --check \"**/**.{ts,js,tsx}\" \"*.{json,md,yml}\"",

Change

Dependencies

Configuration

  • Remove ESLint configuration from package.json
  • Add new ESLint v9 configuration to eslint.config.mjs
  • Note that eslint-plugin-prettier is removed, as prettier no longer recommends it on their Integrating with Linters page

Code changes

Remove disable of rules:

  • react-hooks/*
  • import/first

Verification

Ubuntu 24.04.2 LTS, Node.js 22.15.0 LTS, Yarn 1.22.22

git clean -xfd
yarn
yarn run prettier
yarn eslint --report-unused-disable-directives-severity 'off'

Confirm that no linting issues are reported.

When running

yarn lint

"Unused eslint-disable directive" may be reported as a warning.

TO-DOs

The following rules are disabled, since they produce errors against the current code. These can be addressed individually by reviewing the rule violations and either leaving the rule globally disabled, modifying code which provokes an error or disabling individual application of any particular rule:

      'no-empty': 'off',
      'no-prototype-builtins': 'off',
      'no-undef': 'off',
      'no-unused-vars': 'off',
      'prefer-const': 'off',
      '@typescript-eslint/ban-ts-comment': 'off',
      '@typescript-eslint/no-empty-object-type': 'off',
      '@typescript-eslint/no-explicit-any': 'off',
      '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
      '@typescript-eslint/no-unsafe-function-type': 'off',
      '@typescript-eslint/no-unused-expressions': 'off',
      '@typescript-eslint/no-wrapper-object-types': 'off',
      '@typescript-eslint/no-unused-vars': 'off',
      '@typescript-eslint/no-require-imports': 'off',
      '@typescript-eslint/triple-slash-reference': 'off',

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 force-pushed the reconfigure/base-linting branch from d59a9ba to 1937482 Compare June 23, 2025 16:24
@MikeMcC399 MikeMcC399 marked this pull request as ready for review June 23, 2025 16:44
@MikeMcC399

This comment was marked as outdated.

@MikeMcC399 MikeMcC399 force-pushed the reconfigure/base-linting branch from e15e853 to b3ad69e Compare July 4, 2025 15:27
@MikeMcC399
Copy link
Contributor Author

Refreshed ESLint dependencies and rebased

@MikeMcC399 MikeMcC399 force-pushed the reconfigure/base-linting branch from b3ad69e to bc0466c Compare July 4, 2025 15:55
update eslint to 9.30.1
update eslint-plugin-cypress to 5.1.0
add typescript-eslint 8.35.1
add @typescript-eslint/parser 8.35.1
remove eslint-config-prettier
remove eslint-plugin-prettier
remove eslint-config-react-app
@MikeMcC399 MikeMcC399 force-pushed the reconfigure/base-linting branch from bc0466c to 744f7e2 Compare July 6, 2025 14:39
@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

@jennifer-shehane / @AtofStryker

I'm requesting review for this PR that I submitted last month. It's not urgent, however I would appreciate it being looked at sometime soon.

Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forked and ran locally and runs as expected. Thank you for updating this @MikeMcC399!

@AtofStryker AtofStryker merged commit d23eba8 into cypress-io:develop Jul 17, 2025
8 checks passed
@MikeMcC399 MikeMcC399 deleted the reconfigure/base-linting branch July 17, 2025 18:42
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.

Migrate to ESLint 9.x Migrate away from deprecated eslint-config-react-app
3 participants