Skip to content

fix(formatter): should not set up tailwindcss callback when no tailwindcss configuration is set#17696

Merged
graphite-app[bot] merged 1 commit intomainfrom
01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set
Jan 6, 2026
Merged

fix(formatter): should not set up tailwindcss callback when no tailwindcss configuration is set#17696
graphite-app[bot] merged 1 commit intomainfrom
01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Jan 6, 2026

Only set up the tailwindcss callback when the experimentalTailwindcss configuration is set. Previously, it would also set up when the emebeddedLanguageFormatting is on.

@github-actions github-actions bot added A-cli Area - CLI A-formatter Area - Formatter labels Jan 6, 2026
Copy link
Member Author

Dunqing commented Jan 6, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

CodSpeed Performance Report

Merging #17696 will not alter performance

Comparing 01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set (56073c5) with main (6f65901)1

Summary

✅ 38 untouched
⏩ 7 skipped2

Footnotes

  1. No successful run was found on main (555ed33) during the generation of this report, so 6f65901 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Dunqing Dunqing marked this pull request as ready for review January 6, 2026 07:54
Copilot AI review requested due to automatic review settings January 6, 2026 07:54
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 the formatter to only set up the Tailwind CSS callback when the experimentalTailwindcss configuration is explicitly provided, preventing unnecessary callback initialization when only embeddedLanguageFormatting is enabled.

Key changes:

  • Modified ExternalCallbacks API to accept Option<Callback> instead of bare Callback types
  • Moved callback creation logic to conditionally instantiate callbacks based on configuration
  • Simplified the caller code to delegate configuration checks to the callback builder

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_formatter/src/external_formatter.rs Changed with_embedded_formatter and with_tailwind methods to accept Option<Callback> parameters
apps/oxfmt/src/core/external_formatter.rs Added conditional logic to only create embedded and Tailwind callbacks when their respective configurations are enabled
apps/oxfmt/src/core/format.rs Simplified caller code to use the updated to_external_callbacks signature and removed redundant configuration checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Dunqing Dunqing force-pushed the 01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set branch from 5044a86 to 56073c5 Compare January 6, 2026 08:09
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Jan 6, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 6, 2026

Merge activity

…ndcss configuration is set (#17696)

Only set up the tailwindcss callback when the `experimentalTailwindcss` configuration is set. Previously, it would also set up when the `emebeddedLanguageFormatting` is `on`.
@graphite-app graphite-app bot force-pushed the 01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set branch from 56073c5 to dcfdd41 Compare January 6, 2026 08:34
@graphite-app graphite-app bot merged commit dcfdd41 into main Jan 6, 2026
20 checks passed
@graphite-app graphite-app bot deleted the 01-06-fix_formatter_should_not_set_up_tailwindcss_callback_when_no_tailwindcss_configuration_is_set branch January 6, 2026 08:40
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 6, 2026
Dunqing added a commit that referenced this pull request Jan 6, 2026
# Oxlint

# Oxfmt
### 🚀 Features

- a19cc93 oxfmt: Add debug logging to oxfmt LSP to troubleshoot resolved
options at runtime (#17695) (Nicholas Rayburn)

### 🐛 Bug Fixes

- 3b4aced formatter: Should not treat multi-type arguments of
TSTypeReference as a complex type (#17708) (Dunqing)
- dcfdd41 formatter: Should not set up tailwindcss callback when no
tailwindcss configuration is set (#17696) (Dunqing)
- 6f65901 formatter: Return original classes when there are no
tailwindcss classes sort callback (#17689) (Dunqing)

### ⚡ Performance

- c6a99fd formatter: Don't call `sort_tailwind_classes` if no classes
need to be sorted (#17698) (Dunqing)

Co-authored-by: Dunqing <29533304+Dunqing@users.noreply.github.com>
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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants