Skip to content

Conversation

@JacquesLeupin
Copy link
Contributor

Summary

Closes #8636.

Fixed wrapping of comma-separated declaration values so Biome prefers breaking at top-level commas (Prettier-like), instead of wrapping inside a comma-group.

Repro

What changed

  • In ValueListLayout::Fill, declaration values with top-level commas are now formatted as “comma-groups” so wrapping prefers the comma boundary.
  • Added regression coverage for --popover-shadow (multiline and single-line input variants).

Tests

  • just format
  • just lint
  • just test

AI assistance disclosure

This PR was written with AI assistance (Cursor + GPT). The implementation and refactors were reviewed and adjusted manually.

@changeset-bot
Copy link

changeset-bot bot commented Jan 2, 2026

🦋 Changeset detected

Latest commit: 6bbe743

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Formatter Area: formatter L-CSS Language: CSS labels Jan 2, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 2, 2026

CodSpeed Performance Report

Merging #8655 will not alter performance

Comparing JacquesLeupin:fix/css-formatter-comma-breaks (6bbe743) with main (f517a24)1

Summary

✅ 29 untouched
⏩ 126 skipped2

Footnotes

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

  2. 126 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.

@JacquesLeupin JacquesLeupin marked this pull request as ready for review January 2, 2026 18:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Walkthrough

This change adds a changeset and updates the CSS formatter to break comma-separated declaration values at top-level commas when using the Fill layout. It adds an is_comma_delimiter helper, a try_write_fill_comma_groups path, and write_fill_comma_groups to format comma-delimited groups with a nested Fill joined by soft line breaks or spaces. The new path takes precedence in write_component_value_list. A test for issue 8636 (comma-separated shadow values) was added. No public API changes.

Possibly related PRs

Suggested reviewers

  • dyc3
  • siketyan

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: CSS formatter now prefers breaking declaration values at top-level commas, matching Prettier's behaviour.
Description check ✅ Passed The description clearly explains the fix, references the closed issue #8636, provides a Playground reproduction link, and outlines what changed and testing done.
Linked Issues check ✅ Passed The PR directly addresses #8636's requirement to modify the CSS formatter to break comma-separated declaration values at top-level comma boundaries matching Prettier, implemented via comma-group formatting logic.
Out of Scope Changes check ✅ Passed All changes are narrowly scoped to CSS formatter comma-handling logic and test coverage for the specific issue; no extraneous modifications detected.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.changeset/curvy-wasps-mix.md (1)

5-5: Consider adding a before/after example.

Based on learnings, formatter changesets benefit from showing the visual impact with a diff code block.

Example addition
 Biome's CSS formatter now breaks comma-separated declaration values at top-level commas when wrapping.
+
+Before:
+```css
+--popover-shadow: 0px 2px 4px 0px var(--shadow, rgba(0, 0, 0, 0.06)), 0px 8px 16px 0px var(--shadow, rgba(0, 0, 0, 0.06));
+```
+
+After:
+```css
+--popover-shadow:
+  0px 2px 4px 0px var(--shadow, rgba(0, 0, 0, 0.06)),
+  0px 8px 16px 0px var(--shadow, rgba(0, 0, 0, 0.06));
+```
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87dac09 and 85de021.

⛔ Files ignored due to path filters (1)
  • crates/biome_css_formatter/tests/specs/css/issue_8636.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/curvy-wasps-mix.md
  • crates/biome_css_formatter/src/utils/component_value_list.rs
  • crates/biome_css_formatter/tests/specs/css/issue_8636.css
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
🧠 Learnings (11)
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/comments.rs : Define `<Language>CommentStyle` as a public type alias for `Comments<<Language>Language>` in a `comments.rs` file

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Implement the `FormatNodeRule<N>` trait with `fmt_fields` as the only required method; default implementations of `fmt`, `is_suppressed`, `fmt_leading_comments`, `fmt_dangling_comments`, and `fmt_trailing_comments` are provided

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Changesets should describe user-facing changes only; internal refactoring without behavior changes does not require a changeset

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Changesets should be concise (1-3 sentences) and provide quick overview of changes without overwhelming details

