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

[eslint-config-next] Incompatible with eslint@8.0.0 #29829

Closed
JustFly1984 opened this issue Oct 11, 2021 · 10 comments · Fixed by #29865
Closed

[eslint-config-next] Incompatible with eslint@8.0.0 #29829

JustFly1984 opened this issue Oct 11, 2021 · 10 comments · Fixed by #29865
Labels
bug Issue was opened via the bug report template.

Comments

@JustFly1984
Copy link

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

16.7

What browser are you using?

irrelevant

What operating system are you using?

irrelevant

How are you deploying your application?

irrelevant

Describe the Bug

Updating to eslint@8.0.0 produces an error:

Oops! Something went wrong! :(

ESLint: 8.0.0

Error: Cannot read config file: /Users/justfly/projects/tkww/homescreen-v2/node_modules/eslint-config-next/index.js
Error: Failed to patch ESLint because the calling module was not recognized.
If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:
https://github.com/microsoft/rushstack/issues
Referenced from: /Users/justfly/projects/tkww/homescreen-v2/node_modules/eslint-config-next/core-web-vitals.js
    at Object.<anonymous> (/Users/justfly/projects/tkww/homescreen-v2/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:58:19)
    at Module._compile (/Users/justfly/projects/tkww/homescreen-v2/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (/Users/justfly/projects/tkww/homescreen-v2/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/justfly/projects/tkww/homescreen-v2/node_modules/@rushstack/eslint-patch/modern-module-resolution.js:1:63)
    at Module._compile (/Users/justfly/projects/tkww/homescreen-v2/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

Currently reverted to 7.32.0

Expected Behavior

Should support eslint@8

To Reproduce

update eslint to latest 8.0.0 version in any nextjs project using eslint-config-next

@JustFly1984 JustFly1984 added the bug Issue was opened via the bug report template. label Oct 11, 2021
@linosorice
Copy link

same for me

@stefanprobst
Copy link
Contributor

see #29770

@JustFly1984
Copy link
Author

I'm managing my own eslintrc.js and I have all dependencies versions strict (without ^). I've created this issue, cos I've tested updating eslint only. Now I'm faced another issue with eslint-plugin-import, which crashes vscode linting cos it is missing eslint-module-utils for some reason. I've added yarn add -D eslint-module-utils and now I'm getting multiple errors: Cannot read property 'body' of undefined Occurred while linting file ... in vscode problems Eslint output.

There is already an issue import-js/eslint-plugin-import#2255

@ljharb
Copy link

ljharb commented Oct 12, 2021

yarn upgrade eslint-module-utils should fix it, until the next patch release of eslint-plugin-import.

@ljharb
Copy link

ljharb commented Oct 13, 2021

eslint-plugin-import has been released; upgrade to v2.25.2 and you should be fine.

@rafde
Copy link

rafde commented Oct 13, 2021

I am still seeing

node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:58:19) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (node_modules/@rushstack/eslint-patch/modern-module-resolution.js:1:1) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

with the eslint-plugin-import 2.25.2

you have to resolve to "@rushstack/eslint-patch": "1.0.8", to get it working

I highly would not recommend upgrading to eslint 8. There are many breaking changes that require rule authors to update their implementation

@housseindjirdeh
Copy link
Collaborator

housseindjirdeh commented Oct 13, 2021

ESLint 8 is not yet supported (see #29770). There's already a PR to add support that's in progress (#29865)

@monsieurnebo
Copy link

Same issue over here, hoping to see the PR merging soon 🤞

@jbergstroem
Copy link

jbergstroem commented Nov 10, 2021

You will likely also run into somehting like this:

$ yarn run eslint
yarn run v1.22.15
$ eslint --ext=ts,tsx .

Oops! Something went wrong! :(

ESLint: 8.2.0

Error: Rules with suggestions must set the `meta.hasSuggestions` property to `true`.

This was fixed in the latest version of eslint-plugin-react-hooks released a few hours ago, so next should just update its deps for eslint-config-next (or just regenerate your lockfile)

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants