refactor(oxfmt): extract vite fmt config in JS loader#20257
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. |
f0a0eb9 to
04dcf79
Compare
63be600 to
632b54c
Compare
There was a problem hiding this comment.
Pull request overview
Refactors oxfmt’s JS/TS config loading so vite.config.ts is handled on the JS side by extracting the default export’s .fmt field, allowing Vite configs without .fmt to be skipped during auto-discovery (instead of erroring).
Changes:
- Move Vite-specific config extraction (
defaultExport.fmt) from Rust into the JS config loader, returningnullto signal “skip”. - Update Rust config resolution to interpret
nullfrom the JS loader as “no config” for Vite auto-discovery, while still erroring for explicit--config vite.config.ts. - Update CLI snapshot to reflect the new error formatting/message.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/oxfmt/src-js/cli/js_config.ts | Implements Vite-specific .fmt extraction and null skip signaling. |
| apps/oxfmt/src/core/config.rs | Updates Rust loader to accept null/skip semantics and adjusts discovery logic. |
| apps/oxfmt/test/cli/vite_config/snapshots/vite_config.test.ts.snap | Updates expected stderr snapshot for explicit Vite config without .fmt. |
You can also share your feedback on Copilot code review. Take the survey.
632b54c to
88af2b6
Compare
04dcf79 to
250defd
Compare
Merge activity
|
88af2b6 to
5eb9991
Compare
250defd to
fdaca97
Compare

Closes #20243
The same as #20256, but for Oxfmt.