After upgrading my Angular project to version 20, ESLint started throwing the following error when I run linting (using Nx):
[error] (node:20947) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js".
[error] An unexpected error occurred: Error: Could not find config file. at t assertConfigurationExists (/*/config-loader.js:80:17)
at LegacyConfigLoader.loadConfigArrayForFile (/*/config-loader.js:414:3)
The project is an Nx monorepo with multiple Angular apps and libs. Here’s a simplified version of my setup:
At the root I have: eslint.client.js
// eslint.client.js
module.exports = {
extends: ['.eslintrc.json'],
ignorePatterns: ['!**/*'],
overrides: [{
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
project: join(__dirname, './tsconfig.base.json'),
sourceType: 'module',
},
files: ['*.ts'],
extends: ['plugin:@nx/typescript', 'plugin:@nx/angular', 'plugin:@angular-eslint/template/process-inline-templates', ],
rules: { // custom rules... }, }, ], };
And in each app/lib I have something like:
// .eslintrc.json
{
"extends": ["../../../eslint.client.js"],
"ignorePatterns": ["!**/*"]
}
Any idea?