refactor(linter): move logic for combining JsFixes into separate function#19052
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the external linter fix handling by extracting the “convert JsFix spans back to UTF-8 and merge into a single Fix” logic into a reusable helper, intended for reuse in RuleTester.
Changes:
- Extracted
Vec<JsFix>→Fixconversion + merge logic intoconvert_and_merge_js_fixes. - Re-exported
MergeFixesErrorfromfixerand exposed the new helper viaoxc_linter’s public API. - Added
#[must_use]toFixer::with_fix_index(test-only).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/oxc_linter/src/lib.rs | Replaces inline fix conversion/merge closure with the extracted helper. |
| crates/oxc_linter/src/fixer/mod.rs | Re-exports MergeFixesError; adds #[must_use] to a test helper builder method. |
| crates/oxc_linter/src/external_linter.rs | Introduces convert_and_merge_js_fixes and required imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
…nction (#19052) Pure refactor. Move logic for combining multiple `JsFix`es into a single `Fix` into a separate function. This function can be reused in `RuleTester` for testing fixes.
46334f3 to
b1ac16a
Compare

Pure refactor. Move logic for combining multiple
JsFixes into a singleFixinto a separate function. This function can be reused inRuleTesterfor testing fixes.