A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
14.19k
stars
439
forks
source link
📎 Create new option `--diagnostic-level` #671
Closed
ematipico closed 10 months ago
Description
Relative discussion: https://github.com/biomejs/biome/discussions/550
This should be relatively easy to implement.
We want to add a new option to `CliOptions:
https://github.com/biomejs/biome/blob/main/crates/biome_cli/src/cli_options.rs#L8
Accepted values: "info", "warn" and "error"
Check how we do it in
LoggingLevel
, which is similar:https://github.com/biomejs/biome/blob/52dae46505805ecf87969544867c88a388df6b93/crates/biome_cli/src/cli_options.rs#L50-L55
What's different is that we already have a way to categorize diagnostics, here:
https://github.com/biomejs/biome/blob/52dae46505805ecf87969544867c88a388df6b93/crates/biome_diagnostics/src/diagnostic.rs#L114-L125
So the new options can be this:
This is the place where we print the diagnostics:
https://github.com/biomejs/biome/blob/52dae46505805ecf87969544867c88a388df6b93/crates/biome_cli/src/execute/traverse.rs#L570-L573
Before printing, we should filter diagnostics based on this new option