Skip to content

chore: Use Oxfmt for import sorting instead of import-x/order#8438

Merged
mcmire merged 3 commits intomainfrom
mrtenz/oxfmt-import-sorting
Apr 13, 2026
Merged

chore: Use Oxfmt for import sorting instead of import-x/order#8438
mcmire merged 3 commits intomainfrom
mrtenz/oxfmt-import-sorting

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Apr 13, 2026

Explanation

This replaces import-x/order (ESLint rule) with Oxfmt for sorting imports, which solves a regression eslint-plugin-import(-x) introduced some time ago, where relative imports closer to the source file would be sorted higher up.

Blocked by:

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Low risk: changes are limited to formatting/tooling (import sorting) plus mechanical import reordering across many files, with no intended runtime logic changes.

Overview
Switches import sorting responsibility to Oxfmt by adding sortImports configuration in .oxfmtrc.json and disabling ESLint’s import-x/order rule.

Applies the new import ordering across many packages by mechanically reordering and regrouping import statements (including tests), without changing runtime behavior.

Reviewed by Cursor Bugbot for commit af8e661. Bugbot is set up for automated code reviews on this repo. Configure here.

mcmire pushed a commit that referenced this pull request Apr 13, 2026
This replaces Prettier with
[Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html), a Rust-based
alternative which is intended to be compatible with Prettier.

Most changes to non-config files in this pull request are in
`package.json`s, since the order Oxfmt uses for sorting those is
slightly different from `prettier-plugin-packagejson`. There are also
some very minor differences in some source files.

### Benchmarks

#### On main:

ESLint: 4m17s
Prettier: 8s (limited to markdown, JSON, etc.)

#### With Oxfmt (import sorting enabled, #8438):

ESLint: 3m40s
Oxfmt: 4s (full codebase)
Base automatically changed from mrtenz/oxfmt to main April 13, 2026 19:48
@Mrtenz Mrtenz force-pushed the mrtenz/oxfmt-import-sorting branch from 0fbb5f9 to 3ac4f60 Compare April 13, 2026 19:51
@Mrtenz Mrtenz marked this pull request as ready for review April 13, 2026 19:52
@Mrtenz Mrtenz requested review from a team as code owners April 13, 2026 19:52
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3ac4f60. Configure here.

Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mcmire mcmire merged commit 0acd2db into main Apr 13, 2026
341 checks passed
@mcmire mcmire deleted the mrtenz/oxfmt-import-sorting branch April 13, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants