Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support eslint v7 & v8 instead of ">= 3.2.1" #176

Merged

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented Apr 18, 2024

BREAKING CHANGE: Support ESLint v7 and v8 only

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 [email protected] (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.

Change

Support ESlint v7 & v8 instead of all versions from ESLint 3.2.1 upwards.

To allow this repo to use up-to-date linting plugins and prepare the path for migration to ESLint v9 this PR triggers a new major version which supports ESLint v7 and v8 only. Earlier legacy versions v3 - v6 are dropped. The as-yet incompatible ESLint v9 is blocked from inadvertent usage. (See ESLint v9.0.0 released announcement dated Apr 5, 2024.)

eslint version last release action
3.2.1 8 years ago block
v4 6 years ago block
v5 5 years ago block
v6 4 years ago block
v7 3 years ago keep
v8 4 months ago keep
v9 13 days ago block
  • The README document now says that ESLint v7 or v8 are prerequisites and that ESLint v9 is not supported yet. References to ESLint v4 and v5 are removed.
  • package.json peerDependencies now define
    "eslint": ">=7 <9"
  • circle.yml runs
    • test-v7
    • test-v8

Verification

Ubuntu 22.04.4 LTS Node.js 20.12.2

mkdir eslint-plugin-cypress-test
cd eslint-plugin-cypress-test
git init
npm init -y
npm install eslint@8 MikeMcC399/eslint-plugin-cypress#support-eslint-7-and-8 -D

shows:

$ npm install eslint@8 MikeMcC399/eslint-plugin-cypress#support-eslint-7-and-8 -D

added 100 packages, and audited 101 packages in 14s

23 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

The following correctly reports an error:

npm install eslint@9 MikeMcC399/eslint-plugin-cypress#support-eslint-7-and-8 -D
$ npm install eslint@9 MikeMcC399/eslint-plugin-cypress#support-eslint-7-and-8 -D
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=7 <9" from [email protected]
npm ERR! node_modules/eslint-plugin-cypress
npm ERR!   dev eslint-plugin-cypress@"MikeMcC399/eslint-plugin-cypress#support-eslint-7-and-8" 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.

@cypress-app-bot
Copy link

@MikeMcC399

This comment was marked as resolved.

@jennifer-shehane
Copy link
Member

@MikeMcC399 I removed and added the required status checks.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 18, 2024 15:07
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

Looks good.

@MikeMcC399
Copy link
Collaborator Author

ESLint 8 in CircleCI is successful with warnings. The warnings are expected and can be ignored.

https://app.circleci.com/pipelines/github/cypress-io/eslint-plugin-cypress/234/workflows/476a2b78-d4c4-43a8-b5ee-46273b3dc126/jobs/926

BREAKING CHANGE: Support ESLint v7 and v8 only

Support for ESlint v3, v4, v5 & v6 is removed
ESLint v9 is not yet supported

Co-Authored-By: Jennifer Shehane <[email protected]>
@MikeMcC399 MikeMcC399 force-pushed the support-eslint-7-and-8 branch from 8bc8170 to bafb3b6 Compare April 19, 2024 15:10
@MikeMcC399

This comment was marked as resolved.

@MikeMcC399 MikeMcC399 marked this pull request as ready for review April 19, 2024 15:13
@jennifer-shehane jennifer-shehane merged commit 9499f42 into cypress-io:master Apr 19, 2024
6 checks passed
@MikeMcC399
Copy link
Collaborator Author

MikeMcC399 commented Apr 19, 2024

@jennifer-shehane

Thank you for merging!

The merge was successful, however the release v3.0.0 failed to release. Something went wrong in the semantic-release when it tried to create the tag v3.0.0 and modify it. I'll open a separate issue for the release topic.

@MikeMcC399
Copy link
Collaborator Author

@MikeMcC399 MikeMcC399 deleted the support-eslint-7-and-8 branch April 22, 2024 06:01
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outdated peerDependencies eslint >= 3.2.1 Support ESLint 8.x
3 participants