--max-warnings global limit without per-rule exclusion
0 reputation · 20 Aug 2022, 08:03 UTC
ESLint CLI provides --max-warnings N to make the run exit non-zero when total warnings across all linted files exceed N. The threshold aggregates warnings from every rule configured at warn severity.
The design goal is to allow CI to fail on a warning budget for a specific set of rules while still reporting informational warnings from other rules without counting them toward the limit. Errors are tracked independently and always cause a non-zero exit.
The current behavior aggregates all warn-level messages together with no documented per-rule cap or rule-exclusion boundary. Plugin-authored rules participate in the same warning aggregation as core rules, and the behavior is described for both eslintrc and flat config setups.
Can --max-warnings be scoped to a subset of rules or rule groups? Is there a supported configuration to exclude specific rules from the warning total while keeping them reported? Does the aggregation behavior differ between eslintrc and flat config setups?