ESLint "Command failed with exit code 1" on lint errors in CI
ESLint exits 1 whenever it reports at least one error-level problem. The job is not broken: the lint gate is working, and the fix is to resolve (or downgrade) the reported rule violations.
What this error means
The lint step prints a list of file:line errors and ends with "error Command failed with exit code 1." or "Process completed with exit code 1.". A clean run exits 0.
/home/runner/work/app/app/src/api.ts
12:7 error 'data' is assigned a value but never used @typescript-eslint/no-unused-vars
x 1 problem (1 error, 0 warnings)
error Command failed with exit code 1.Common causes
Real error-level rule violations
One or more rules configured as error were triggered. ESLint returns exit code 1 for any error, which is the intended CI gate.
New code or stricter rules surfaced issues
A merged change introduced violations, or a rule was promoted from warn to error, so previously passing code now fails.
How to fix it
Read and fix the reported errors
- Read the file:line and rule name in each error.
- Fix the code, or auto-fix the fixable ones.
- Re-run locally until ESLint exits 0.
npx eslint . --fix
npx eslint . # confirm exit 0Reclassify a rule deliberately if it is noise
If a rule should not block, set it to warn (or off) in config rather than ignoring exit code 1 globally.
// eslint.config.js
rules: { '@typescript-eslint/no-unused-vars': 'warn' }How to prevent it
- Run ESLint locally or in a pre-commit hook before pushing.
- Promote rules to
errorintentionally and fix the backlog first. - Keep the lint config in sync between local and CI.