Angular "ng lint" ESLint failures in CI
ng lint delegates to angular-eslint. In CI it can fail because the project has no lint architect target, because the ESLint config was not migrated, or simply because lint rules that error should block the pipeline.
What this error means
The ng lint step fails with "Cannot find lint target" / "Cannot find 'lint' target for the specified project", or with a list of ESLint errors that exit non-zero.
An unhandled exception occurred: Cannot find "lint" target for the specified project.
You should add a package that implements linting capabilities.Common causes
No lint target configured
The project was not set up with angular-eslint, so angular.json has no lint architect target for ng lint to run.
Real lint errors, or an unmigrated config
ESLint reports genuine errors, or an old TSLint/ESLint config was never migrated, so the run exits non-zero.
How to fix it
Add angular-eslint and a lint target
Install the schematic which adds the lint target and a base config to the project.
ng add @angular-eslint/schematicsRun lint in CI and fix reported errors
Run ng lint as a pipeline gate and resolve the ESLint findings it reports.
- run: npx ng lintHow to prevent it
- Set up angular-eslint so a lint target exists.
- Keep the ESLint config migrated and current.
- Gate lint in CI so errors are caught before merge.