@cypress/eslint-plugin-dev@3.2.0 conflicts through mocha for ESLint 5 support
MikeMcC399 opened this issue ยท comments
Issue
@cypress/eslint-plugin-dev@3.2.0 configured in this repo's devDependencies
contains conflicting peerDependencies
which disallow support of ESLint 5
:
"eslint": ">= 3.2.1 < 6",
"eslint-plugin-mocha": "^4.11.0",
eslint-plugin-mocha@4.12.1 is only compatible with ESLint 2
, 3
and 4
, not ESLint 5.x
:
"eslint": "^2.0.0 || ^3.0.0 || ^4.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@"^2.0.0 || ^3.0.0 || ^4.0.0" from eslint-plugin-mocha@4.12.1
Support for ESLint 5.x
is available in versions eslint-plugin-mocha@5.0.0 up until eslint-plugin-mocha@6.x
. The version after that is eslint-plugin-mocha@7.x
which is restricted to ESLint >= 7.x
.
- It is not until PR cypress-io/cypress#27944 and chore: release @cypress/eslint-plugin-dev-v5.3.3 that
peerDependencies
was corrected to"eslint-plugin-mocha": " >= 4.11.0"
.@cypress/eslint-plugin-dev-v5.3.3
defines"eslint": "^7.22.0"
indevDependencies
which does not include ESLint 5, so a update to this version is not yet possible.
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@5 @cypress/eslint-plugin-dev@3.2.0 @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4
Logs
$ npm install eslint@5 @cypress/eslint-plugin-dev@3.2.0 @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4
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@5.16.0
npm ERR! node_modules/eslint
npm ERR! eslint@"5" 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! 3 more (@cypress/eslint-plugin-json, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^2.0.0 || ^3.0.0 || ^4.0.0" from eslint-plugin-mocha@4.12.1
npm ERR! node_modules/eslint-plugin-mocha
npm ERR! peer eslint-plugin-mocha@"^4.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.
Workaround
Add the following to package.json
:
"overrides": {
"eslint-plugin-mocha": "$eslint-plugin-mocha"
}
Test with
npm install eslint@5 @cypress/eslint-plugin-dev@3.2.0 @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint-plugin-mocha@6
- This issue is planned to be resolved through #167
๐ This issue has been resolved in version 3.0.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