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.
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
- List the warning-level problems in the report.
- Fix them, auto-fixing where possible.
- Re-run with the same
--max-warningsto confirm a clean pass.
npx eslint . --fix
npx eslint . --max-warnings 0Raise 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.
npx eslint . --max-warnings 10How to prevent it
- Keep
--max-warnings 0and 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.