-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
next-lint Doesn't Support ESLint 9 #64409
Comments
Bumping this for visibility, it does not seem to prevent build but unsure of the impact.
|
Bumping this, it is breaking package update automation at my corp |
Yeah it's breaking change because ESLint 9.0.0 is a major release with a ton of breaking changes. You better hope NextJS didn't adhoc around every single ESLint implementation detail, so the migration to the newest version wouldn't take forever on their end. |
IMHO, the adoption should be done gradually in the following steps:
|
I would like to add that the new flat config file can have multiple names:
Source: https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file |
Not a fix but you can ignore eslint during build like so: // next.config.js
module.exports = {
eslint: {
// Warning: This allows production builds to successfully complete even if
// your project has ESLint errors.
ignoreDuringBuilds: true,
},
} This way you have manual control over eslint, you can run a custom linting config before build. |
I went back to version |
Same error .eslintrc.json : I updated all the packages to the latest version but this still does not solve the problem I don’t want to go back to the old version to fix it. If anyone knows how to solve the problem without going to the old version, please help me 🙏 |
The only package update of relevance is |
Same issue here, I thought I was crazy. Downgrade to an old version for now... 🤖 😸
|
having the same problem here, I have a custom-shared lint config and my latest PR when linked locally to test it it fails, sebalaini/sebalaini-lints-config#6 |
This comment has been minimized.
This comment has been minimized.
NextJS does not support version 9, yet. A different workaround would be vercel/next.js#64409 (comment)
I was trying your solution and it doesn't seem to work, since I run the command
|
Is there any update on a simple eslint.config.js configuration that works with NextJS and the ESLint v9? |
Hi everyone, Unfortunately, we were not able to ship this with Next.js 15. The current understanding of this is that we cannot do a clean ship of this until certain plugins add support for ESLint v9. For example:
We will share updates as they come! |
@samcx the Next.js team may also want to consider switching from I mentioned something similar in my comment on the In case anyone wants to upgrade to ESLint v9 now, an alternative is to switch to the
-import eslintImport from 'eslint-plugin-import';
+import eslintImportX from 'eslint-plugin-import-x';
/** @type {import('@typescript-eslint/utils/ts-eslint').FlatConfig.ConfigArray} */
const configArray = [
{
plugins: {
- import: eslintImport,
+ 'import-x': eslintImportX,
},
settings: {
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import-x/resolver': {
// Load <rootdir>/tsconfig.json
typescript: true,
node: true,
},
},
rules: {
// Error on imports that don't match the underlying file system
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
- 'import/no-unresolved': 'error',
+ // https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unresolved.md
+ 'import-x/no-unresolved': 'error',
},
]; |
@samcx just as a note (probably you've already seen the tweet thread), there are ways of shipping a config with those unsupporting plugins like
|
eslint-config-next が ESLint 9 をサポートしていないので、仕方なく対応する vercel/next.js#64409
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/vigilant-pine-6wmz8y
To Reproduce
next lint
script to package.json per https://nextjs.org/docs/app/building-your-application/configuring/eslint.eslintrc.json
to project per https://nextjs.org/docs/app/building-your-application/configuring/eslintCurrent vs. Expected behavior
Expected lint to run successfully, but it failed with errors.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 14.2.1-canary.0 // Latest available version is detected (14.2.1-canary.0). eslint-config-next: 14.1.4 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
ESLint (eslint-config-next)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
It looks like this is coming from https://github.com/vercel/next.js/blob/canary/packages/next/src/cli/next-lint.ts. This needs to be changed to support ESLint 9's flat config https://eslint.org/docs/latest/use/migrate-to-9.0.0#flat-config. The migration guide is at https://eslint.org/docs/latest/use/configure/migration-guide
NEXT-3112
The text was updated successfully, but these errors were encountered: