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

docs: eslint-plugin-dev readme add eslint 8+ unsupported #29346

Merged

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented Apr 17, 2024

Additional details

Attempting to lint @cypress/eslint-plugin-dev with ESLint v8 fails with:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin '@cypress/dev' declared in '.eslintrc.json': Package subpath './lib/rules/arrow-body-style' is not defined by "exports"

The ESLint Migrate to v8.0.0 document describes the following in the section The /lib entrypoint has been removed:

Beginning in v8.0.0, ESLint is strictly defining its public API. Previously, you could reach into individual files such as require("eslint/lib/rules/semi") and this is no longer allowed. There are a limited number of existing APIs that are now available through the /use-at-your-own-risk entrypoint for backwards compatibility, but these APIs are not formally supported and may break or disappear at any point in time.

The following code shows that @cypress/eslint-plugin-dev is using require in the way that is described as no longer allowed in ESLint 8.x.

const arrowBodyStyle = require('eslint/lib/rules/arrow-body-style')

Steps to test

  1. https://github.com/cypress-io/eslint-plugin-cypress is configured with eslint@^7.32.0 and with @cypress/eslint-plugin-dev@3.9.1. The CircleCI workflow confirms that linting is successful with ESLint 7.x.
  2. The steps to reproduce in @cypress/eslint-plugin-dev not compatible with ESLint v8 and later #29344 show that @cypress/eslint-plugin-dev@5.3.3 (latest available version) fails with ESLint 8.x.

How has the user experience changed?

There is no change to the end-user experience. This is a documentation-only change which affects Cypress developers only.

PR Tasks

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399

This comment was marked as outdated.

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.

@MikeMcC399 Thanks for the clarity on this.

@jennifer-shehane jennifer-shehane merged commit b50ddd6 into cypress-io:develop Apr 17, 2024
32 of 34 checks passed
@MikeMcC399 MikeMcC399 deleted the issue-29344-max-eslint branch April 17, 2024 17:24
jj497 pushed a commit to jj497/cypress that referenced this pull request May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@cypress/eslint-plugin-dev not compatible with ESLint v8 and later
4 participants