Skip to content

refactor(oxfmt): extract vite fmt config in JS loader#20257

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader
Mar 12, 2026
Merged

refactor(oxfmt): extract vite fmt config in JS loader#20257
graphite-app[bot] merged 1 commit intomainfrom
03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Mar 12, 2026

Closes #20243

The same as #20256, but for Oxfmt.

Copy link
Member Author

leaysgur commented Mar 12, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 12, 2026
@leaysgur leaysgur force-pushed the 03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader branch from f0a0eb9 to 04dcf79 Compare March 12, 2026 02:52
@leaysgur leaysgur force-pushed the 03-12-refactor_oxlint_extract_vite_lint_config_in_js_loader branch from 63be600 to 632b54c Compare March 12, 2026 02:52
@leaysgur leaysgur requested a review from Copilot March 12, 2026 02:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, returning null to signal “skip”.
  • Update Rust config resolution to interpret null from 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.

@leaysgur leaysgur force-pushed the 03-12-refactor_oxlint_extract_vite_lint_config_in_js_loader branch from 632b54c to 88af2b6 Compare March 12, 2026 03:02
@leaysgur leaysgur force-pushed the 03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader branch from 04dcf79 to 250defd Compare March 12, 2026 03:02
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 12, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the 03-12-refactor_oxlint_extract_vite_lint_config_in_js_loader branch from 88af2b6 to 5eb9991 Compare March 12, 2026 04:15
@graphite-app graphite-app bot force-pushed the 03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader branch from 250defd to fdaca97 Compare March 12, 2026 04:16
@graphite-app graphite-app bot added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Mar 12, 2026
Base automatically changed from 03-12-refactor_oxlint_extract_vite_lint_config_in_js_loader to main March 12, 2026 04:39
@graphite-app graphite-app bot added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Mar 12, 2026
@graphite-app graphite-app bot merged commit fdaca97 into main Mar 12, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 03-12-refactor_oxfmt_extract_vite_fmt_config_in_js_loader branch March 12, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants