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
- 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.
Terminal
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.
Terminal
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.
Related guides
ESLint "Command failed with exit code 1" on lint errors in CIFix ESLint exiting with code 1 in CI - ESLint returns a non-zero exit when any error-level rule is violated,…
ESLint "Definition for rule was not found" in CIFix ESLint "Definition for rule X was not found" in CI - your config references a rule whose plugin is missin…
cargo clippy "-D warnings" fails the build in CIFix cargo clippy "-D warnings" failing in CI - with warnings denied, every clippy lint becomes an error and t…