cypress-io / eslint-plugin-cypress

An ESLint plugin for projects that use Cypress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Outdated peerDependencies eslint >= 3.2.1

MikeMcC399 opened this issue ยท comments

Issue

The eslint-plugin-cypress plugin currently defines peerDependencies of "eslint": ">= 3.2.1". This includes versions of ESLint v3, v4 and v9 which are not compatible with the current latest version of eslint-plugin-cypress@2.15.2 (including its other peerDependencies). ESLint v8 cannot be linted by @cypress/eslint-plugin-dev and replacement linting recommended by Linting a Plugin only covers ESLint v7 and above.

The intersection of supportable combinations is ESLint v7 and v8 only.

In detail:

ESLint v3 and v4

  • The currently used @cypress/eslint-plugin-dev is not compatible with ESLint v3 and v4 (see #166). peerDependencies of eslint-plugin-cypress needs to be "eslint": ">=5".

ESLint v5 and v6

ESLint v7

  • "eslint": "^7.32.0" is the currently configured version of ESLint in the master branch of eslint-plugin-cypress. This version lints with ESLint and tests with Jest successfully. This version is already covered by peerDependencies of "eslint": ">= 3.2.1".

ESLint v8

  • The plugin cannot lint using ESLint v8. It tests successfully with Jest under ESLint v8. To cover ESlint v8 completely requires resolution of issue #174.

ESLint v9

  • Due to breaking changes in ESLint v9 (see Migrate to v9.x related to removed API calls and flat-file related changes) the plugin eslint-plugin-cypress@2.15.2 (current latest) is not compatible with ESLint v9. peerDependencies of eslint-plugin-cypress needs to be "eslint": "<9".

Suggestion

Considering all of the above issues, eslint-plugin-cypress needs to have its peerDependencies set to the semver range:

"eslint": ">=7 <9"

This is a breaking change needing a new major release eslint-plugin-cypress of 3.x.

Implementing this change has the benefits:

  • Provides users with a clear package manager incompatibilty message if they install the latest version of eslint-plugin-cypress together with ESLint 9.x (otherwise the result is the error message: "TypeError: context.getAncestors is not a function" - see issue #156))
  • Allows moving forward with issue #174
  • PR #176 implements the suggestion to release a new major version which supports ESLint v7 and v8 only.

๐ŸŽ‰ This issue has been resolved in version 3.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€