You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
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.
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"
$ npx eslint .
Oops! Something went wrong! :(
ESLint: 8.57.0
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"in /home/mike/github/eslint-plugin-dev-test/node_modules/eslint/package.json
Referenced from: /home/mike/github/eslint-plugin-dev-test/.eslintrc.json
at exportsNotFound (node:internal/modules/esm/resolve:304:10)
at packageExportsResolve (node:internal/modules/esm/resolve:651:9)
at resolveExports (node:internal/modules/cjs/loader:590:36)
at Module._findPath (node:internal/modules/cjs/loader:667:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1129:27)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/home/mike/github/eslint-plugin-dev-test/node_modules/@cypress/eslint-plugin-dev/lib/custom-rules/arrow-body-multiline-braces.js:2:24)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
Other
No response
The text was updated successfully, but these errors were encountered:
It'd be nicer to update it, but a documentation note seems sufficient for today.
I don't see a quick fix for this, so before anybody else trips up over the compatibility issue like I did, I thought it was a good idea to document it. I see that @AtofStryker is fixing some issues in https://github.com/cypress-io/cypress/tree/update-eslint-plugin-dev but that doesn't solve the compatibility issue with ESLint 8.x.
Current behavior
Attempting to lint using @cypress/eslint-plugin-dev with ESLint
v8
fails with:The ESLint Migrate to v8.0.0 describes the following in the section The /lib entrypoint has been removed:
The following code shows that @cypress/eslint-plugin-dev is using
require
in the way that is described as no longer allowed in ESLint8.x
.cypress/npm/eslint-plugin-dev/lib/custom-rules/arrow-body-multiline-braces.js
Line 2 in 768afcc
Desired behavior
Add the restriction to the npm/eslint-plugin-dev/README.md that ESLint
7.x
is the highest version supported by @cypress/eslint-plugin-dev.Test code to reproduce
On Ubuntu
22.04.4
LTS with Node.js20.12.2
, execute the following:mkdir eslint-plugin-dev-test cd eslint-plugin-dev-test git init npm init -y npm install eslint@8 @cypress/eslint-plugin-dev eslint-plugin-json-format @typescript-eslint/parser@6 @typescript-eslint/eslint-plugin@6 eslint-plugin-mocha -D
Add the file
.eslintrc.json
with the following contents to the root of the above project:touch index.js npx eslint .
Note the error message:
Cypress Version
@cypress/eslint-plugin-dev
v5.3.3
Node version
v20.12.2
LTSOperating System
Ubuntu
22.04.4
LTSDebug Logs
Other
No response
The text was updated successfully, but these errors were encountered: