The Next.js plugin was not detected in your ESLint configuration and after adding it breaks because has no flat format #74610
Replies: 5 comments
-
I believe that we can use this workaround for now: #71763 (comment). But yeah, it’d be great to see native FlatConfig support in a future Next.js release. |
Beta Was this translation helpful? Give feedback.
-
@rzimmerdev Can you clarify if you are just trying to use flat config with Next.js v15? Currently, we do have flat config set up with the latest Create Next App.
|
Beta Was this translation helpful? Give feedback.
-
We hit this warning when folloiwng this setup instead: #49337 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
One more thing to note: both Popular ESLint plugins are getting shipped with typings since FlatConfig has become the default. |
Beta Was this translation helpful? Give feedback.
-
I am not sure if I am missing something but in my project I am trying to use eslint 9 with next but keep getting the warning: No matter what I do, I cannot get rid of this warning and make it detect the Next.js plugin? Right now I am using something like: const nextConfig = [...compat.extends('next/core-web-vitals', 'next/typescript')];
export default tseslint.config(
globalIgnores,
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
typedLinting,
...nextConfig,
...typescriptConfig,
...prettierConfig,
) However, I have tried a number of different configurations. Has anybody gotten this to work without the error showing? |
Beta Was this translation helpful? Give feedback.
-
Link to the code that reproduces this issue
https://github.com/divergex/divergex.github.io
To Reproduce
Setup project with next, add Eslint and setup with
pnpm create @eslint/config@latest
Then, run
next lint
eslint.config.mjs
gives ⚠ The Next.js plugin was not detected in your ESLint configuration.
gives Config (unnamed): Key "plugins": This appears to be in eslintrc format (array of strings) rather than flat config format (object).
and pluginNext isn't iterable neither has a flat attribute.
Current vs. Expected behavior
Current behavior is that
next lint
fails, and expected behaviour obviously is that it should work with the correct format.Provide environment information
Which area(s) are affected? (Select all that apply)
Linting
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions