Skip to content

chore(oxlint/lsp): respect RuleCustomization.severity for lsp diagnostics#21757

Merged
graphite-app[bot] merged 1 commit into
mainfrom
04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics
May 5, 2026
Merged

chore(oxlint/lsp): respect RuleCustomization.severity for lsp diagnostics#21757
graphite-app[bot] merged 1 commit into
mainfrom
04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics

Conversation

@Sysix

@Sysix Sysix commented Apr 25, 2026

Copy link
Copy Markdown
Member

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),

Sysix commented Apr 25, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from f45ac81 to 5b158c3 Compare April 25, 2026 21:08
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from aa883de to d97aff6 Compare April 25, 2026 21:08
@Sysix Sysix changed the title chore(oxlint/lsp): respect RuleCustomization.serverity for lsp diagnostics chore(oxlint/lsp): respect RuleCustomization.severity for lsp diagnostics Apr 26, 2026
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from d97aff6 to 91eb4be Compare April 26, 2026 12:29
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from 5b158c3 to 56fe146 Compare April 26, 2026 12:29
@camc314 camc314 self-assigned this Apr 27, 2026
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from 91eb4be to cd4cbfd Compare April 28, 2026 19:35
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from 56fe146 to 82da3b2 Compare April 28, 2026 19:35
@Sysix Sysix requested a review from Copilot April 28, 2026 19:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rulesCustomization through ServerLinter and apply it when converting linter messages to LSP diagnostics.
  • Change message_to_lsp_diagnostic to optionally return no diagnostic (off), and update the LSP lint flow accordingly.
  • Add a new LSP fixture + snapshot + test covering warn and off custom 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

  • RuleCustomizationSeverity is a small C-like enum; deriving Copy (as done for Run/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,
}

Comment thread apps/oxlint/src/lsp/error_with_position.rs
Comment thread apps/oxlint/src/lsp/error_with_position.rs Outdated
@Sysix Sysix changed the base branch from 04-25-chore_oxlint_lsp_define_rulescustomization_ to graphite-base/21757 April 28, 2026 19:51
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from cd4cbfd to f32a579 Compare April 29, 2026 18:31
@Sysix Sysix force-pushed the graphite-base/21757 branch from 82da3b2 to 2b5e037 Compare April 29, 2026 18:31
@Sysix Sysix changed the base branch from graphite-base/21757 to 04-25-chore_oxlint_lsp_define_rulescustomization_ April 29, 2026 18:31
@Sysix Sysix marked this pull request as ready for review April 29, 2026 18:35
@Sysix Sysix requested a review from camc314 as a code owner April 29, 2026 18:35
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from f32a579 to 095fc4f Compare April 29, 2026 21:09
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch 2 times, most recently from 16b132b to 17c73ea Compare May 4, 2026 20:15
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from 095fc4f to 0bb42d8 Compare May 4, 2026 20:15
@camc314 camc314 force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from 17c73ea to be04882 Compare May 5, 2026 09:15
@graphite-app graphite-app Bot changed the base branch from 04-25-chore_oxlint_lsp_define_rulescustomization_ to graphite-base/21757 May 5, 2026 09:21
@graphite-app graphite-app Bot force-pushed the graphite-base/21757 branch from 17c73ea to b2e3df4 Compare May 5, 2026 09:26
@graphite-app graphite-app Bot force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from 0bb42d8 to db5bff5 Compare May 5, 2026 09:26
@graphite-app graphite-app Bot changed the base branch from graphite-base/21757 to main May 5, 2026 09:27
@graphite-app graphite-app Bot force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from db5bff5 to 1d5f179 Compare May 5, 2026 09:27
@camc314 camc314 added A-linter Area - Linter 0-merge Merge with Graphite Merge Queue labels May 5, 2026

camc314 commented May 5, 2026

Copy link
Copy Markdown
Contributor

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`),
@graphite-app graphite-app Bot force-pushed the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch from 1d5f179 to 692bab9 Compare May 5, 2026 09:37
@graphite-app graphite-app Bot merged commit 692bab9 into main May 5, 2026
25 checks passed
@graphite-app graphite-app Bot deleted the 04-25-chore_oxlint_lsp_respect_rulecustomization.serverity_for_lsp_diagnostics branch May 5, 2026 09:42
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants