-
Notifications
You must be signed in to change notification settings - Fork 29.4k
Closed
Labels
LintingRelated to `next lint` or ESLint with Next.js.Related to `next lint` or ESLint with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.
Description
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/vigilant-pine-6wmz8y
To Reproduce
- Add
next lint
script to package.json per https://nextjs.org/docs/app/building-your-application/configuring/eslint - Add
.eslintrc.json
to project per https://nextjs.org/docs/app/building-your-application/configuring/eslint
{
"extends": "next/core-web-vitals"
}
- Run lint and get an error
➜ /workspace git:(master) ✗ npm run lint
> lint
> next lint
Invalid Options:
- Unknown options: useEslintrc, extensions, resolvePluginsRelativeTo, rulePaths, ignorePath, reportUnusedDisableDirectives
- 'extensions' has been removed.
- 'resolvePluginsRelativeTo' has been removed.
- 'ignorePath' has been removed.
- 'rulePaths' has been removed. Please define your rules using plugins.
- 'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.
Current 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
DopamineDriven, 1202design, paberzs-davis, davidjulakidze, lucascorrea-max and 304 moresamcx, William-Owen, nlfonseca, danlutz, joaopedrodcf and 35 more
Metadata
Metadata
Assignees
Labels
LintingRelated to `next lint` or ESLint with Next.js.Related to `next lint` or ESLint with Next.js.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.