refactor(oxfmt): Fix all options.filepath usage#19200
Merged
graphite-app[bot] merged 1 commit intomainfrom Feb 10, 2026
Merged
Conversation
Member
Author
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. |
options.filepath usage
5cd2cef to
307ec97
Compare
3ca5682 to
757b365
Compare
307ec97 to
e848a95
Compare
This was referenced Feb 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes options.filepath handling across the Rust↔JS boundary in oxfmt, so Prettier plugins (notably Tailwind’s sorter) receive a real file path via options.filepath rather than just a file name.
Changes:
- Move Tailwind sorter callback signature from
(filepath, options, classes)to(options, classes)and rely onoptions.filepath. - Populate
external_options.filepathfrom the RustPathfor both the oxc formatter path and the external formatter (Prettier) path. - Update JS/TS bindings and worker proxy types to match the new callback signature.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxfmt/src/main_napi.rs | Updates NAPI TS callback types for Tailwind sorter to remove the explicit filepath argument. |
| apps/oxfmt/src/core/format.rs | Injects filepath into external_options before invoking embedded/tailwind callbacks and Prettier formatting. |
| apps/oxfmt/src/core/external_formatter.rs | Refactors Tailwind callback plumbing to take (options, classes) and read filepath from options. |
| apps/oxfmt/src-js/libs/apis.ts | Adjusts Tailwind sorter API shape to read filepath from options.filepath. |
| apps/oxfmt/src-js/index.ts | Updates the Rust callback bridge to pass (options, classes) to Tailwind sorter. |
| apps/oxfmt/src-js/cli/worker-proxy.ts | Updates worker proxy Tailwind sorting RPC signature to match (options, classes). |
| apps/oxfmt/src-js/bindings.d.ts | Updates generated TS declarations to reflect the new callback signature. |
6640ccc to
e8e653d
Compare
Dunqing
approved these changes
Feb 10, 2026
Contributor
Merge activity
|
Fixes #19194 - Changed from passing file name as `filepath` to using absolute path - For Tailwind's sorter, retrieve it via `options.filepath` - Ensure `filepath` is passed in all code paths - Also, path resolution should be handled at a higher flow
757b365 to
d1e3537
Compare
e8e653d to
db8355b
Compare
Base automatically changed from
02-10-refactor_oxfmt_insert_options.parser_filepath_in_rust
to
main
February 10, 2026 07:18
OskarLebuda
pushed a commit
to OskarLebuda/oxc
that referenced
this pull request
Feb 17, 2026
Fixes oxc-project#19194 - Changed from passing file name as `filepath` to using absolute path - For Tailwind's sorter, retrieve it via `options.filepath` - Ensure `filepath` is passed in all code paths - Also, path resolution should be handled at a higher flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #19194
filepathto using absolute pathoptions.filepathfilepathis passed in all code paths