Skip to content

fix(formatter_css): preserve comments around SCSS/Less variable values - #26276

Merged
graphite-app[bot] merged 1 commit into
mainfrom
09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values
Sep 3, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values

Conversation

@leaysgur

@leaysgur leaysgur commented Sep 3, 2026

Copy link
Copy Markdown
Member
// input
@a: /* c */ 1;

// before
@a: 1;

// after
@a: /* c */ 1;

Comment should be preserved.

// input
$x: // c
  1;

// before
$x:
  // c1;

// after
$x: // c
  1;

Content should be preserved.

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

@oxc-guard

oxc-guard Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

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

💥 = 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 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 19 skipped benchmarks1


Comparing 09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values (a602fe7) with main (07851b9)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 09-03-fix_formatter_css_keep_leading_comments_before (00b7eba) during the generation of this report, so main (07851b9) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@leaysgur
leaysgur force-pushed the 09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values branch from 2c33ed9 to a602fe7 Compare September 3, 2026 08:06
@leaysgur
leaysgur force-pushed the 09-03-fix_formatter_css_keep_leading_comments_before branch from 6d256df to 00b7eba Compare September 3, 2026 08:06
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Sep 3, 2026

leaysgur commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Merge activity

#26276)

```less
// input
@A: /* c */ 1;

// before
@A: 1;

// after
@A: /* c */ 1;
```

Comment should be preserved.

```scss
// input
$x: // c
  1;

// before
$x:
  // c1;

// after
$x: // c
  1;
```

Content should be preserved.
@graphite-app
graphite-app Bot force-pushed the 09-03-fix_formatter_css_keep_leading_comments_before branch from 00b7eba to 6752abc Compare September 3, 2026 08:21
@graphite-app
graphite-app Bot force-pushed the 09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values branch from a602fe7 to 2028896 Compare September 3, 2026 08:22
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 3, 2026
Base automatically changed from 09-03-fix_formatter_css_keep_leading_comments_before to main September 3, 2026 08:31
@graphite-app
graphite-app Bot merged commit 2028896 into main Sep 3, 2026
33 checks passed
@graphite-app
graphite-app Bot deleted the 09-03-fix_formatter_css_preserve_comments_around_scss_less_variable_values branch September 3, 2026 08:32
graphite-app Bot pushed a commit that referenced this pull request Sep 7, 2026
# Oxlint
### 🚀 Features

- 6a0e19c linter/eslint/no-unmodified-loop-condition: Support `checkConditionalExpressions` option (#26249) (camc314)

### 🐛 Bug Fixes

- 562dd14 jsx-a11y/anchor-has-content: Allow anchors passed as custom component props (#26360) (Mikhail Baev)
- 253cdb2 linter/eslint/id-length: Exempt TS interface/type-literal members with never (#26310) (Pearce Ropion)
- 8c7ea76 ast_visit: Account for trimmed source offsets (#26223) (Cameron)
- 5f9cffc linter/typescript/no-explicit-any: Fix rest parameter to `unknown[]` (#26279) (camc314)
- 4de9fa3 linter/react/jsx-no-literals: Check nested JSX expression literals (#26253) (camc314)
- 07851b9 parser: Fix debug assert failure when lexer error with tokens enabled (#26229) (overlookmotel)
- 9cee146 oxlint/lsp: Don't try to parse fix message, always fallback (#26204) (Sysix)
- a662c40 linter/eslint/no-useless-assignment: Handle destructuring assignments (#25925) (camc314)
- 304bd9a linter/eslint/no-array-constructor: Handle ASI hazards in fixer (#26166) (Hamody We)
- b41bb35 linter: Qualify rules in rules output (#26250) (camc314)
- 895c685 linter/typescript/no-extraneous-class: Avoid deleting class expressions (#26231) (camc314)
- 4ba33c8 linter/eslint/no-unused-vars: Handle stored arrow references (#26225) (camc314)

### 🛡️ Security

- 9a612d5 deps: Update npm packages (#26178) (renovate[bot])
# Oxfmt
### 💥 BREAKING CHANGES

- 2c9a947 parser: [**BREAKING**] Reduce `MAX_LEN` to 256 bytes below `u32::MAX` (#26352) (overlookmotel)

### 🚀 Features

- 68e12ab formatter_css: Follow the oxc-css-parser's acceptance line (#26337) (leaysgur)

### 🐛 Bug Fixes

- f7acdc0 formatter: Treat a JSDoc cast target as opaque in chain layouts (#26375) (leaysgur)
- 104061b formatter: Keep JSDoc cast parens with a comment inside them (#26374) (leaysgur)
- 3d00a76 formatter_css: Keep comment inside important and simple-vars colon (#26370) (leaysgur)
- 172ddb6 formatter_css: Keep a same-line line comment on its line (#26321) (leaysgur)
- cafaf32 formatter_css: Never drop comments inside an at-rule prelude (#26320) (leaysgur)
- 534a0fe formatter_css: Keep a line comment on its comma's line (#26319) (leaysgur)
- 99cfd75 formatter_css: Hide raw comment printing API, use strcut instead (#26316) (leaysgur)
- 2028896 formatter_css: Preserve comments around SCSS/Less variable values (#26276) (leaysgur)
- 6752abc formatter_css: Keep leading comments before (#26272) (leaysgur)
- 3b054de formatter_graphql: Align comment printing after open `{` (#26271) (leaysgur)
- b3c287a formatter_css: Fix SCSS bracket list printing (#26270) (leaysgur)
- bac770a formatter_css: Preserve comment in SCSS paren comma list (#26269) (leaysgur)
- c7b57ef formatter_css: Print SCSS map consisntent with and without comment (#26268) (leaysgur)
- 063e2b6 formatter_css: Preserve trailing comma in single-item scss lists (#26245) (leaysgur)
- 5f9580d oxfmt: Bump prettier-plugin-tailwindcss (#26273) (leaysgur)

### ⚡ Performance

- 1cad286 oxfmt: Match editorconfig once per file (#26239) (Yuji Sugiura)
- 260c5eb oxfmt: Match `overrides` once per file (#26238) (leaysgur)
- 61565bc oxfmt: Share resolved `FormatConfig` via `Arc` instead of cloning per file (#26237) (leaysgur)

### 📚 Documentation

- 32084d4 formatter_core: Clarify printer hard_line compression (#26312) (leaysgur)
- 4fabdcc formatter,formatter_css,formatter_graphql,formatter_yaml: Update DIVERGENCES.md (#26267) (leaysgur)
- 26a1fa4 formatter_core: Refine FORMATTER_POLICY (#26266) (leaysgur)

### 🛡️ Security

- 9a612d5 deps: Update npm packages (#26178) (renovate[bot])
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