Skip to content

refactor(linter): extract unicorn import-symbol helper#19126

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/02-08-refactor_linter_extract_unicorn_import-symbol_helper
Feb 9, 2026
Merged

refactor(linter): extract unicorn import-symbol helper#19126
graphite-app[bot] merged 1 commit intomainfrom
c/02-08-refactor_linter_extract_unicorn_import-symbol_helper

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Feb 8, 2026

No description provided.

Copy link
Contributor Author

camc314 commented Feb 8, 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 8, 2026
@camc314 camc314 force-pushed the c/02-08-refactor_linter_extract_unicorn_import-symbol_helper branch from 0973754 to a057f4a Compare February 8, 2026 00:20
@camc314 camc314 force-pushed the c/02-07-fix_linter_no-array-sort_avoid_false_positives_for_effect_chunk.sort branch from 4bd7f2a to 053171a Compare February 8, 2026 00:20
@camc314 camc314 self-assigned this Feb 8, 2026
@camc314 camc314 marked this pull request as ready for review February 8, 2026 00:25
Copilot AI review requested due to automatic review settings February 8, 2026 00:25
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Feb 8, 2026
Copy link
Contributor Author

camc314 commented Feb 8, 2026

Merge activity

  • Feb 8, 12:25 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 8, 12:31 AM UTC: camc314 added this pull request to the Graphite merge queue.
  • Feb 8, 12:39 AM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Feb 9, 6:56 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 9, 7:02 AM UTC: connorshea added this pull request to the Graphite merge queue.
  • Feb 9, 7:08 AM UTC: Merged by the Graphite merge queue.

@camc314 camc314 force-pushed the c/02-08-refactor_linter_extract_unicorn_import-symbol_helper branch from a057f4a to b137db3 Compare February 8, 2026 00:25
@camc314 camc314 force-pushed the c/02-07-fix_linter_no-array-sort_avoid_false_positives_for_effect_chunk.sort branch from 053171a to 82a723f Compare February 8, 2026 00:25
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 8, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing c/02-08-refactor_linter_extract_unicorn_import-symbol_helper (a057f4a) with c/02-07-fix_linter_no-array-sort_avoid_false_positives_for_effect_chunk.sort (4bd7f2a)1

Summary

✅ 43 untouched benchmarks
⏩ 7 skipped benchmarks2

Footnotes

  1. No successful run was found on c/02-07-fix_linter_no-array-sort_avoid_false_positives_for_effect_chunk.sort (de10f04) during the generation of this report, so 368f5c2 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 7 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.

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 PR refactors the unicorn linter utilities by extracting a reusable helper for checking whether an identifier resolves to a specific named import (by module source + imported symbol), and then updating the no-array-sort rule to use that helper.

Changes:

  • Added is_import_symbol helper to unicorn utils to detect named imports via semantic resolution.
  • Replaced no-array-sort’s local is_imported_symbol implementation with the shared helper.
  • Simplified imports in no_array_sort.rs after removing the local helper.

Reviewed changes

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

File Description
crates/oxc_linter/src/utils/unicorn.rs Introduces shared is_import_symbol utility for resolving named imports.
crates/oxc_linter/src/rules/unicorn/no_array_sort.rs Uses the new shared helper and removes duplicated import-resolution logic.

@graphite-app graphite-app bot changed the base branch from c/02-07-fix_linter_no-array-sort_avoid_false_positives_for_effect_chunk.sort to graphite-base/19126 February 8, 2026 00:31
@graphite-app graphite-app bot changed the base branch from graphite-base/19126 to main February 8, 2026 00:38
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 8, 2026
@connorshea connorshea added the 0-merge Merge with Graphite Merge Queue label Feb 9, 2026
@graphite-app graphite-app bot force-pushed the c/02-08-refactor_linter_extract_unicorn_import-symbol_helper branch from bcfa93d to 82754a4 Compare February 9, 2026 07:03
@graphite-app graphite-app bot merged commit 82754a4 into main Feb 9, 2026
21 checks passed
@graphite-app graphite-app bot deleted the c/02-08-refactor_linter_extract_unicorn_import-symbol_helper branch February 9, 2026 07:08
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 9, 2026
OskarLebuda pushed a commit to OskarLebuda/oxc that referenced this pull request Feb 17, 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

Comments