Skip to content
Latchkey

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.

ESLint
/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

  1. Read the file:line and rule name in each error.
  2. Fix the code, or auto-fix the fixable ones.
  3. Re-run locally until ESLint exits 0.
Terminal
npx eslint . --fix
npx eslint .   # confirm exit 0

Reclassify 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
// 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 error intentionally and fix the backlog first.
  • Keep the lint config in sync between local and CI.

Frequently asked questions

What causes ""Command failed with exit code 1""?
One or more rules configured as error were triggered. ESLint returns exit code 1 for any error, which is the intended CI gate.
How do I fix "Command failed with exit code 1"?
Read and fix the reported errors

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card