Skip to content

fix(formatter): keep trailing spaces on normal block comments - #27037

Merged
graphite-app[bot] merged 1 commit into
mainfrom
09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments
Sep 25, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments

Conversation

@leaysgur

@leaysgur leaysgur commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Closes #17786


I've decided to keep trailing spaces in normal block comments as belonging to the user.

If the aim is to clean up unnecessary whitespace, we should presumably remove it from the other lines as well, but the current behavior only trims the first line, it is inconsistent.

Furthermore, this doesn't match the behavior of CSS block comments.

leaysgur commented Sep 25, 2026 •

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.

@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 77 untouched benchmarks
⏩ 19 skipped benchmarks1


Comparing 09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments (a6fde4f) with 09-25-fix_formatter_nestle_adjacent_block_comments (a82f7dd)

Open in CodSpeed

Footnotes

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

@leaysgur
leaysgur force-pushed the 09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments branch from 0b8f426 to a1e84f0 Compare September 25, 2026 06:19
@leaysgur
leaysgur force-pushed the 09-25-fix_formatter_nestle_adjacent_block_comments branch from 35c4ec4 to a82f7dd Compare September 25, 2026 06:19
@oxc-guard

oxc-guard Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

suite oxfmt@latest main refs/pull/27037/head branch
vercel/turborepo ❌ ✅ ✅
cnpm/cnpmcore ❌ ✅ ✅
dyad-sh/dyad ❌ 🟨 ✅
formatjs/formatjs ✅ ✅ ✅
tale/headplane ❌ ✅ ✅
actualbudget/actual ❌ ✅ ✅
getsentry/sentry-javascript ✅ ✅ ✅
lichess-org/lila ❌ ✅ ✅
Comfy-Org/ComfyUI_frontend ❌ ✅ ✅
cloudflare/workers-sdk ✅ ✅ ✅
mantinedev/mantine ❌ ✅ ✅
huggingface/huggingface.js ❌ ✅ ✅
AmanVarshney01/create-better-t-stack ✅ ✅ ✅
cloudflare/agents ❌ ✅ ✅
mastodon/mastodon ✅ ✅ ✅
fuma-nama/fumadocs ✅ ✅ ✅
vuejs/pinia ❌ ✅ ✅
npmx-dev/npmx.dev ✅ ✅ ✅
monkeytypegame/monkeytype ❌ ✅ ✅
fastify/fastify-vite ❌ ✅ ✅
vuejs/core ✅ ✅ ✅
rolldown/rolldown ✅ ✅ ✅
cloudflare/kumo ✅ ✅ ✅
openclaw/openclaw ✅ ✅ ✅
eggjs/egg ✅ ✅ ✅
aidenybai/react-grab ❌ ✅ ✅
sveltejs/kit ✅ ✅ ✅

💥 = panic, ⚠️ = error e.g. parse error (main/branch columns: only new errors), ❌ = diff or exit code mismatch, 🟨 = differs from oxfmt@latest (merged-but-unreleased changes)

@leaysgur
leaysgur force-pushed the 09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments branch from a1e84f0 to a6fde4f Compare September 25, 2026 06:31
@graphite-app graphite-app Bot added the 0-merge Merge with Graphite Merge Queue label Sep 25, 2026
@graphite-app

graphite-app Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Merge activity

Closes #17786

---

I've decided to keep trailing spaces in normal block comments as belonging to the user.

If the aim is to clean up unnecessary whitespace, we should presumably remove it from the other lines as well, but the current behavior only trims the first line, it is inconsistent.

Furthermore, this doesn't match the behavior of CSS block comments.
@graphite-app
graphite-app Bot force-pushed the 09-25-fix_formatter_nestle_adjacent_block_comments branch from a82f7dd to 56d1880 Compare September 25, 2026 07:10
@graphite-app
graphite-app Bot force-pushed the 09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments branch from a6fde4f to 50be18e Compare September 25, 2026 07:11
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 25, 2026
Base automatically changed from 09-25-fix_formatter_nestle_adjacent_block_comments to main September 25, 2026 07:16
@graphite-app
graphite-app Bot merged commit 50be18e into main Sep 25, 2026
33 checks passed
@graphite-app
graphite-app Bot deleted the 09-25-fix_formatter_keep_trailing_spaces_on_normal_block_comments branch September 25, 2026 07:17
graphite-app Bot pushed a commit that referenced this pull request Sep 28, 2026
# Oxlint
### 🚀 Features

- 9d80eed linter/react/only-export-components: Support `allowCompoundComponents` (#27117) (Kuroda Kayn)
- e05b155 linter: Add typescript/no-generated-empty-object-type (#26958) (camc314)

### 🐛 Bug Fixes

- 42dfbb5 linter/eslint/one-var: Keep `declare` when splitting declarations (#27081) (Cheolhee Lee)
- 2ba7e33 linter/eslint/require-await: Count `await using` as an await (#27080) (Cheolhee Lee)
- 611e4ed linter/plugins: Include executing selectors in JS plugin rule timings (#27111) (overlookmotel)
- 2cac66f react-compiler: Handle recursive function expressions (#26796) (Brennan Butler)
- e996e6c react-compiler: Treat zero-argument new Date as impure (#26894) (Boshen)
- 571cfa3 oxlint: Skip type-aware lint rules in type-check-only mode (#27076) (camc314)
- d0b2462 oxlint: Skip undefined children in CFG walker (#27075) (camc314)
- 5186328 parser: Handle HTML comment values (#22933) (Boshen)
- 0b630e8 linter/typescript/unified-signatures: Align rule with upstream (#26956) (camc314)
- ebb22f1 linter/node/no-exports-assign: Change category from style to suspicious (#26555) (Bartok)
- cce28a0 linter/import/no-duplicates: Distinguish import attributes (#26936) (camc314)
- feb733b linter/unicorn/prefer-spread: Stop checking string split calls (#26935) (camc314)
- 929e154 linter/eslint/no-unused-vars: Honor ignore patterns inside array rest bindings (#26923) (camc314)
- 5bdb9b8 linter/eslint/no-unused-vars: Recognize consumed update expressions (#26782) (camc314)
- 5c05bef linter/eslint/prefer-const: Ignore embedded assignments (#26920) (camc314)

### ⚡ Performance

- ded4c29 linter/eslint/no-unused-vars: Skip sequence checks when absent (#26921) (camc314)
# Oxfmt
### 🚀 Features

- e0b1f9f oxfmt: Bump bundled Prettier version to 3.9.9 (#27002) (leaysgur)
- 342527d oxfmt: Bump bundled Prettier version to 3.9.8 (#26999) (leaysgur)

### 🐛 Bug Fixes

- eeba1db formatter: Skip test-call layout when arguments have comments (#27119) (leaysgur)
- 1f7b8ad oxfmt: Allow repeated CLI calls in the same process (#27051) (Liang)
- 7bcb807 formatter_markdown: Keep blank line between HTML and nested list (#27112) (leaysgur)
- 10b10c5 formatter: Keep comments around `=` on their side and line (#27041) (leaysgur)
- 9aad365 formatter: Keep comments deferred before an assignment operator (#26997) (waltu)
- 8fbddb1 formatter/jsdoc: More alignment with original plugin (#27039) (leaysgur)
- 50be18e formatter: Keep trailing spaces on normal block comments (#27037) (leaysgur)
- 56d1880 formatter: Nestle adjacent block comments (#27036) (leaysgur)
- 3be5d94 formatter: Treat `/***` comments as JSDoc (#27035) (leaysgur)
- cd45f71 formatter: Keep trailing double spaces on JSDoc lines (#26861) (John Costa)
- fd695f4 formatter_markdown: Fix more mismatches found in ecosystem-ci repos (#27003) (leaysgur)
- 4e77d59 formatter_markdown: Keep a math span after a kept line break from opening a block (#27001) (leaysgur)
- 584b8b0 formatter_markdown: Keep a shape line after a multi-line inline node or link title (#27000) (leaysgur)
- b939645 formatter_markdown: Keep a line break before an inline liquid tag under preserve (#26998) (leaysgur)
Exikle pushed a commit to Exikle/Artemis-Cluster that referenced this pull request Sep 29, 2026
🔵 **minor** · oxfmt

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [oxfmt](https://oxc.rs/docs/guide/usage/formatter) ([source](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt)) | [`0.70.0` → `0.71.0`](https://renovatebot.com/diffs/npm/oxfmt/0.70.0/0.71.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/oxfmt/0.71.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxfmt/0.70.0/0.71.0?slim=true) |
| [oxfmt](https://oxc.rs/docs/guide/usage/formatter) ([source](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt)) | `0.70.0` → `0.71.0` | ![age](https://developer.mend.io/api/mc/badges/age/npm/oxfmt/0.71.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxfmt/0.70.0/0.71.0?slim=true) |

---

### Release Notes

<details>
<summary>oxc-project/oxc (oxfmt)</summary>

### [`v0.71.0`](https://github.com/oxc-project/oxc/releases/tag/oxfmt_v0.71.0): oxfmt v0.71.0

[Compare Source](oxc-project/oxc@oxfmt_v0.70.0...oxfmt_v0.71.0)

##### 🚀 Features

- [`e0b1f9f`](oxc-project/oxc@e0b1f9f) oxfmt: Bump bundled Prettier version to 3.9.9 ([#&#8203;27002](oxc-project/oxc#27002)) (leaysgur)
- [`342527d`](oxc-project/oxc@342527d) oxfmt: Bump bundled Prettier version to 3.9.8 ([#&#8203;26999](oxc-project/oxc#26999)) (leaysgur)

##### 🐛 Bug Fixes

- [`eeba1db`](oxc-project/oxc@eeba1db) formatter: Skip test-call layout when arguments have comments ([#&#8203;27119](oxc-project/oxc#27119)) (leaysgur)
- [`1f7b8ad`](oxc-project/oxc@1f7b8ad) oxfmt: Allow repeated CLI calls in the same process ([#&#8203;27051](oxc-project/oxc#27051)) (Liang)
- [`7bcb807`](oxc-project/oxc@7bcb807) formatter\_markdown: Keep blank line between HTML and nested list ([#&#8203;27112](oxc-project/oxc#27112)) (leaysgur)
- [`10b10c5`](oxc-project/oxc@10b10c5) formatter: Keep comments around `=` on their side and line ([#&#8203;27041](oxc-project/oxc#27041)) (leaysgur)
- [`9aad365`](oxc-project/oxc@9aad365) formatter: Keep comments deferred before an assignment operator ([#&#8203;26997](oxc-project/oxc#26997)) (waltu)
- [`8fbddb1`](oxc-project/oxc@8fbddb1) formatter/jsdoc: More alignment with original plugin ([#&#8203;27039](oxc-project/oxc#27039)) (leaysgur)
- [`50be18e`](oxc-project/oxc@50be18e) formatter: Keep trailing spaces on normal block comments ([#&#8203;27037](oxc-project/oxc#27037)) (leaysgur)
- [`56d1880`](oxc-project/oxc@56d1880) formatter: Nestle adjacent block comments ([#&#8203;27036](oxc-project/oxc#27036)) (leaysgur)
- [`3be5d94`](oxc-project/oxc@3be5d94) formatter: Treat `/***` comments as JSDoc ([#&#8203;27035](oxc-project/oxc#27035)) (leaysgur)
- [`cd45f71`](oxc-project/oxc@cd45f71) formatter: Keep trailing double spaces on JSDoc lines ([#&#8203;26861](oxc-project/oxc#26861)) (John Costa)
- [`fd695f4`](oxc-project/oxc@fd695f4) formatter\_markdown: Fix more mismatches found in ecosystem-ci repos ([#&#8203;27003](oxc-project/oxc#27003)) (leaysgur)
- [`4e77d59`](oxc-project/oxc@4e77d59) formatter\_markdown: Keep a math span after a kept line break from opening a block ([#&#8203;27001](oxc-project/oxc#27001)) (leaysgur)
- [`584b8b0`](oxc-project/oxc@584b8b0) formatter\_markdown: Keep a shape line after a multi-line inline node or link title ([#&#8203;27000](oxc-project/oxc#27000)) (leaysgur)
- [`b939645`](oxc-project/oxc@b939645) formatter\_markdown: Keep a line break before an inline liquid tag under preserve ([#&#8203;26998](oxc-project/oxc#26998)) (leaysgur)

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMTUuMTMiLCJ1cGRhdGVkSW5WZXIiOiI0NC4xMTUuMTMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInR5cGUvbWlub3IiXX0=-->

Reviewed-on: https://git.dcunha.io/Exikle/Artemis-Cluster/pulls/2446
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formatter: Diff with Prettier on trailing spaces in block comment

1 participant