I just upgrade to NextJS 15.0.1, eslint 9.13.0, @next/eslint-plugin-next 15.0.1
I can't figure out how to get rid of this error during a build:
The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
The instructions at the provided URL are for the old eslintrc configuration format.
Any tips?
My eslint.config.mjs is as follows:
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
export default [
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
{languageOptions: {globals: {...globals.browser, ...globals.node}}},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {
"@typescript-eslint/no-unused-vars": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-empty-object-type": "off", // remove
"no-prototype-builtins": "off", // explore
"no-unused-vars": "warn",
"no-undef": "warn",
},
},
{
ignores: ["src/tools/"],
},
];
I'm just trying to get rid of the warning.
Try this
import pluginNext from '@next/eslint-plugin-next'
export default defineConfig([
{
plugins: {
'@next/next': pluginNext
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
...pluginNext.configs.recommended.rules
}
}
])