chore(oxlint/lsp): respect RuleCustomization.severity for lsp diagnostics#21757
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
f45ac81 to
5b158c3
Compare
aa883de to
d97aff6
Compare
RuleCustomization.serverity for lsp diagnosticsRuleCustomization.severity for lsp diagnostics
d97aff6 to
91eb4be
Compare
5b158c3 to
56fe146
Compare
91eb4be to
cd4cbfd
Compare
56fe146 to
82da3b2
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the oxlint LSP pipeline so that per-rule rulesCustomization.severity can override the severity of emitted LSP diagnostics (and suppress diagnostics entirely when set to off), and adds a snapshot test/fixture to validate the behavior.
Changes:
- Thread
rulesCustomizationthroughServerLinterand apply it when converting linter messages to LSP diagnostics. - Change
message_to_lsp_diagnosticto optionally return no diagnostic (off), and update the LSP lint flow accordingly. - Add a new LSP fixture + snapshot + test covering
warnandoffcustom severities.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/src/lsp/snapshots/fixtures_lsp_rules_customization_severity@test.ts.snap | New snapshot asserting no-debugger becomes Warning and no-console is suppressed. |
| apps/oxlint/src/lsp/server_linter.rs | Propagates rules_customization into ServerLinter and uses filter_map when building diagnostics; adds a test for the new fixture. |
| apps/oxlint/src/lsp/options.rs | Makes RuleCustomizationSeverity clonable for downstream use. |
| apps/oxlint/src/lsp/error_with_position.rs | Applies rulesCustomization.severity during message→diagnostic conversion, including suppression when off. |
| apps/oxlint/fixtures/lsp/rules_customization/severity/test.ts | Fixture input that triggers no-debugger and no-console. |
| apps/oxlint/fixtures/lsp/rules_customization/severity/.oxlintrc.json | Fixture config enabling both rules as baseline errors. |
Comments suppressed due to low confidence (1)
apps/oxlint/src/lsp/options.rs:78
RuleCustomizationSeverityis a small C-like enum; derivingCopy(as done forRun/UnusedDisableDirectives) would remove the need for cloning it when reading rule customizations and simplify call sites.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(rename_all = "camelCase")]
pub enum RuleCustomizationSeverity {
Error,
Warn,
Info,
Hint,
Off,
}
cd4cbfd to
f32a579
Compare
82da3b2 to
2b5e037
Compare
f32a579 to
095fc4f
Compare
16b132b to
17c73ea
Compare
095fc4f to
0bb42d8
Compare
17c73ea to
be04882
Compare
17c73ea to
b2e3df4
Compare
0bb42d8 to
db5bff5
Compare
db5bff5 to
1d5f179
Compare
Merge activity
|
…ostics (#21757) > ## Pull request overview > This PR updates the oxlint LSP pipeline so that per-rule `rulesCustomization.severity` can override the severity of emitted LSP diagnostics (and suppress diagnostics entirely when set to `off`),
1d5f179 to
692bab9
Compare

Uh oh!
There was an error while loading. Please reload this page.