cypress-io / eslint-plugin-cypress

An ESLint plugin for projects that use Cypress

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@cypress/eslint-plugin-dev@3.2.0 lacks support for ESLint 4

MikeMcC399 opened this issue · comments

Issue

@cypress/eslint-plugin-dev@3.2.0 configured in this repo's devDependencies contains peerDependencies:

    "@typescript-eslint/parser": ">= 1.11.0"
    "eslint": ">= 3.2.1 < 6"

however

@typescript-eslint/parser@1.11.0 is only compatible with ESLint 5:

  "eslint": "^5.0.0"

The error message from npm is

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
...
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0" from @typescript-eslint/parser@1.11.0

This rules out the supported use of ESLint 4 for dev tests in the repository. It is also a handicap for moving to a supported version of Node.js 18.x and later.

Steps to reproduce

Ubuntu 22.04.4 LTS, Node.js 20.12.2

mkdir eslint-plugin-dev-test
cd eslint-plugin-dev-test
git init
npm init -y
npm install eslint@4 @cypress/eslint-plugin-dev@3.2.0 @typescript-eslint/parser@1.11.0

Logs

$ npm install eslint@4 @cypress/eslint-plugin-dev@3.2.0 @typescript-eslint/parser@1.11.0
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: eslint-plugin-dev-test@1.0.0
npm ERR! Found: eslint@4.19.1
npm ERR! node_modules/eslint
npm ERR!   eslint@"4" from the root project
npm ERR!   peer eslint@">= 3.2.1 < 6" from @cypress/eslint-plugin-dev@3.2.0
npm ERR!   node_modules/@cypress/eslint-plugin-dev
npm ERR!     @cypress/eslint-plugin-dev@"3.2.0" from the root project
npm ERR!   1 more (@cypress/eslint-plugin-json)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0" from @typescript-eslint/parser@1.11.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   @typescript-eslint/parser@"1.11.0" from the root project
npm ERR!   peer @typescript-eslint/parser@">= 1.11.0" from @cypress/eslint-plugin-dev@3.2.0
npm ERR!   node_modules/@cypress/eslint-plugin-dev
npm ERR!     @cypress/eslint-plugin-dev@"3.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Suggestion

  • Remove ESLint 4.x from testing (see PR #165)
  • Remove ci/circleci: test-v4 from required tests in GitHub branch protection rules for master branch

To support resolution of this issue please remove ci/circleci: test-v4 from the required tests in GitHub branch protection rules for the master branch as I do not have the necessary permissions to do this myself and it cannot be triggered as a PR. (See Managing a branch protection rule.)

This issue is now resolved.

  • No more tests are carried out for ESLint 4 #165
  • test-v4 has been removed from the branch protection rules #165 (comment)