Applied to files:

  • .changeset/curvy-wasps-mix.md
🧬 Code graph analysis (1)
crates/biome_css_formatter/src/utils/component_value_list.rs (2)
crates/biome_rowan/src/ast/mod.rs (1)
  • cast_ref (143-152)
crates/biome_formatter/src/builders.rs (3)
  • soft_line_break_or_space (188-190)
  • format_with (2304-2312)
  • format_once (2381-2389)
🔇 Additional comments (6)
crates/biome_css_formatter/tests/specs/css/issue_8636.css (1)

1-6: Solid test coverage for the comma-breaking behavior.

The test cases nicely demonstrate both the multiline comma-breaking behaviour (lines 2-4) and the preservation of inline formatting (line 5).

crates/biome_css_formatter/src/utils/component_value_list.rs (5)

11-20: Clean helper implementation.

The function correctly identifies comma delimiters through the AST casting chain.


22-48: Well-gated feature implementation.

The three conditions appropriately scope the new behaviour to declaration value lists with commas in Fill layout, with clear comments explaining the rationale.


50-104: Formatter logic is sound.

The group-splitting algorithm correctly places commas at the end of each group (lines 61-69), and the nested fill structure (outer fill for groups, inner fill for elements within each group) achieves the desired Prettier-like breaking behaviour.


137-142: Elegant integration with existing logic.

The early-return pattern allows the new comma-group behaviour to take precedence for qualifying lists whilst preserving all existing formatting paths.


154-154: Good refactoring to use the new helper.

Replacing the inline comma detection with is_comma_delimiter improves code reuse and readability.

@dyc3
Copy link
Contributor

dyc3 commented Jan 2, 2026

looks like your pr title got cut off

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good at a glance, but the docs aren't there yet.

@JacquesLeupin JacquesLeupin changed the title fix(css-formatter): prefer breaking declaration values at top-level c… Jan 3, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.changeset/curvy-wasps-mix.md (1)

5-5: Issue link format should show the issue number.

