refactor(linter): extract unicorn import-symbol helper#19126
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. |
0973754 to
a057f4a
Compare
4bd7f2a to
053171a
Compare
Merge activity
|
a057f4a to
b137db3
Compare
053171a to
82a723f
Compare
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
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_symbolhelper to unicorn utils to detect named imports via semantic resolution. - Replaced
no-array-sort’s localis_imported_symbolimplementation with the shared helper. - Simplified imports in
no_array_sort.rsafter 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. |
bcfa93d to
82754a4
Compare

No description provided.