Next.js Discord

Discord Forum

`next lint` does not pick up `eslint.config.js` in the same directory

Answered
Spinge Bib Sqorpnts posted this in #help-forum
Open in Discord
Hello! I'm trying to run next lint, with an eslint.config.js present (flat config) but the CLI just suggests I'd create a new ESLint config file.

eslint.config.js:
import eslintConfig from '../../eslint.config.mjs';

export default [
  ...eslintConfig,
  {
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.json'],
        tsconfigRootDir: import.meta.dirname,
      },
    },
  }
];
Answered by joulev
eslint-config-next does not support eslint v9 or the config.js format. you have to use eslint v8 and the eslintrc configuration format.
View full answer

2 Replies