The expected format per project conventions is Fixed [#8636](url): rather than [Fixed](url):. The issue number should be visible in the text.

Based on learnings: "In changesets, start with a link to the issue when fixing a bug (e.g., 'Fixed #4444: ...')".

Suggested fix
-[Fixed](https://github.com/biomejs/biome/issues/8636): Biome's CSS formatter now breaks comma-separated declaration values at top-level commas when wrapping.
+Fixed [#8636](https://github.com/biomejs/biome/issues/8636): Biome's CSS formatter now breaks comma-separated declaration values at top-level commas when wrapping.
🧹 Nitpick comments (1)
crates/biome_css_formatter/src/utils/component_value_list.rs (1)

113-126: Consider whether the clone is necessary.

The element.clone() at line 115 works, but depending on the size/cost of I, you might be able to avoid it by iterating over references differently. For AST node handles this is likely cheap, so not a blocker.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85de021 and 70578ac.

📒 Files selected for processing (2)
  • .changeset/curvy-wasps-mix.md
  • crates/biome_css_formatter/src/utils/component_value_list.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Use conventional commit format for commit messages and PR titles, with supported prefixes: build, chore, ci, docs, feat, fix, perf, refactor, release, revert, test
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Changesets should describe user-facing changes only; internal refactoring without behavior changes does not require a changeset

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: In changesets, start with a link to the issue when fixing a bug (e.g., 'Fixed [#4444](link): ...')

Applied to files:

  • .changeset/curvy-wasps-mix.md
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `Markup!` macro for diagnostic messages and code action descriptions to ensure proper formatting

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test Node.js API
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: End-to-end tests
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
🔇 Additional comments (4)
crates/biome_css_formatter/src/utils/component_value_list.rs (4)

11-25: LGTM!

Clear helper with good documentation explaining the nested construct limitation. The Option chaining is idiomatic.


27-71: Well documented with CSS examples.

The guards are clear, and the rustdoc with before/after CSS samples addresses the previous feedback about needing explanatory comments. The early-return pattern keeps the logic readable.


170-175: Clean integration with early return.

The new comma-group path takes precedence when applicable, with a clear fallback to the existing logic. Good use of the helper.


187-187: Good refactor to use the shared helper.

@JacquesLeupin JacquesLeupin force-pushed the fix/css-formatter-comma-breaks branch from 08b5792 to 6bbe743 Compare January 3, 2026 00:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_css_formatter/src/utils/component_value_list.rs (1)

11-25: Well-documented helper with clear semantics.

The rustdoc explaining nested comma behaviour is particularly helpful for future maintainers.

Minor optional simplification using is_some_and:

🔎 Optional refactor
-fn is_comma_delimiter<I>(node: &I) -> bool
-where
-    I: AstNode<Language = CssLanguage>,
-{
-    let token_kind = CssGenericDelimiter::cast_ref(node.syntax())
-        .and_then(|node| node.value().ok())
-        .map(|token| token.kind());
-
-    matches!(token_kind, Some(CssSyntaxKind::COMMA))
-}
+fn is_comma_delimiter<I>(node: &I) -> bool
+where
+    I: AstNode<Language = CssLanguage>,
+{
+    CssGenericDelimiter::cast_ref(node.syntax())
+        .and_then(|node| node.value().ok())
+        .is_some_and(|token| token.kind() == CssSyntaxKind::COMMA)
+}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08b5792 and 6bbe743.

⛔ Files ignored due to path filters (1)
  • crates/biome_css_formatter/tests/specs/css/issue_8636.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/curvy-wasps-mix.md
  • crates/biome_css_formatter/src/utils/component_value_list.rs
  • crates/biome_css_formatter/tests/specs/css/issue_8636.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/curvy-wasps-mix.md
  • crates/biome_css_formatter/tests/specs/css/issue_8636.css
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use the dbg!() macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests

Files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ParseSeparatedList` and `ParseNodeList` for parsing lists with error recovery to avoid infinite loops

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2026-01-02T14:58:16.536Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2026-01-02T14:58:16.536Z
Learning: Applies to crates/biome_analyze/**/*_analyze/**/src/lint/**/*.rs : Use `Markup!` macro for diagnostic messages and code action descriptions to ensure proper formatting

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: For formatter changes in changesets, show formatting changes using diff code blocks

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
📚 Learning: 2025-12-21T21:15:03.796Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-21T21:15:03.796Z
Learning: Applies to **/*.rs : Use inline rustdoc documentation for rules, assists, and their options

Applied to files:

  • crates/biome_css_formatter/src/utils/component_value_list.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: autofix
🔇 Additional comments (4)
crates/biome_css_formatter/src/utils/component_value_list.rs (4)

27-71: Solid implementation with appropriate guards.

The rustdoc with before/after CSS examples is excellent — makes the intent crystal clear. The guard conditions correctly scope this behaviour to declaration values only, preventing unintended side effects elsewhere.


109-130: Logic is correct, but consider the clone overhead.

Line 115 clones each element to satisfy into_format's ownership requirement. For typical CSS values this should be negligible, but worth noting.

The separator logic at lines 119-122 correctly avoids inserting a space before commas — good attention to detail.


170-175: Clean integration with helpful inline comment.

The early return pattern keeps the existing logic untouched for non-comma-separated values. Good use of the new helper.


187-187: Consistent use of the new helper.

Replacing the inline token-kind check with is_comma_delimiter improves consistency across the file.

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, thank you!

@dyc3 dyc3 merged commit 3260ec9 into biomejs:main Jan 3, 2026
17 checks passed
@github-actions github-actions bot mentioned this pull request Jan 2, 2026
baeseokjae pushed a commit to baeseokjae/biome that referenced this pull request Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter L-CSS Language: CSS

2 participants