-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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 was marked as abuse.
This comment was marked as abuse.
If only eslint-import is blocker right now then maybe its a good to consider use their fork https://github.com/un-ts/eslint-plugin-import-x ? Looks like it's a drop in replacement |
I've forced the usage of {
# ...
"overrides": {
"eslint-config-next": {
"eslint": "$eslint", # this means using dependency's value
"eslint-plugin-import": "npm:eslint-plugin-import-x@4.2.1"
}
}
} This seems to work but I did have to disable a '@next/next/no-duplicate-head': 'off', I'm curious if is this works for everyone! |
If anyone else is tired of waiting, you also have the option of using SonarLint. I know, it sounds crazy, but even the free edition has better NextJS rules than Vercel's own ESLint rules/plugins. Better yet, it lets you disable the server-side ones using a group rule, if you don't want to be screamed at by impossible I stumbled upon this "solution" for the few projects we have that are forced to stick with Next, since they're too old to migrate. The only downside is 600MB RAM usage on the vscode plugin. Otherwise, integrates 1-to-1 with |
Tried this, but also had to delete the compat for |
Question on import plugin, but it looks like they released support two weeks ago, but through a different PR? sources:
Is there more that is being waited on or was that the only thing that was needed? EDIT: forgot link to PR 🤦🏻♀️ |
@ldeveber that’s not correct; eslint-plugin-import has not released support for eslint v9 see import-js/eslint-plugin-import#2996 The PR you linked adds support for using flat config under eslint v8, which is not what this issue is about. Quoting the first message in the PR you linked:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Nobody knows when or if this will happen. You have the following options right now:
This is the nature of volunteer-operated FOSS. There is no guarantee, there is no obligation. rantBy choosing to use an open source project like next, you are assuming a certain amount of risk, and you are transitively assuming hidden risk from all the nested dependencies of such a project. The big lie you are told is that such frameworks abstract away all these problems, that you will never have to deal with them. But the truth is that if you can't deal with them, then using these dependencies is a bad choice for commercial production applications.If you don't have your own mirroring npm registry setup, you're not ready to use FOSS in production. If you can't dig into the underlying source code and understand on at least a basic level what's going on, you're not ready to use FOSS in production. If you can't figure out your own workarounds to problems like the one described in this thread, you're not ready to use FOSS in production. It really is disingenuous for organizations to represent projects like next as a batteries-included, comprehensive solution to your problem of building a website, but I also understand that that's the state of market competition. If any framework described on their marketing page what responsibilities users are actually taking on by building something on top of their code, everybody would be scared off toward something that hides those inevitable complexities from potential users. |
Thank you, but my question still remains:
Or more specifically, are there specific parts of 9 that are being waited on, or just allowing 9 as a dependency? EDIT:
And just want to clarify that I'm looking for more details to help, not trying to harp on what you guys do! |
eslint/eslint#18391 does list If you look at the entries for The issue for supporting eslint@9, the one that should be linked in that table, is import-js/eslint-plugin-import#2948 which has been locked. Edit: Double edit: |
I tried following your suggestions, however, when running "npm run lint", it seems as though the file is not read, because it asks me to setup eslint:
Did I miss a step? |
Make sure your replace the rule |
Thanks. Found your blog article and found a similar instruction. |
@samcx I see it’s the same developer who’s responsible for all three of those. Has anyone from Vercel asked if he needs any help to get things across the line? It’s quite a burden for one person. |
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: