Skip to content

refactor(linter): move logic for combining JsFixes into separate function#19052

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-06-refactor_linter_move_logic_for_combining_jsfix_es_into_separate_function
Feb 6, 2026
Merged

refactor(linter): move logic for combining JsFixes into separate function#19052
graphite-app[bot] merged 1 commit intomainfrom
om/02-06-refactor_linter_move_logic_for_combining_jsfix_es_into_separate_function

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 6, 2026

Pure refactor. Move logic for combining multiple JsFixes into a single Fix into a separate function. This function can be reused in RuleTester for testing fixes.

@github-actions github-actions bot added the A-linter Area - Linter label Feb 6, 2026
Copy link
Member Author

overlookmotel commented Feb 6, 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 the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Feb 6, 2026
@overlookmotel overlookmotel marked this pull request as ready for review February 6, 2026 11:32
Copilot AI review requested due to automatic review settings February 6, 2026 11:32
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

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>Fix conversion + merge logic into convert_and_merge_js_fixes.
  • Re-exported MergeFixesError from fixer and exposed the new helper via oxc_linter’s public API.
  • Added #[must_use] to Fixer::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-hq
Copy link

codspeed-hq bot commented Feb 6, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing om/02-06-refactor_linter_move_logic_for_combining_jsfix_es_into_separate_function (46334f3) with main (65fbfd8)1

Summary

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks2

Footnotes

  1. No successful run was found on main (9da6b0b) during the generation of this report, so 65fbfd8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

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.
@graphite-app graphite-app bot force-pushed the om/02-06-refactor_linter_move_logic_for_combining_jsfix_es_into_separate_function branch from 46334f3 to b1ac16a Compare February 6, 2026 12:57
@graphite-app graphite-app bot merged commit b1ac16a into main Feb 6, 2026
21 checks passed
@graphite-app graphite-app bot deleted the om/02-06-refactor_linter_move_logic_for_combining_jsfix_es_into_separate_function branch February 6, 2026 13:02
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants