fix(oxfmt): Restore customGroups handling lost#18243
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. |
customGroups handling lost
There was a problem hiding this comment.
Pull request overview
This PR restores the customGroups handling for import sorting that was previously lost. The feature allows users to define custom groups with specific patterns to organize their imports according to custom rules.
Changes:
- Added
customGroupsconfiguration handling in Rust code for both config parsing paths - Added
customGroupsTypeScript type definition in the API - Fixed documentation comment for the
groupsfield that incorrectly mentioned "Custom groups" - Added comprehensive tests (both CLI and API) to verify the functionality
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxfmt/src/core/oxfmtrc.rs | Added customGroups mapping from config to CustomGroupDefinition in two code paths (lines 400-408 and implied at 948-956) |
| apps/oxfmt/src-js/index.ts | Added customGroups type definition and corrected the documentation comment for groups field |
| apps/oxfmt/test/api/api.test.ts | Added API test to verify customGroups sorting behavior |
| apps/oxfmt/test/cli/sort_imports/sort_imports.test.ts | Added CLI test for customGroups functionality |
| apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups/input.ts | Test fixture with imports to be sorted |
| apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups/.oxfmtrc.json | Test configuration file with customGroups definition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Fix for the issue where the code passing settings from `oxfmt` to `oxc_formatter` was missing. - Also added tests - Also fixed the TS type that was missing
4da4d90 to
90ce4b7
Compare
# Oxlint ### ⚡ Performance - 1a247f1 linter/no-redeclare: Avoid repeated PHF hashmap lookups (#18248) (overlookmotel) ### 📚 Documentation - 8a294d5 oxfmt, oxlint: Update logo (#18242) (Dunqing) # Oxfmt ### 🐛 Bug Fixes - 864b4ab oxfmt: Use `format_config` for `external_options` override (#18252) (leaysgur) - 90ce4b7 oxfmt: Restore `customGroups` handling lost (#18243) (leaysgur) ### 📚 Documentation - 8a294d5 oxfmt, oxlint: Update logo (#18242) (Dunqing) Co-authored-by: overlookmotel <557937+overlookmotel@users.noreply.github.com>

Fix for the issue where the code passing settings from
oxfmttooxc_formatterwas missing.