`next lint` does not pick up `eslint.config.js` in the same directory
Answered
Spinge Bib Sqorpnts posted this in #help-forum
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.
2 Replies
@Spinge Bib Sqorpnts 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`:
js
import eslintConfig from '../../eslint.config.mjs';
export default [
...eslintConfig,
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: import.meta.dirname,
},
},
}
];
eslint-config-next does not support eslint v9 or the config.js format. you have to use eslint v8 and the eslintrc configuration format.
Answer
@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.
Unfortunate...
Had to translate my entire monorepo back to v8, but I guess it's my fault for not checking first. Thanks a lot!
Had to translate my entire monorepo back to v8, but I guess it's my fault for not checking first. Thanks a lot!