Skip to content

fix(formatter): keep a suppression comment's target across a union and an operator line - #26676

Closed
leaysgur wants to merge 1 commit into
mainfrom
09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line
Closed

leaysgur wants to merge 1 commit into
mainfrom
09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line

Conversation

@leaysgur

@leaysgur leaysgur commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Unify how suppression comment works across call sites.


Printed as-is, suppress RHS.

const a = // oxfmt-ignore
  foo( a,b );

type A = // oxfmt-ignore
  { a : number };

Except for Union type. Rules are:

  • On the operator's line: whole union
type A = /* oxfmt-ignore */ Aaa<X,Y> | Bbb<X,Y>;

type AA = /* oxfmt-ignore */
  | Aaa<X,Y>
  | Bbb<X,Y>;
  • Own-line: first (each) member
type A =
  // oxfmt-ignore
  Aaa<X,Y> | Bbb<X, Y>;

To suppress the whole union, put the comment before the statement.

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

@leaysgur leaysgur added the run-oxfmt-ecosystem-ci Add to a PR to dispatch Oxfmt Ecosystem CI (oxc-project/oxc-ecosystem-ci) against its branch label Sep 15, 2026
@github-actions github-actions Bot added A-ast-tools Area - AST code generation tooling, tasks/ast_tools A-formatter Area - Formatter (oxfmt). Add F-* labels for details labels Sep 15, 2026
@oxc-guard

oxc-guard Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

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

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

@oxc-guard oxc-guard Bot removed the run-oxfmt-ecosystem-ci Add to a PR to dispatch Oxfmt Ecosystem CI (oxc-project/oxc-ecosystem-ci) against its branch label Sep 15, 2026
@leaysgur
leaysgur marked this pull request as draft September 15, 2026 08:52
@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 19 skipped benchmarks1


Comparing 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line (2eae192) with main (f91ad92)

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-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch 2 times, most recently from efd20aa to be57f05 Compare September 16, 2026 01:12
@leaysgur
leaysgur force-pushed the 09-15-fix_formatter_let_union_place_leading_comments_at_as_satisfies branch from 89b6b3c to 57eb46b Compare September 16, 2026 01:18
@leaysgur
leaysgur force-pushed the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch from b9d81aa to 4c8655c Compare September 16, 2026 01:18
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Sep 16, 2026
@leaysgur
leaysgur marked this pull request as ready for review September 16, 2026 01:18

leaysgur commented Sep 16, 2026 •

Copy link
Copy Markdown
Member Author

Merge activity

  • Sep 16, 1:19 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 16, 1:26 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 16, 1:27 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

@leaysgur leaysgur removed the 0-merge Merge with Graphite Merge Queue label Sep 16, 2026
@graphite-app
graphite-app Bot changed the base branch from 09-15-fix_formatter_let_union_place_leading_comments_at_as_satisfies to graphite-base/26676 September 16, 2026 01:23
@graphite-app
graphite-app Bot force-pushed the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch from 4c8655c to 52e1010 Compare September 16, 2026 01:28
@graphite-app
graphite-app Bot force-pushed the graphite-base/26676 branch from 57eb46b to f91ad92 Compare September 16, 2026 01:28
@graphite-app
graphite-app Bot changed the base branch from graphite-base/26676 to main September 16, 2026 01:29
@graphite-app
graphite-app Bot force-pushed the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch from 52e1010 to 165f52d Compare September 16, 2026 01:29
@leaysgur
leaysgur force-pushed the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch from 165f52d to 34bdb9f Compare September 16, 2026 01:54
@leaysgur
leaysgur force-pushed the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch from 34bdb9f to 2eae192 Compare September 16, 2026 03:44
@graphite-app graphite-app Bot closed this in 68ce610 Sep 16, 2026
@leaysgur
leaysgur deleted the 09-15-fix_formatter_keep_a_suppression_comment_s_target_across_a_union_and_an_operator_line branch September 25, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST code generation tooling, tasks/ast_tools A-formatter Area - Formatter (oxfmt). Add F-* labels for details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant