Skip to content

fix(formatter): preserve comment for statement terminators and binary casts - #26213

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

graphite-app[bot] merged 1 commit into
mainfrom
09-01-fix_formatter_preserve_comment_for_statement_terminators_and_binary_casts

Conversation

@leaysgur

@leaysgur leaysgur commented Sep 1, 2026

Copy link
Copy Markdown
Member

Refine comment position preserving rules, for statements and binary casts. Fixes idempotency issues for several sites.


Trailing is the same-line run only.
A newline-preceded comment is never trailing. It defers to the next node's leading pass, staying own-line with its blank lines.

Comments around as/satisfies keep their source side and line-start side, within the grammar-defined slots (line terminator is not allowed between as and before).

leaysgur commented Sep 1, 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.

@github-actions github-actions Bot added the A-formatter Area - Formatter label Sep 1, 2026
@oxc-guard

oxc-guard Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

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

💥 = 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)

@codspeed

codspeed Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 19 skipped benchmarks1


Comparing 09-01-fix_formatter_preserve_comment_for_statement_terminators_and_binary_casts (cfef465) with main (a3d33dd)2

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.

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

@graphite-app

graphite-app Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Merge activity

… casts (#26213)

Refine comment position preserving rules, for statements and binary casts. Fixes idempotency issues for several sites.

---

Trailing is the same-line run only.
A newline-preceded comment is never trailing. It defers to the next node's leading pass, staying own-line with its blank lines.

Comments around `as`/`satisfies` keep their source side and line-start side, within the grammar-defined slots (line terminator is not allowed between `as` and before).
@graphite-app
graphite-app Bot force-pushed the 09-01-fix_formatter_preserve_comment_for_statement_terminators_and_binary_casts branch from cfef465 to 1213e12 Compare September 1, 2026 03:56
@graphite-app
graphite-app Bot merged commit 1213e12 into main Sep 1, 2026
31 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 1, 2026
@graphite-app
graphite-app Bot deleted the 09-01-fix_formatter_preserve_comment_for_statement_terminators_and_binary_casts branch September 1, 2026 04:02
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.

1 participant

Sponsor
SponsoredKunjungi sekarang
Promo