Skip to content

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Dec 8, 2025

Summary

Closes #7923

Here's the list of changes:

  • Expanded the embedding kind of CssFileSource. This allows us to understand when we should enable :slotted/:deep parsing inside the <style> portion of the HTML-ish files.
  • Improved the CSS parser to parse :slotted and :deep only when parsing a Vue file (added a new option in the CSS parser)
  • Improved the parsing experience of CSS modules by using the SyntaxFeatures of the parser. The diagnostics have been updated, hence the changes in many snapshots.
  • Now Biome enables cssModules when it reads files that end in .modules.css. Similar to what we do for the .d.ts files.
  • Fixed an issue in our workspace where the parsing options weren't calculated using L::resolve_parse_options
  • Removed css_modules from the analyzer. This is an information we already have in the CssFileSource

Test Plan

Added new tests and updated existing snapshots.

I also took the chance to improve the testing infrastructure, so that the parsing options are computed using the same mechanism we use in the Workspace.

Docs

I believe we should tweak the cssModules documentation, and maybe the known files section

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2025

🦋 Changeset detected

Latest commit: 2cf0ca1

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

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

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

@ematipico ematipico changed the title fix(cli): resolve configs from parent paths (#8371) feat(html): support CSS modules syntax and vue css syntax Dec 8, 2025
@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS A-Diagnostic Area: diagnostocis L-HTML Language: HTML and super languages labels Dec 8, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 8, 2025

CodSpeed Performance Report

Merging #8399 will not alter performance

Comparing feat/embedded-css (2cf0ca1) with next (8eb3f19)1

Summary

✅ 29 untouched
⏩ 126 skipped2

Footnotes

  1. No successful run was found on next (bf02ba6) during the generation of this report, so 8eb3f19 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.

@ematipico ematipico self-assigned this Dec 8, 2025
@github-actions github-actions bot removed A-Formatter Area: formatter A-Diagnostic Area: diagnostocis L-HTML Language: HTML and super languages labels Dec 8, 2025
@ematipico ematipico marked this pull request as ready for review December 9, 2025 10:46
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

This PR adds Vue SFC-aware CSS parsing (recognises :slotted, :deep, :global inside SFC <style>), introduces a three-way CssModulesKind (None, Classic, Vue) and exposes it through parser/service settings, removes the boolean css_modules flag from analyzer context/options, adds feature flags CssModules and CssModulesWithVue, extends file-source/embedding metadata (HTML/Vue/Astro/Svelte), updates embedded-style parsing paths and tests, and adds lexer tokens for slotted and deep. Changes touch parser, analyzer, service and test utilities.

Possibly related PRs

  • biomejs/biome PR 7702 — Implements experimental full‑HTML embedding and variant handling (Vue/Astro/Svelte) relied on here.
  • biomejs/biome PR 8095 — Refactors CssFileSource → CssParserOptions mapping and file‑source‑driven parser behaviour used in this change.
  • biomejs/biome PR 7571 — Modifies embedded-style parsing/signature (parse_embedded_style) and service plumbing overlapping this PR.

Suggested labels

A-Formatter, L-HTML

Suggested reviewers

  • dyc3
  • arendjr

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarises the main change: adding CSS modules syntax and Vue CSS syntax support to HTML processing.
Description check ✅ Passed The description relates to the changeset, explaining the motivation (issue #7923), listing concrete changes, and mentioning test updates.
Linked Issues check ✅ Passed The PR successfully addresses #7923 by adding parser support for Vue pseudo-classes (:deep, :slotted, :global) and enabling CSS modules for .module.css files.
Out of Scope Changes check ✅ Passed All changes align with the stated objectives: CSS parser enhancements, Vue SFC support, CSS modules automation, analyzer refactoring, and testing infrastructure improvements.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/embedded-css

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: 4

🧹 Nitpick comments (4)
crates/biome_cli/tests/cases/handle_vue_files.rs (1)

496-501: Vue full-support style block now exercises :slotted and :global.

Nice targeted fixture to hit the new Vue CSS parsing path in an end-to-end check. If you fancy being extra thorough at the CLI level, you could also drop a :deep(div) case into this or a sibling test, but that’s optional if the CSS parser already has dedicated coverage.

.changeset/angry-women-accept.md (1)

1-7: Polish changeset wording and flag name.

Two tiny nits: the grammar and the option name. Something along these lines would read better and match the tests:

-The Biome CSS parser is now able to parse Vue SFC syntax such as `:slotted` and `:deep`. These pseudo functions are only correctly parsed when the CSS is defined inside `.vue` components. Otherwise, Biome will a emit a parse error.
+The Biome CSS parser can now parse Vue SFC syntax such as `:slotted` and `:deep`. These pseudo-functions are only parsed when the CSS is defined inside `.vue` components. Otherwise, Biome will emit a parse error.
 
-This capability is only available when `experimentalFullHtmlSupportedEnabled` is set to `true`.
+This capability is only available when the `html.experimentalFullSupportEnabled` option is set to `true`.
crates/biome_test_utils/src/lib.rs (1)

137-182: Double-check create_parser_options behaviour on config errors.

In the has_errors branch you extend diagnostics and then return Default::default(), which here is None because the return type is Option<L::ParserOptions>. In contrast, create_formatting_options always falls back to default options when the .options.json is missing or invalid. If callers expect to always have parser options, you may want to wrap the default in Some(...); if None is deliberately used to mean “no special parser options”, current code is fine but that contract should be clear.

For an “always-some” variant:

-    if loaded_configuration.has_errors() {
+    if loaded_configuration.has_errors() {
         // …collect diagnostics…
-        Default::default()
+        Some(Default::default())
     } else {
         // …merge settings…
         let handle = SettingsHandle::new(&settings, None);
         Some(handle.parse_options::<L>(&input_file.into(), &document_file_source))
     }
crates/biome_css_syntax/src/file_source.rs (1)

20-35: Consider renaming EmbeddingHtmlKind::None for clarity.

The None variant within EmbeddingHtmlKind is a bit confusing since the enum itself represents HTML embedding contexts. Perhaps Unknown or keeping it as a private implementation detail might be clearer? That said, this is a minor nitpick – the current implementation works.

📜 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 6c5f368 and 36cd2fb.

⛔ Files ignored due to path filters (9)
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.module.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (32)
  • .changeset/angry-women-accept.md (1 hunks)
  • .changeset/odd-flies-nail.md (1 hunks)
  • .changeset/plenty-hornets-hide.md (1 hunks)
  • crates/biome_analyze/src/context.rs (0 hunks)
  • crates/biome_analyze/src/options.rs (0 hunks)
  • crates/biome_analyze/src/registry.rs (0 hunks)
  • crates/biome_analyze/src/signals.rs (0 hunks)
  • crates/biome_cli/tests/cases/handle_astro_files.rs (1 hunks)
  • crates/biome_cli/tests/cases/handle_svelte_files.rs (1 hunks)
  • crates/biome_cli/tests/cases/handle_vue_files.rs (1 hunks)
  • crates/biome_configuration/src/css.rs (1 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (3 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs (3 hunks)
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs (2 hunks)
  • crates/biome_css_analyze/tests/spec_tests.rs (3 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.options.json (0 hunks)
  • crates/biome_css_parser/src/lexer/mod.rs (1 hunks)
  • crates/biome_css_parser/src/lib.rs (1 hunks)
  • crates/biome_css_parser/src/parser.rs (6 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/value.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/css_modules.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/mod.rs (3 hunks)
  • crates/biome_css_parser/src/syntax/property/mod.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs (2 hunks)
  • crates/biome_css_syntax/src/file_source.rs (4 hunks)
  • crates/biome_service/src/file_handlers/css.rs (4 hunks)
  • crates/biome_service/src/file_handlers/html.rs (4 hunks)
  • crates/biome_service/src/settings.rs (2 hunks)
  • crates/biome_test_utils/src/lib.rs (1 hunks)
  • xtask/codegen/src/css_kinds_src.rs (1 hunks)
💤 Files with no reviewable changes (5)
  • crates/biome_analyze/src/context.rs
  • crates/biome_analyze/src/signals.rs
  • crates/biome_analyze/src/registry.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.options.json
  • crates/biome_analyze/src/options.rs
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets for user-facing changes using just new-changeset; use headers with #### or ##### only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop
For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a diff code block

Files:

  • .changeset/angry-women-accept.md
  • .changeset/plenty-hornets-hide.md
  • .changeset/odd-flies-nail.md
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • crates/biome_configuration/src/css.rs
  • crates/biome_css_parser/src/lib.rs
  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • xtask/codegen/src/css_kinds_src.rs
  • crates/biome_css_syntax/src/file_source.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_service/src/file_handlers/css.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
  • crates/biome_test_utils/src/lib.rs
  • crates/biome_service/src/file_handlers/html.rs
🧠 Learnings (69)
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Document rules with a one-line brief description in the first paragraph of the doc comment, followed by detailed paragraphs, `## Examples` section with `### Invalid` and `### Valid` subsections, and optional `## Options` section

Applied to files:

  • crates/biome_configuration/src/css.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Wrap optional rule option fields in `Option<_>` to properly track set vs unset options during configuration merging

Applied to files:

  • crates/biome_configuration/src/css.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_service/src/file_handlers/css.rs
  • crates/biome_test_utils/src/lib.rs
📚 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/**/*.ungram : Add a legend comment to `.ungram` files explaining the grammar syntax including comments, non-terminals, tokens, sequences, alternations, repetitions, and optional elements

Applied to files:

  • crates/biome_configuration/src/css.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`

Applied to files:

  • crates/biome_configuration/src/css.rs
  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_service/src/file_handlers/css.rs
  • crates/biome_test_utils/src/lib.rs
📚 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 : Parse rules must take a mutable reference to the parser as their only parameter and return a `ParsedSyntax`

Applied to files:

  • crates/biome_configuration/src/css.rs
  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 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/*_kinds_src.rs : Create a file called `src/{language}_kinds_src.rs` that returns a static `KindSrc` for new language parsers

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_test_utils/src/lib.rs
📚 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/**/language_kind.rs : Add a new variant to `LanguageKind` enum in `language_kind.rs` file and implement all methods for the new language variant

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_test_utils/src/lib.rs
📚 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/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_service/src/file_handlers/css.rs
  • crates/biome_test_utils/src/lib.rs
📚 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/**/lexer/mod.rs : Implement a `Lexer` trait from `biome_parser` crate for the lexer struct that consumes characters from source code and emits tokens

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/lexer/mod.rs
📚 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 : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.rs
📚 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 `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.rs
📚 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_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
📚 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 `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 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 : Parse rule functions must be prefixed with `parse_` and use the name defined in the grammar file, e.g., `parse_for_statement` or `parse_expression`

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_service/src/file_handlers/css.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_parser/src/lib.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_service/src/file_handlers/css.rs
  • crates/biome_service/src/file_handlers/html.rs
📚 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 : Parse rules must return `ParsedSyntax::Absent` if the rule can't predict by the next token(s) if they form the expected node, and must not progress the parser in this case

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.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/lib.rs : Expose a public `format_node` function that accepts formatting options and a root syntax node, returning a `FormatResult<Formatted<Context>>` with appropriate documentation

Applied to files:

  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_service/src/file_handlers/css.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a `diff` code block

Applied to files:

  • .changeset/plenty-hornets-hide.md
  • .changeset/odd-flies-nail.md
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to .changeset/**/*.md : Create changesets for user-facing changes using `just new-changeset`; use headers with `####` or `#####` only; keep descriptions concise (1-3 sentences) and focus on user-facing changes

Applied to files:

  • .changeset/plenty-hornets-hide.md
  • .changeset/odd-flies-nail.md
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnknown` prefix for rules that report mistyped entities in CSS (e.g., `noUnknownUnit`)

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_service/src/settings.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.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/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Framework-specific rules should be named using the `use` or `no` prefix followed by the framework name (e.g., `noVueReservedProps`)

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.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/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.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/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_cli/tests/cases/handle_vue_files.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: Define `FormatHtmlSyntaxNode` struct in a `cst.rs` file implementing `FormatRule<HtmlSyntaxNode>`, `AsFormat<HtmlFormatContext>`, and `IntoFormat<HtmlFormatContext>` traits using the provided boilerplate code

Applied to files:

  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_service/src/file_handlers/html.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : For rules ported from other ecosystems like ESLint or Clippy, add a `sources` field with `RuleSource` metadata using `.same()` for identical behavior or `.inspired()` for different behavior

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Check if a variable is global before banning it to avoid false positives when the variable is redeclared in local scope; use the semantic model to verify global scope

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUndeclared` prefix for rules that report undefined entities (e.g., `noUndeclaredVariables`)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use `rule_category!()` macro instead of dynamic string parsing to refer to rule diagnostic categories for compile-time validation

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnused` prefix for rules that report unused entities (e.g., `noUnusedVariables`)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noRedundant` prefix for rules that report redundant code (e.g., `noRedundantUseStrict`)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useConsistent` prefix for rules that ensure consistency across the codebase (e.g., `useConsistentArrayType`)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/lexer/mod.rs
📚 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/**/*.ungram : Nodes for enclosing syntax errors must have the `Bogus` word, e.g., `HtmlBogusAttribute`, and must be part of a variant

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
📚 Learning: 2025-10-25T07:22:18.540Z
Learnt from: ematipico
Repo: biomejs/biome PR: 7852
File: crates/biome_css_parser/src/syntax/property/mod.rs:161-168
Timestamp: 2025-10-25T07:22:18.540Z
Learning: In the Biome CSS parser, lexer token emission should not be gated behind parser options like `is_tailwind_directives_enabled()`. The lexer must emit correct tokens regardless of parser options to enable accurate diagnostics and error messages when the syntax is used incorrectly.

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.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_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 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 : Implement a token source struct that wraps the lexer and implements `TokenSourceWithBufferedLexer` and `LexerWithCheckpoint` for lookahead and re-lexing capabilities

Applied to files:

  • crates/biome_css_parser/src/lexer/mod.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_parser/src/lexer/mod.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noRestricted` prefix for rules that report user-banned entities (e.g., `noRestrictedGlobals`)

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : In rule documentation code blocks, mark invalid examples with the `expect_diagnostic` property and valid examples without it; each invalid example must emit exactly one diagnostic

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Set rule severity to `error` for correctness/security/a11y rules, `warn` for suspicious/performance rules, `info` for style/complexity rules, and `info` for actions

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Commit rule changes with message format: `feat(biome_<crate>): <ruleName>` to follow Biome's conventional commit style

Applied to files:

  • .changeset/odd-flies-nail.md
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_service/src/settings.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/src/**/*.rs : Implement the `Merge` trait for rule options to define how options from extended configuration merge with user configuration (usually reset instead of extend)

Applied to files:

  • crates/biome_service/src/settings.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Internal crate changes that don't affect user-facing behavior do not require changesets; changesets are only for user-facing changes

Applied to files:

  • crates/biome_service/src/settings.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_service/src/settings.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/lib.rs : Define a type alias `<Language>Formatter<'buf>` as `Formatter<'buf, <Language>FormatContext>` in the main formatter crate

Applied to files:

  • crates/biome_service/src/settings.rs
  • crates/biome_service/src/file_handlers/html.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 : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • crates/biome_css_parser/src/syntax/property/mod.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Deprecate rules by adding a `deprecated` field to the `declare_lint_rule!` macro with a message explaining the reason for deprecation (e.g., 'Use the rule noAnotherVar')

Applied to files:

  • crates/biome_css_parser/src/syntax/at_rule/value.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling

Applied to files:

  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : The `diagnostic` function must return a `RuleDiagnostic` that defines the message reported to the user using the `markup!` macro

Applied to files:

  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Avoid using `unwrap()` or `expect()` on `Result` and `Option` types; instead use helper functions like `map`, `filter`, `and_then` to maintain code clarity and avoid panics

Applied to files:

  • crates/biome_css_analyze/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : When navigating CST nodes that return `Result`, use the try operator `?` to convert to `Option`, or use `let else` pattern for `Vec` return types in rule run functions

Applied to files:

  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `declare_node_union!` macro to query multiple node types at once by joining them into an enum with `Any*Like` naming convention

Applied to files:

  • crates/biome_css_analyze/tests/spec_tests.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules must be implemented using the `Rule` trait with type parameters: `Query` (node type to analyze), `State` (information for signals), `Signals` (return type from run function), and `Options` (rule configuration)

Applied to files:

  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Implement custom `Queryable` types and `Visitor` traits for rules requiring deep AST inspection to avoid redundant traversal passes

Applied to files:

  • crates/biome_cli/tests/cases/handle_astro_files.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Rules should use the `use` prefix naming convention when the sole intention is to mandate a single concept (e.g., `useValidLang` to enforce valid HTML lang attribute values)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noUnsafe` prefix for rules that report code leading to runtime failures (e.g., `noUnsafeOptionalChaining`)

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use `Semantic<T>` query type instead of `Ast<T>` when a rule needs to access the semantic model for binding references and scope information

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : The `declare_lint_rule!` macro must include metadata fields: `version` (set to 'next'), `name` (rule identifier), `language` (applicable language), `recommended` (boolean), and optional fields like `severity`, `fix_kind`, `sources`, `domains`, and `deprecated`

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : The `run` function of a lint rule should return `Option<Self::State>` or an iterable like `Vec<Self::State>` or `Box<[Self::State]>` to signal zero or more diagnostics

Applied to files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noEmpty` prefix for rules that report empty code (e.g., `noEmptyBlockStatements`)

Applied to files:

  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `noConstant` prefix for rules that report computations always evaluated to the same value (e.g., `noConstantMathMinMaxClamp`)

Applied to files:

  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use the `useValid` prefix for rules that report code that always evaluates to a constant (e.g., `useValidTypeof`)

Applied to files:

  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Rules should use the `no` prefix naming convention when the sole intention is to forbid a single concept (e.g., `noDebugger` to disallow debugger statements)

Applied to files:

  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
📚 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: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers

Applied to files:

  • crates/biome_test_utils/src/lib.rs
🧬 Code graph analysis (10)
crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs (1)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (2)
  • is_at_vue_pseudo_class_function_selector (30-32)
  • is_at_pseudo_class_function_selector (25-27)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (1)
crates/biome_css_analyze/src/utils.rs (1)
  • is_css_module_pseudo_class (152-154)
crates/biome_service/src/settings.rs (1)
crates/biome_css_parser/src/parser.rs (1)
  • options (120-122)
crates/biome_css_parser/src/syntax/at_rule/keyframes.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (5)
  • is_at_declaration (221-223)
  • is_at_identifier (439-441)
  • is_at_string (565-567)
  • parse_custom_identifier (488-490)
  • parse_string (552-562)
crates/biome_css_parser/src/syntax/at_rule/value.rs (1)
crates/biome_css_parser/src/syntax/mod.rs (5)
  • is_at_identifier (439-441)
  • is_at_string (565-567)
  • is_nth_at_identifier (444-446)
  • parse_regular_identifier (450-452)
  • parse_string (552-562)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs (1)
crates/biome_css_analyze/src/utils.rs (2)
  • vender_prefix (26-33)
  • is_pseudo_elements (35-42)
crates/biome_css_syntax/src/file_source.rs (1)
crates/biome_service/src/file_handlers/mod.rs (2)
  • try_from_well_known (133-164)
  • try_from_extension (171-207)
crates/biome_service/src/file_handlers/css.rs (1)
crates/biome_css_parser/src/parser.rs (1)
  • options (120-122)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (3)
crates/biome_css_parser/src/syntax/css_modules.rs (2)
  • local_or_global_not_allowed (18-26)
  • slotted_or_deep_not_allowed (30-36)
crates/biome_css_parser/src/syntax/parse_error.rs (1)
  • expected_selector (58-60)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_regular_identifier (450-452)
crates/biome_service/src/file_handlers/html.rs (4)
crates/biome_css_parser/src/lib.rs (1)
  • parse_css_with_offset_and_cache (231-249)
crates/biome_html_formatter/src/context.rs (1)
  • file_source (77-79)
crates/biome_css_syntax/src/file_source.rs (2)
  • css (71-76)
  • new_css_modules (85-90)
crates/biome_html_parser/src/parser.rs (1)
  • options (32-34)
🪛 LanguageTool
.changeset/angry-women-accept.md

[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...biome": minor --- The Biome CSS parser is now able to parse Vue SFC syntax such as :slotted...

(BE_ABLE_TO)


[misspelling] ~5-~5: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ....vue` components. Otherwise, Biome will a emit a parse error. This capability is...

(EN_A_VS_AN)

⏰ 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: Check Dependencies
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: autofix

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: 2

♻️ Duplicate comments (1)
.changeset/odd-flies-nail.md (1)

5-17: Changeset content remains misleading.

This concern was previously raised: the diff should show adding "cssModules": false rather than removing "cssModules": true. Additionally, the scenario description needs clarification about when users would actually want to disable CSS Modules.

🧹 Nitpick comments (2)
crates/biome_configuration/src/css.rs (1)

52-53: Documentation could be clearer.

The phrasing "Enable this feature only when your files don't end in .module.css" is a bit confusing. Since Biome auto-enables CSS Modules for *.module.css files, consider rephrasing to: "Enable this feature to parse CSS Modules syntax in files that don't have the .module.css extension."

🔎 Suggested documentation improvement
-    /// Enables parsing of CSS Modules specific features. Enable this feature only
-    /// when your files don't end in `.module.css`.
+    /// Enables parsing of CSS Modules specific features. Enable this feature
+    /// to parse CSS Modules syntax in files that don't have the `.module.css` extension.
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (1)

34-48: Update documentation to reflect Vue support.

The function now handles both CSS Modules (:local, :global) and Vue SFC (:slotted, :deep) pseudo-classes, but the documentation only mentions the CSS Modules case.

🔎 Suggested enhancement
-/// Parses a pseudo-class function selector for CSS Modules.
+/// Parses a pseudo-class function selector for CSS Modules and Vue SFC.
 ///
-/// This function parses a pseudo-class function selector, specifically `:local` or `:global`, in CSS Modules.
-/// If the `css.parser.cssModules` option is not enabled, it generates a diagnostic error and skips the selector.
+/// This function parses pseudo-class function selectors for:
+/// - CSS Modules: `:local` or `:global` (requires `css.parser.cssModules` option)
+/// - Vue SFC: `:slotted` or `:deep` (automatically enabled for Vue files)
 /// ```css
+/// /* CSS Modules */
 /// :local(.className) {
 ///     color: red;
 /// }
-/// :global(.globalClass) .nestedClass {
-///     padding: 10px;
-/// }
-/// :local(.className) > :global(.globalClass) {
-///     margin: 0;
+/// 
+/// /* Vue SFC */
+/// :deep(.nested) {
+///     font-size: 14px;
 /// }
 /// ```
📜 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 36cd2fb and e874191.

⛔ Files ignored due to path filters (9)
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/full_support.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.module.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/selector/pseudo_class/pseudo_class_function_selector/disabled/pseudo_class_function_selector_disabled.css.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_syntax/src/generated/kind.rs is excluded by !**/generated/**, !**/generated/** and included by **
📒 Files selected for processing (27)
  • .changeset/angry-women-accept.md (1 hunks)
  • .changeset/odd-flies-nail.md (1 hunks)
  • .changeset/plenty-hornets-hide.md (1 hunks)
  • crates/biome_analyze/src/context.rs (0 hunks)
  • crates/biome_analyze/src/options.rs (0 hunks)
  • crates/biome_analyze/src/registry.rs (0 hunks)
  • crates/biome_analyze/src/signals.rs (0 hunks)
  • crates/biome_cli/tests/cases/handle_astro_files.rs (1 hunks)
  • crates/biome_cli/tests/cases/handle_svelte_files.rs (1 hunks)
  • crates/biome_cli/tests/cases/handle_vue_files.rs (1 hunks)
  • crates/biome_configuration/src/css.rs (1 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (3 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs (3 hunks)
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs (2 hunks)
  • crates/biome_css_analyze/tests/spec_tests.rs (3 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.options.json (0 hunks)
  • crates/biome_css_parser/src/lexer/mod.rs (1 hunks)
  • crates/biome_css_parser/src/lib.rs (1 hunks)
  • crates/biome_css_parser/src/parser.rs (6 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/at_rule/value.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/css_modules.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/mod.rs (3 hunks)
  • crates/biome_css_parser/src/syntax/property/mod.rs (1 hunks)
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (2 hunks)
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs (2 hunks)
  • crates/biome_css_syntax/src/file_source.rs (4 hunks)
💤 Files with no reviewable changes (5)
  • crates/biome_analyze/src/options.rs
  • crates/biome_analyze/src/context.rs
  • crates/biome_analyze/src/registry.rs
  • crates/biome_analyze/src/signals.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.options.json
🚧 Files skipped from review as they are similar to previous changes (16)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_cli/tests/cases/handle_astro_files.rs
  • crates/biome_css_parser/src/lexer/mod.rs
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/mod.rs
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/at_rule/keyframes.rs
  • crates/biome_cli/tests/cases/handle_vue_files.rs
  • crates/biome_css_parser/src/lib.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_parser/src/syntax/css_modules.rs
  • crates/biome_css_parser/src/syntax/property/mod.rs
  • .changeset/plenty-hornets-hide.md
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
  • crates/biome_css_syntax/src/file_source.rs
  • crates/biome_css_parser/src/syntax/at_rule/value.rs
🧰 Additional context used
📓 Path-based instructions (2)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/odd-flies-nail.md
  • .changeset/angry-women-accept.md
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_configuration/src/css.rs
🧠 Learnings (28)
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Create a changeset for user-facing bug fixes and features using `just new-changeset`, selecting appropriate packages and change type (`major`, `minor`, or `patch`)

Applied to files:

  • .changeset/odd-flies-nail.md
  • .changeset/angry-women-accept.md
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to .changeset/*.md : Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Applied to files:

  • .changeset/odd-flies-nail.md
  • .changeset/angry-women-accept.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 `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported

Applied to files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 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 : Parse rules must return `ParsedSyntax::Absent` if the rule can't predict by the next token(s) if they form the expected node, and must not progress the parser in this case

Applied to files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `info` or `warn` for rules in style group

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_configuration/src/css.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_configuration/src/css.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` field in `declare_lint_rule!` macro to the language the rule primarily applies to

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Check if a variable is global using the semantic model to avoid false positives

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks must have a language defined for syntax highlighting

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • crates/biome_cli/tests/cases/handle_svelte_files.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_css_parser/src/parser.rs
  • crates/biome_configuration/src/css.rs
📚 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 : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `deny_unknown_fields` in serde derive macro for rule options

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 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/**/language_kind.rs : Add a new variant to `LanguageKind` enum in `language_kind.rs` file and implement all methods for the new language variant

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `Box<[T]>` instead of `Vec<T>` for rule options arrays to save memory

Applied to files:

  • crates/biome_css_parser/src/parser.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_configuration/src/css.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_configuration/src/css.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation must include `## Options` section if the rule has options

Applied to files:

  • crates/biome_configuration/src/css.rs
📚 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/**/*.ungram : Add a legend comment to `.ungram` files explaining the grammar syntax including comments, non-terminals, tokens, sequences, alternations, repetitions, and optional elements

Applied to files:

  • crates/biome_configuration/src/css.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_configuration/src/css.rs
📚 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/angry-women-accept.md
🧬 Code graph analysis (1)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (3)
crates/biome_css_parser/src/syntax/css_modules.rs (2)
  • local_or_global_not_allowed (18-26)
  • slotted_or_deep_not_allowed (30-36)
crates/biome_css_parser/src/syntax/parse_error.rs (1)
  • expected_selector (58-60)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_regular_identifier (451-453)
🪛 LanguageTool
.changeset/angry-women-accept.md

[style] ~5-~5: As a shorter alternative for ‘able to’, consider using “can now”.
Context: ...biome": minor --- The Biome CSS parser is now able to parse Vue SFC syntax such as :slotted...

(BE_ABLE_TO)


[misspelling] ~5-~5: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ....vue` components. Otherwise, Biome will a emit a parse error. This capability is...

(EN_A_VS_AN)

⏰ 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: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
🔇 Additional comments (7)
crates/biome_cli/tests/cases/handle_svelte_files.rs (1)

242-244: Test fixture update looks good.

The :global(div) addition properly exercises CSS Modules parsing in Svelte files with the experimental flag enabled.

crates/biome_css_parser/src/parser.rs (2)

43-51: Excellent enum design.

The CssModulesKind enum cleanly distinguishes between Classic (:local, :global) and Vue-enhanced (adds :deep, :slotted) CSS Modules, with sensible defaults.


93-102: Helper methods implemented correctly.

The is_css_modules_enabled and is_css_modules_vue_enabled methods provide clear, type-safe checks for the different CSS Modules modes.

crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (4)

2-17: LGTM!

The imports correctly bring in the Vue-enhanced sets and error handlers needed for the new functionality.


29-32: LGTM!

The new Vue selector check mirrors the existing CSS Modules pattern and integrates cleanly.


50-66: LGTM!

The refactored logic correctly branches between CSS Modules and Vue contexts with appropriate feature flags and error handlers. Properly returns Absent when neither condition matches.


68-90: LGTM!

The extracted helper cleanly handles the shared parsing logic for both CSS Modules and Vue pseudo-selectors, with proper error recovery.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (1)

32-46: Update documentation to reflect Vue selector support.

The function now also parses Vue-enhanced pseudo-classes (:slotted, :deep) in addition to CSS Modules selectors (:local, :global), but the documentation and examples only mention the latter. Please update to reflect the expanded functionality.

As per coding guidelines, inline rustdoc should be updated when changing features.

♻️ Duplicate comments (2)
.changeset/odd-flies-nail.md (1)

5-17: Clarify the scenario and remove the unnecessary comma.

Line 7's comma before "because" is redundant—the clause is essential. More importantly, the scenario is unclear: the condition "if your codebase has only *.module.css files" doesn't explain why users would change their configuration. Rewrite to clarify that Biome now automatically enables CSS modules parsing for *.module.css files, so users who previously set cssModules: true manually can now remove that configuration. The diff should either remove the entire parser block or show the explicit disable option ("cssModules": false) for those who need it.

crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (1)

19-19: Documentation mismatch remains on line 19.

Line 19 still mentions "and SFC Vue" but this function only checks CSS_MODULES_SCOPE_SET (:local and :global). Vue selectors are checked separately by is_at_vue_pseudo_class_function_selector. Remove "and SFC Vue" from line 19.

🧹 Nitpick comments (1)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (1)

66-88: Consider adding a brief comment for the helper.

The logic is clear, but a one-line comment explaining that this helper parses the common structure <identifier>(<selector>) for both CSS Modules and Vue pseudo-classes would aid future maintainers.

📜 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 e874191 and 82a1e5e.

📒 Files selected for processing (3)
  • .changeset/odd-flies-nail.md (1 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs (3 hunks)
  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_element.rs
🧰 Additional context used
📓 Path-based instructions (2)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/odd-flies-nail.md
🧠 Learnings (4)
📚 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 `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported

Applied to files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 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 : Parse rules must return `ParsedSyntax::Absent` if the rule can't predict by the next token(s) if they form the expected node, and must not progress the parser in this case

Applied to files:

  • crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Create a changeset for user-facing bug fixes and features using `just new-changeset`, selecting appropriate packages and change type (`major`, `minor`, or `patch`)

Applied to files:

  • .changeset/odd-flies-nail.md
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to .changeset/*.md : Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Applied to files:

  • .changeset/odd-flies-nail.md
🧬 Code graph analysis (1)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (3)
crates/biome_css_parser/src/syntax/css_modules.rs (2)
  • local_or_global_not_allowed (18-26)
  • slotted_or_deep_not_allowed (30-36)
crates/biome_css_parser/src/syntax/parse_error.rs (1)
  • expected_selector (58-60)
crates/biome_css_parser/src/syntax/mod.rs (1)
  • parse_regular_identifier (451-453)
🪛 LanguageTool
.changeset/odd-flies-nail.md

[formatting] ~7-~7: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...can remove the parser feature as follows, because now Biome does it for you: ```diff { ...

(COMMA_BEFORE_BECAUSE)

⏰ 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). (5)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_css_parser)
🔇 Additional comments (4)
crates/biome_css_parser/src/syntax/selector/pseudo_class/function_selector.rs (4)

2-5: LGTM: Import changes support Vue-enhanced parsing.

The additional imports for Vue-specific constants and error handling are consistent with the existing CSS Modules pattern.


11-11: LGTM: Feature imports enable the refactored parsing pattern.

Also applies to: 17-17


27-30: LGTM: Vue-specific selector detection is correctly implemented.

The new helper mirrors the pattern of is_at_pseudo_class_function_selector and correctly checks for Vue-enhanced pseudo-classes.


48-64: LGTM: Feature-flag refactoring is well-structured.

The refactored implementation correctly uses parse_exclusive_syntax to handle both CSS Modules and Vue-enhanced selectors with appropriate context-specific error messages. The logic properly returns Absent when neither condition is met, adhering to parser best practices.

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: 1

📜 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 82a1e5e and 2cf0ca1.

📒 Files selected for processing (9)
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs (2 hunks)
  • crates/biome_css_analyze/tests/spec_tests.rs (3 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json (1 hunks)
  • crates/biome_css_parser/src/parser.rs (6 hunks)
  • crates/biome_module_graph/tests/spec_tests.rs (38 hunks)
  • crates/biome_ruledoc_utils/src/codeblock.rs (2 hunks)
  • crates/biome_ruledoc_utils/src/lib.rs (2 hunks)
  • crates/biome_test_utils/src/lib.rs (3 hunks)
  • xtask/rules_check/src/lib.rs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_css_analyze/src/lint/style/no_value_at_rule.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
🧰 Additional context used
📓 Path-based instructions (1)
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_css_parser/src/parser.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_ruledoc_utils/src/codeblock.rs
  • crates/biome_test_utils/src/lib.rs
🧠 Learnings (63)
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : No module may copy or clone data from another module in the module graph, not even behind an `Arc`

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Store type data in linear vectors instead of using recursive data structures with `Arc` for improved data locality and performance

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/js_module_info/collector.rs : Implement module-level (thin) inference to resolve `TypeReference::Qualifier` variants by looking up declarations in module scopes and handling import statements

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/scoped_resolver.rs : Implement full inference to resolve `TypeReference::Import` variants across the entire module graph

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use generic rule names if the rule could potentially be implemented for multiple languages

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Check if a variable is global using the semantic model to avoid false positives

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `full_options` code block property for complete biome.json configuration snippets in documentation

Applied to files:

  • crates/biome_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
  • crates/biome_ruledoc_utils/src/codeblock.rs
  • crates/biome_test_utils/src/lib.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_ruledoc_utils/src/lib.rs
  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_css_parser/src/parser.rs
  • crates/biome_test_utils/src/lib.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/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.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: Create test infrastructure with `tests/specs` folder structure and `spec_test.rs`, `spec_tests.rs`, and `language.rs` files in test directories

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use helper functions like `map`, `filter`, and `and_then` to avoid deep indentation

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.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/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.rs
  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_module_graph/tests/spec_tests.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/tests/specs/**/options.json : Create an `options.json` file (formatted as `biome.json`) in test specification folders to apply non-default formatting options to all test files in that folder

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*valid* : Create test files prefixed with `valid` for code that should not trigger the rule

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/tests/specs/**/*invalid* : Create test files prefixed with `invalid` for code that should trigger the rule

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `file=<path>` property for multi-file rule documentation examples

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `options` code block property for rule-specific configuration snippets in documentation

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
  • crates/biome_ruledoc_utils/src/codeblock.rs
  • crates/biome_test_utils/src/lib.rs
📚 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:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ignore` code block property to exclude documentation code examples from automatic validation

Applied to files:

  • crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Lines prefixed with `#` in rule documentation code examples will be hidden from output

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : The first paragraph of rule documentation must be a single line describing what the rule does

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use language-specific rule names if the rule is meant for a specific language only

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `domains` field in `declare_lint_rule!` to tag rules that belong to specific concepts like testing or frameworks

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement custom Visitor by implementing the Visitor trait for complex rule logic

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Place new rules inside the `nursery` group during development

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set rule severity to `error` for rules in correctness, security, and a11y groups

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions

Applied to files:

  • xtask/rules_check/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Rule documentation code blocks must have a language defined for syntax highlighting

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.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_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `use_options` code block property for code examples that follow an options configuration in documentation

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 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 `p.eat(token)` for optional tokens, `p.expect(token)` for required tokens, `parse_rule(p).ok(p)` for optional nodes, and `parse_rule(p).or_add_diagnostic(p, error)` for required nodes

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Invalid code examples in rule documentation must be marked with `expect_diagnostic` code block property

Applied to files:

  • crates/biome_ruledoc_utils/src/codeblock.rs
📚 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 : A parser struct must implement the `Parser` trait and save the token source, parser context, and optional parser options

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 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: Create two new crates `biome_{language}_syntax` and `biome_{language}_factory` using `cargo new --lib` for new language parsers

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 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/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 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_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Ensure the type implementing Diagnostic derives Debug

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Implement the Diagnostic trait on types, or use the #[derive(Diagnostic)] procedural macro to implement the trait. Configure category, severity, description, message, location, and tags using the #[diagnostic] attribute

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use #[derive(Diagnostic)] on enums when every variant contains a type that is itself a diagnostic

Applied to files:

  • crates/biome_test_utils/src/lib.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 : Use the `dbg_write!` macro to debug formatter output instead of other logging methods

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : Register all new diagnostic categories in crates/biome_diagnostics_categories/src/categories.rs

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Fields with #[advice] or #[verbose_advice] attributes must implement the Advices trait to record advices on the diagnostic

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Each invalid code example in rule documentation must emit exactly one diagnostic

Applied to files:

  • crates/biome_test_utils/src/lib.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Return `Option<State>` from `run` function for single diagnostic signals

Applied to files:

  • crates/biome_test_utils/src/lib.rs
🧬 Code graph analysis (4)
crates/biome_ruledoc_utils/src/lib.rs (1)
crates/biome_test_utils/src/lib.rs (1)
  • get_added_js_paths (260-286)
crates/biome_module_graph/tests/spec_tests.rs (1)
crates/biome_test_utils/src/lib.rs (1)
  • get_added_js_paths (260-286)
crates/biome_ruledoc_utils/src/codeblock.rs (1)
crates/biome_service/src/file_handlers/mod.rs (2)
  • from_extension (210-212)
  • from_path (286-288)
crates/biome_test_utils/src/lib.rs (1)
crates/biome_service/src/file_handlers/mod.rs (1)
  • from_path (286-288)
⏰ 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). (13)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Bench (biome_module_graph)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
🔇 Additional comments (11)
crates/biome_css_parser/src/parser.rs (3)

43-51: LGTM!

Clean enum definition with clear variant documentation distinguishing Classic (:local/:global) from Vue (adds :deep/:slotted). The derives are appropriate.


93-102: LGTM!

The helper methods correctly distinguish between "any CSS modules enabled" (Classic or Vue) and "Vue-specific features enabled". Clean implementation using matches!.


204-206: LGTM!

Correctly maps CSS modules detection to CssModulesKind::Classic. The conversion logic is sound.

crates/biome_css_analyze/tests/specs/correctness/noUnknownProperty/valid.tailwind.options.json (1)

1-8: The schema path doesn't resolve in the repository, but this matches the pattern used in other test files at the same depth (e.g., valid_with_ignore.options.json). The schema file itself doesn't exist in packages/@biomejs/biome/, suggesting it's either generated during the build process or sourced externally. This appears to be a pre-existing pattern rather than an issue unique to this file.

crates/biome_ruledoc_utils/src/codeblock.rs (1)

102-107: LGTM! Path-based resolution enables proper CSS modules detection.

This correctly leverages the full file path (e.g., *.module.css) when available, falling back to extension-based resolution otherwise. Clean implementation using map_or_else.

xtask/rules_check/src/lib.rs (2)

399-400: Clean refactor: Parser options now derived from file source.

Using CssParserOptions::from(&file_source) is more maintainable than manually chaining .allow_css_modules().allow_tailwind_directives(), as the file source now carries all necessary context.


198-202: Rulе registry validation is limited to CSS only—clarify intent.

Only biome_css_analyze::visit_registry() is active; JS, JSON, GraphQL, and HTML rule documentation validation is disabled. Add a comment explaining whether this is temporary focus for this PR or a deliberate change.

crates/biome_ruledoc_utils/src/lib.rs (1)

13-13: LGTM! Consistent with the renamed helper in biome_test_utils.

The rename to get_added_js_paths makes the function's purpose clearer — it specifically filters and parses JavaScript-like files.

Also applies to: 83-84

crates/biome_module_graph/tests/spec_tests.rs (1)

23-23: LGTM! Mechanical rename applied consistently across all tests.

All 38 call sites updated from get_added_paths to get_added_js_paths. The tests correctly use this helper for JavaScript/TypeScript module graph resolution.

crates/biome_test_utils/src/lib.rs (2)

137-183: New utility function looks good, minor clarity suggestion.

Solid implementation that mirrors the pattern used in create_formatting_options. One small note: Line 164 returns Default::default() which evaluates to None for Option<T>, matching the early return on line 142. This works but could be more explicit.

Optional: Make the error-path return explicit
         );

-        Default::default()
+        None
     } else {

260-286: LGTM! Rename with explicit JS filtering.

The function now clearly communicates its purpose: it filters for JavaScript-like files and parses them. The explicit DocumentFileSource::Js pattern match (lines 267-271) makes the filtering behaviour obvious.

@ematipico ematipico merged commit ab88099 into next Dec 20, 2025
19 checks passed
@ematipico ematipico deleted the feat/embedded-css branch December 20, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Linter Area: linter A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools L-CSS Language: CSS L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants