Skip to content

feat(oxlint/lsp)!: show/fix safe suggestions by default#19816

Open
Sysix wants to merge 1 commit intomainfrom
02-27-feat_oxlint_lsp_show_fix_safe_suggestions_fixes_by_default
Open

feat(oxlint/lsp)!: show/fix safe suggestions by default#19816
Sysix wants to merge 1 commit intomainfrom
02-27-feat_oxlint_lsp_show_fix_safe_suggestions_fixes_by_default

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Feb 27, 2026

ESLint shows by default suggestions in the editor. We did not have the right architecture to difference between safe or dangerous fix / suggestions. With #19113 we know now what kind of fix this is.
This allows us now to align more with the ESLint editor experience. The last found tech dep was #19795.
This will not apply for editors which manage its own configurations like VS Code editor and IntelliJ Plugin (cc @nrayburn-tech). These editors need their own default value changed.

When using auto save source.fixAll.oxc or source.fixAll code action, or the oxc.fixAll command, the suggestions will be applied too. Because this is always in a context of one file only, I guess this is safe. Or we can change the line for this:

// Only safe fixes or suggestions are applied in "fix all" action/command.
if !FixKind::SafeFixOrSuggestion.can_apply(fixed_content.kind) {
debug!("Skipping unsafe fix for fix all action: {}", fixed_content.message);
continue;
}

Copy link
Member Author

Sysix commented Feb 27, 2026


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 hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Feb 27, 2026
@Sysix Sysix changed the title feat!(oxlint/lsp): show/fix safe suggestions fixes by default feat!(oxlint/lsp): show/fix safe suggestions by default Feb 27, 2026
@Sysix Sysix changed the title feat!(oxlint/lsp): show/fix safe suggestions by default feat(oxlint/lsp)!: show/fix safe suggestions by default Feb 27, 2026
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Feb 27, 2026
@Sysix Sysix force-pushed the 02-27-feat_oxlint_lsp_show_fix_safe_suggestions_fixes_by_default branch from 9ba7686 to 75f63c0 Compare February 27, 2026 16:51
@Sysix Sysix requested a review from Copilot February 27, 2026 16:58
@Sysix Sysix removed the A-linter-plugins Area - Linter JS plugins label Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request changes the default fixKind behavior for the oxlint LSP server from SafeFix to SafeFixOrSuggestion, aligning it with ESLint's default editor experience of showing suggestions by default. This builds on recent architectural improvements that introduced the FixedContentKind enum (PR #19113) and explicit type checking for fix kinds (PR #19795), which now enable differentiating between safe and dangerous fixes/suggestions.

Changes:

  • Updated the default LintFixKindFlag enum value from SafeFix to SafeFixOrSuggestion
  • Inverted test logic to verify suggestions are shown by default and only hidden when explicitly setting fixKind to safe_fix
  • Updated snapshot tests to reflect that safe suggestions are now included in code actions and fix-all operations

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

File Description
apps/oxlint/src/lsp/options.rs Changed the #[default] attribute from SafeFix to SafeFixOrSuggestion in the LintFixKindFlag enum, and updated the corresponding test assertion
apps/oxlint/test/lsp/code_action/code_action.test.ts Inverted test structure: basic tests now use default config (showing suggestions), while filtered tests explicitly set fixKind: "safe_fix" to hide suggestions
apps/oxlint/src/lsp/snapshots/*.snap Updated snapshots to reflect that code actions and fix-all operations now include safe suggestions by default (previously showed "None")

@Sysix Sysix marked this pull request as ready for review February 27, 2026 17:02
@Sysix Sysix requested a review from camc314 as a code owner February 27, 2026 17:02
@github-actions github-actions bot added the A-linter-plugins Area - Linter JS plugins label Feb 27, 2026
@camc314 camc314 self-assigned this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants