Skip to content
Latchkey

ESLint "too many warnings (maximum: 0)" --max-warnings in CI

With --max-warnings 0, ESLint exits 1 when the warning count exceeds the limit, even if there are zero errors. The gate is enforcing a clean-warning policy.

What this error means

The lint step ends with "ESLint found too many warnings (maximum: 0)." and exit code 1, while the report shows warnings but no errors.

ESLint
x 3 problems (0 errors, 3 warnings)

ESLint found too many warnings (maximum: 0).

Common causes

Warnings exceed the configured threshold

The job runs eslint --max-warnings 0, so any warning trips the gate and ESLint exits non-zero.

New warnings crept in under a zero-tolerance policy

A change added warning-level violations that the strict threshold no longer allows.

How to fix it

Resolve the warnings to reach the threshold

  1. List the warning-level problems in the report.
  2. Fix them, auto-fixing where possible.
  3. Re-run with the same --max-warnings to confirm a clean pass.
Terminal
npx eslint . --fix
npx eslint . --max-warnings 0

Raise the threshold intentionally if warnings are acceptable

If a clean-warning gate is too strict for now, set a non-zero ceiling explicitly rather than dropping the flag.

Terminal
npx eslint . --max-warnings 10

How to prevent it

  • Keep --max-warnings 0 and fix warnings as they appear.
  • Treat warnings as a debt budget tracked in CI.
  • Run the same flag locally so the threshold is not a surprise.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →