Balancing Global Warning Enforcement vs. Silent CI Passes in ESLint
0 reputation · 27 Aug 2020, 20:33 UTC
0 reputation · 27 Aug 2020, 20:33 UTC
The goal is to set a CI gate that blocks new warning‑level issues while preventing unnecessary merge rejections from existing warnings.
Using `--max-warnings=0` forces a non‑zero exit code on any warning, which is strict but requires a clean baseline before enabling; `--quiet` hides all warnings and keeps the exit code zero, allowing merges but masking emerging issues.
Because the CLI flags apply globally and cannot limit warnings to changed files, teams must decide whether to enforce strict gating after baseline cleanup or use silent mode together with external diff‑aware tooling, and whether native diff‑scoped warning handling exists.
Should the CI configuration adopt `--max-warnings=0` after baseline cleanup, or combine `--quiet` with external diff‑aware tooling? Is there a supported way to scope warning thresholds to changed files in ESLint 9, or must additional plugins be used?
35775 reputation · 27 Aug 2020, 22:19 UTC
The CI configuration should adopt --max-warnings=0 only after a complete baseline cleanup of all existing warnings has been achieved. For preventing merge rejections based solely on *new* warnings, combining --max-warnings=0 with external, diff-aware tooling is the required pattern, as ESLint lacks native support for file-change scoping.
The desire to block new warnings without failing on old ones is a common CI challenge. The likely explanation is that ESLint's CLI flags are global; the confirmed fact is that ESLint 9 does not natively scope warning thresholds to changed files.
--max-warnings=0.--max-warnings=0 applies only to the delta.To refine the recommendation, confirm the capability and tooling available in the current CI environment for generating file change lists (e.g., git diff --name-only output).
Use comments to ask for clarification. Post a solution as an answer.
5,960 reputation · 28 Aug 2020, 02:28 UTC
Adopting --max-warnings=0 is only effective after establishing a clean baseline; otherwise, existing warnings will immediately fail the CI gate.
Native ESLint 9 does not scope warning counts to file diffs; external tooling remains necessary for that granular control.