Skip to content

refactor(oxfmt): Fix all options.filepath usage#19200

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-10-refactor_oxfmt_fix_all_options.filepath_usage
Feb 10, 2026
Merged

refactor(oxfmt): Fix all options.filepath usage#19200
graphite-app[bot] merged 1 commit intomainfrom
02-10-refactor_oxfmt_fix_all_options.filepath_usage

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Feb 10, 2026

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

@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 Feb 10, 2026
Copy link
Member Author

leaysgur commented Feb 10, 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 hot fixes, skip the queue and merge this PR next

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.

@leaysgur leaysgur changed the title refactor(oxfmt): Fix all options.filepath usage refactor(oxfmt): Fix all options.filepath usage Feb 10, 2026
@leaysgur leaysgur force-pushed the 02-10-refactor_oxfmt_fix_all_options.filepath_usage branch from 5cd2cef to 307ec97 Compare February 10, 2026 04:33
@leaysgur leaysgur force-pushed the 02-10-refactor_oxfmt_insert_options.parser_filepath_in_rust branch from 3ca5682 to 757b365 Compare February 10, 2026 04:33
@leaysgur leaysgur force-pushed the 02-10-refactor_oxfmt_fix_all_options.filepath_usage branch from 307ec97 to e848a95 Compare February 10, 2026 04:53
@leaysgur leaysgur marked this pull request as ready for review February 10, 2026 06:06
@leaysgur leaysgur requested review from Dunqing and Copilot February 10, 2026 06:20
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

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 on options.filepath.
  • Populate external_options.filepath from the Rust Path for 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.

@leaysgur leaysgur force-pushed the 02-10-refactor_oxfmt_fix_all_options.filepath_usage branch from 6640ccc to e8e653d Compare February 10, 2026 06:51
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 10, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 10, 2026

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
@graphite-app graphite-app bot force-pushed the 02-10-refactor_oxfmt_insert_options.parser_filepath_in_rust branch from 757b365 to d1e3537 Compare February 10, 2026 07:12
@graphite-app graphite-app bot force-pushed the 02-10-refactor_oxfmt_fix_all_options.filepath_usage branch from e8e653d to db8355b Compare February 10, 2026 07:12
Base automatically changed from 02-10-refactor_oxfmt_insert_options.parser_filepath_in_rust to main February 10, 2026 07:18
@graphite-app graphite-app bot merged commit db8355b into main Feb 10, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 02-10-refactor_oxfmt_fix_all_options.filepath_usage branch February 10, 2026 07:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 10, 2026
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
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.

oxfmt: Pass options.filepath properly (for tailwind-plugin)

2 participants

Comments