lo1tuma / eslint-plugin-mocha

ESLint rules for mocha
MIT License
279 stars 61 forks source link

Cannot install with ESLint 4 #355

Open MikeMcC399 opened 5 months ago

MikeMcC399 commented 5 months ago

Issue

The README > Install and configure for eslint-plugin-mocha@10.4.3 says:

This plugin requires ESLint 4.0.0 or later.

however attempting to install with ESLint 4.0.0 fails with:

npm ERR! Could not resolve dependency: npm ERR! peer eslint@">=7.0.0" from eslint-plugin-mocha@10.4.3

Steps to reproduce

On Ubuntu 22.04.4 LTS with Node.js 20.12.2 LTS

mkdir eslint-plugin-mocha-test
cd eslint-plugin-mocha-test
git init
npm init -y
npm install eslint@4.0.0 eslint-plugin-mocha@10 -D

Note the error

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

Logs

$ npm install eslint@4 eslint-plugin-mocha@10 -D
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: eslint-plugin-mocha-test@1.0.0
npm ERR! Found: eslint@4.19.1
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=7.0.0" from eslint-plugin-mocha@10.4.3
npm ERR! node_modules/eslint-plugin-mocha
npm ERR!   dev eslint-plugin-mocha@"10" 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

Suggest to update the README > Install and configure section to say:

This plugin requires ESLint 7.0.0 or later.

lo1tuma commented 5 months ago

Good catch, thank you. Since the breaking change was announced via the release notes, I think we are good and just need to update the README, as you suggested.

MikeMcC399 commented 5 months ago

@lo1tuma

Good catch, thank you. Since the breaking change was announced via the release notes, I think we are good and just need to update the README, as you suggested.

Yes, I see this under the release notes for 7.0.0. Thanks for pointing that out.

MikeMcC399 commented 4 days ago

@lo1tuma

The updated README is not visible on https://www.npmjs.com/package/eslint-plugin-mocha.

If you are removing support for ESLint 8 and below, you might want to wait until ESLint 8 becomes generally end-of-life on Oct 5, 2024 (see https://eslint.org/version-support/) and cut a new major breaking version 11.x .

lo1tuma commented 4 days ago

Yes, I’m planning a few more breaking changes, for the next major release. I doubt that I will finish that before Oct 5.

MikeMcC399 commented 4 days ago

@lo1tuma

Yes, I’m planning a few more breaking changes, for the next major release. I doubt that I will finish that before Oct 5.

One alternative is to first deprecate the earlier ESLint versions before dropping support. That wouldn't need a breaking major release. Just a thought for you 🙂 !