Skip to content

chore(oxlint/lsp): define rulesCustomization#21756

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

chore(oxlint/lsp): define rulesCustomization#21756
graphite-app[bot] merged 1 commit into
mainfrom
04-25-chore_oxlint_lsp_define_rulescustomization_

Conversation

@Sysix

@Sysix Sysix commented Apr 25, 2026

Copy link
Copy Markdown
Member

Related oxc-project/oxc-vscode#22

Created a POC form a new LSP configuration ruleCustomization, which allows users to override the output of the linter. It will not change the behavior, because the integration with nested config and Co. would to too much for it.
This aligns how VS Code ESLint does it: microsoft/vscode-eslint#1541

VS Code ESLint supports with eslint.rules.customizations another structure with "glob" support (see related issue).
For simplicity, I created a normal map. I am not sure, if glob features are really needed.

Because of this, the struct is different from eslint.rules.customizations.

  • severity will change the output diagnostic, or remove it completely with "off", I think that what VS Code does too
  • autofix is new and has nothing to do with fixable from ESLint. It will disable the fix for the code actions on save. Allowing users to avoid unexpected remove of code described by linter: Allow filtering rules that are applied on save by name #21538

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 added A-linter Area - Linter A-editor Area - Editor and Language Server labels Apr 25, 2026

@camc314 camc314 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.

👍 this is a great idea

Comment thread apps/oxlint/src/lsp/options.rs
@camc314 camc314 self-assigned this Apr 27, 2026
@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

Defines a new LSP-side configuration option, rulesCustomization, intended to let editors override reported diagnostics severity and whether a rule participates in “fix all” code actions—without changing the underlying linting behavior.

Changes:

  • Adds rulesCustomization (rule-name → customization map) to LintOptions and introduces the supporting types.
  • Implements custom deserialization that skips invalid per-rule customization entries instead of failing the whole options object.
  • Extends unit tests to cover valid/invalid customization payloads.

Comment thread apps/oxlint/src/lsp/options.rs
Comment thread apps/oxlint/src/lsp/options.rs Outdated
Comment thread apps/oxlint/src/lsp/options.rs
Comment thread apps/oxlint/src/lsp/options.rs Outdated
@Sysix Sysix force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from 82da3b2 to 2b5e037 Compare April 28, 2026 19:51
@Sysix Sysix marked this pull request as ready for review April 28, 2026 19:52
@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
@camc314 camc314 force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from 17c73ea to be04882 Compare May 5, 2026 09:15
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label May 5, 2026

camc314 commented May 5, 2026

Copy link
Copy Markdown
Contributor

Merge activity

Related oxc-project/oxc-vscode#22

Created a POC form a new LSP configuration `ruleCustomization`, which allows users to override the **output** of the linter. It will not change the behavior, because the integration with nested config and Co. would to too much for it.
This aligns how VS Code ESLint does it: microsoft/vscode-eslint#1541

VS Code ESLint supports with `eslint.rules.customizations` another structure with "glob" support (see related issue).
For simplicity, I created a normal map. I am not sure, if glob features are really needed.

Because of this, the struct is different from `eslint.rules.customizations`.
- `severity` will change the output diagnostic, or remove it completely with "off", I think that what VS Code does too
- `autofix` is new and has nothing to do with `fixable` from ESLint. It will disable the fix for the code actions on save. Allowing users to avoid unexpected remove of code described by #21538
@graphite-app graphite-app Bot force-pushed the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch from be04882 to b2e3df4 Compare May 5, 2026 09:21
@graphite-app graphite-app Bot merged commit b2e3df4 into main May 5, 2026
25 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 5, 2026
@graphite-app graphite-app Bot deleted the 04-25-chore_oxlint_lsp_define_rulescustomization_ branch May 5, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants