Skip to content

fix(formatter,oxfmt): Remove redundant space after soft_line_break_or_space#20562

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-20-fix_formatter_oxfmt_remove_redundant_space_after_soft_line_break_or_space
Mar 21, 2026
Merged

fix(formatter,oxfmt): Remove redundant space after soft_line_break_or_space#20562
graphite-app[bot] merged 1 commit intomainfrom
03-20-fix_formatter_oxfmt_remove_redundant_space_after_soft_line_break_or_space

Conversation

@leaysgur
Copy link
Copy Markdown
Member

Fixes #20548

Remove redundant Space elements that immediately followed soft_line_break_or_space() in three places:

  • Arrow function chain signatures
  • class ... extends with member expressions
  • interface ... extends with member expressions

This, in turn, fixes the js-in-vue issue.


The root cause is that to_prettier_doc cannot fully replicate the oxc_formatter printer's runtime behavior (e.g. deduplication of spaces).

While this commit fixes the three identified IR-level issues, there are other known divergences between the printer and to_prettier_doc (e.g. SpaceStartTagSpace patterns around comments) that will be addressed separately...

TL;DR, converting between Prettier Doc and oxc_formatter IR doesn't seem to be straightforward after all. 🥲

@leaysgur leaysgur requested a review from Dunqing as a code owner March 20, 2026 14:29
Copy link
Copy Markdown
Member Author


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-bug Category - Bug labels Mar 20, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 20, 2026

Merging this PR will not alter performance

✅ 49 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing 03-20-fix_formatter_oxfmt_remove_redundant_space_after_soft_line_break_or_space (b7b44ae) with main (817be68)2

Open in CodSpeed

Footnotes

  1. 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.

  2. No successful run was found on main (a93de95) during the generation of this report, so 817be68 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Mar 21, 2026
Copy link
Copy Markdown
Member

Dunqing commented Mar 21, 2026

Merge activity

…_space (#20562)

Fixes #20548

Remove redundant `Space` elements that immediately followed `soft_line_break_or_space()` in three places:

- Arrow function chain signatures
- `class ... extends` with member expressions
- `interface ... extends` with member expressions

This, in turn, fixes the js-in-vue issue.

---

The root cause is that `to_prettier_doc` cannot fully replicate the oxc_formatter printer's runtime behavior (e.g. deduplication of spaces).

While this commit fixes the three identified IR-level issues, there are other known divergences between the printer and `to_prettier_doc` (e.g. `Space` → `StartTag` → `Space` patterns around comments) that will be addressed separately...

TL;DR, converting between Prettier Doc and oxc_formatter IR doesn't seem to be straightforward after all. 🥲
@graphite-app graphite-app bot force-pushed the 03-20-fix_formatter_oxfmt_remove_redundant_space_after_soft_line_break_or_space branch from b7b44ae to d35b25f Compare March 21, 2026 04:42
@graphite-app graphite-app bot merged commit d35b25f into main Mar 21, 2026
25 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 21, 2026
@graphite-app graphite-app bot deleted the 03-20-fix_formatter_oxfmt_remove_redundant_space_after_soft_line_break_or_space branch March 21, 2026 04:45
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.

oxfmt: double space after "=>" in curried arrow functions when formatting .vue files

2 participants