refactor(linter): add FixKind to Fix#18363
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
41bfd1c to
b98ea32
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a FixKind field to the Fix struct to track the type of fix being applied (safe fix, suggestion, dangerous fix, etc.). This enables better classification and handling of different types of code fixes throughout the linter.
Changes:
- Added
kind: FixKindfield to theFixstruct with appropriate initialization - Updated all
Fixconstructors and test fixtures to include the new field - Implemented fix kind merging logic using bitwise union for composite fixes
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
crates/oxc_linter/src/fixer/fix.rs |
Added kind field to Fix struct, updated constructors, added with_kind builder method, implemented fix kind merging in merge_fixes, and added size assertion test |
crates/oxc_linter/src/fixer/mod.rs |
Updated all test constant fixtures to include kind: FixKind::None |
crates/oxc_linter/src/tsgolint.rs |
Updated fix creation to use FixKind::SafeFix for fixes and FixKind::Suggestion for suggestions, updated test assertions |
crates/oxc_linter/src/disable_directives.rs |
Updated directive removal fixes to use FixKind::Fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b98ea32 to
b614b43
Compare
camchenry
left a comment
There was a problem hiding this comment.
I thought I had already made this change somewhere... must have been in an experimental PR. Makes sense to me.
Merge activity
|
b614b43 to
5f1c26d
Compare

Add
FixKindtoFixso the language server can filter them out for "fix all" code actions / commands.