Biome error level proposal #9317
grahamcracker1234
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal
Introduce a CLI flag for
biome checkandbiome ci:This flag would control the minimum diagnostic level that causes the CLI to exit with a non-zero status.
Examples:
This makes it possible to enforce stricter CI policies such as requiring zero diagnostics of any level.
Motivation
Biome currently supports:
--error-on-warningsto fail the CLI when warnings occurHowever, this behavior is controlled by a special-case boolean flag rather than a general diagnostic threshold.
An
--error-levelflag would make the failure behavior explicit, predictable, and configurable, instead of relying on a single toggle that only covers warnings.Relationship to existing CLI levels
Biome already uses level-based flags in other parts of the CLI:
--diagnostic-level--log-levelAdding
--error-levelwould extend this same level-based model to exit behavior, keeping the CLI concepts consistent.Alternatives
1) Manually raise
infodiagnostics towarnA workaround today is to promote severities in configuration so that anything you consider CI-blocking is at least
warn, then run with a warnings-as-errors policy.In practice this is non-trivial because it requires manual, rule-by-rule adjustments (and ongoing maintenance as rules are added/changed). It’s also error-prone: it’s easy to miss a rule, miss a new rule, or end up with inconsistent severity across repos.
2) Different CI policies per branch/workflow
Some teams don’t actually want a single global “treat everything as an error” behavior.
Example policies:
main): enforce zero diagnostics of any level (infoincluded).infodiagnostics (or treat them as advisory), while still failing onwarn/error.--error-level=<info|warn|error>makes these policies straightforward to express at the workflow level without needing to rewrite rule severities.Deprecating
--error-on-warnings--error-on-warningscould become an alias for:Over time it could be deprecated in favor of the more general
--error-levelflag.Beta Was this translation helpful? Give feedback.
All reactions