Hey, I am receiving this error:
TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor.
This is my eslint config:
import { FlatCompat } from '@eslint/eslintrc';
const compat = new FlatCompat({
// import.meta.dirname is available after Node.js v20.11.0
baseDirectory: import.meta.dirname,
// recommendedConfig: {
// root: true,
// extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
// parser: '@typescript-eslint/parser',
// parserOptions: { project: ['./tsconfig.json'] },
// plugins: ['@typescript-eslint'],
// ignorePatterns: ['node_modules', '.next', '.vercel', 'public'],
// },
});
const eslintConfig = [
...compat.config({
extends: [
'next',
'next/core-web-vitals',
'next/typescript',
'plugin:react/recommended',
'eslint:recommended',
'plugin:react-hooks/recommended',
],
rules: {
'@next/next/no-html-link-for-pages': 'off',
'@next/next/no-img-element': 'off',
'react/no-unescaped-entities': 'off',
'@next/next/no-page-custom-font': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
plugins: ['react', 'react-hooks'],
}),
];
export default eslintConfig;
How to fix this?