Next.js plugin not detected using ESLint v9 #83037
Answered
by
Acervans
RobertFent
asked this question in
Help
-
SummaryDuring import { defineConfig, globalIgnores } from 'eslint/config';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import pluginNext from '@next/eslint-plugin-next';
import prettier from 'eslint-plugin-prettier';
import pluginCypress from 'eslint-plugin-cypress';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default defineConfig([
globalIgnores([
'**/node_modules',
'**/.next',
'**/*.config.*',
'**/*.js',
'**/next-env.d.ts'
]),
{
extends: compat.extends(
'next',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/stylistic',
'prettier',
'plugin:@next/next/recommended' // todo: The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/app/api-reference/config/eslint#migrating-existing-config
),
plugins: {
'@typescript-eslint': typescriptEslint,
'@next/next': pluginNext,
prettier,
cypress: pluginCypress
},
languageOptions: {
parser: tsParser
},
...pluginNext.configs.recommended.rules
}
}
]); All the other plugins are working like a charm. Anybody had the same problem? |
Beta Was this translation helpful? Give feedback.
Answered by
Acervans
Aug 28, 2025
Replies: 1 comment 1 reply
-
I had the same problem, it's because you're ignoring |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RobertFent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had the same problem, it's because you're ignoring
eslint.config.mjs
with the rule'**/*.config.*'
, so next can't read it.