refactor(formatter/sort_imports): Use nodejs-built-in-modules to detect builtin#17773
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. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the import sorting functionality to use the nodejs-built-in-modules crate instead of maintaining a manually-defined list of Node.js builtin modules.
- Replaces a static
NODE_BUILTINSPHF set with a call tonodejs_built_in_modules::is_nodejs_builtin_module() - Adds
nodejs-built-in-modulesas a workspace dependency tooxc_formatter
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_formatter/src/ir_transform/sort_imports/compute_metadata.rs | Removes the manually-maintained NODE_BUILTINS set and uses the nodejs_built_in_modules crate's function instead |
| crates/oxc_formatter/Cargo.toml | Adds nodejs-built-in-modules workspace dependency |
| Cargo.lock | Updates lock file with the new dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will not alter performanceSummary
Comparing Footnotes
|
|
Cargo Deny failure is not related to this PR. |
Merge activity
|
…ct builtin (#17773) Follow up #17771 (comment)
98120a9 to
23c27b6
Compare

Follow up #17771 (comment)