The Next.js plugin was not detected in your ESLint configuration #28485
-
I tried to follow the docs as best as possible, but now when I run
This is the
This is the
This is
Do you see anything wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hello ! The second file seems to override the first. If you get rid of
it should fix your problem. |
Beta Was this translation helpful? Give feedback.
-
Can I ask that the above answer be fixed to include the correct file naming; and the file locations of these config files? |
Beta Was this translation helpful? Give feedback.
-
I see The Next.js plugin was not detected in your ESLint configuration this warning when I run pnpm run lint on my monorepo. root web-app is next.js application with next 15.3.3 Here is the repo link |
Beta Was this translation helpful? Give feedback.
-
This is my eslint.config.mjs import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: {
extends: ["eslint:recommended", "plugin:react/recommended"],
},
});
const eslintConfig = [
...compat.config({
extends: ["next/core-web-vitals", "next/typescript", "prettier"],
plugins: [
"simple-import-sort",
"import",
"prettier",
"unused-imports",
"no-relative-import-paths",
],
ignorePatterns: [
"**/dist/**",
"**/build/**",
"**/coverage/**",
"src/components/ui/**",
"src/lib/api/generated/**",
"public/js/**/*.js",
"*.config.mjs",
],
parserOptions: {
sourceType: "module",
ecmaVersion: "latest",
project: "./tsconfig.json",
tsconfigRootDir: import.meta.dirname,
},
}),
];
export default eslintConfig; |
Beta Was this translation helpful? Give feedback.
Hello !
I don't think you need both
.eslintrc.json
and.eslinrc.js
.In fact it might be the root cause of your issue.
The second file seems to override the first.
If you get rid of
.eslintrc.json
to only keep.eslinrc.js
and add the next plugin at the end like :it should fix your problem.