Skip to content

Conversation

@denbezrukov
Copy link
Contributor

Summary

Fix (#6981)

Test Plan

new tests

@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2025

🦋 Changeset detected

Latest commit: 3c6b0eb

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

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

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

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

@github-actions github-actions bot added A-Linter Area: linter L-CSS Language: CSS labels Oct 5, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 5, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds CSS Modules awareness to the NoUnknownPseudoClass lint: introduces a new CSS_MODULE_PSEUDO_CLASSES constant (["global", "local"]) and a public helper is_css_module_pseudo_class. The lint now accepts these pseudo-classes when CSS Modules are enabled, replacing prior special-casing for :global. Test harness initialization was moved earlier to enable CSS Modules before parsing, and tests were extended with :local cases. A changeset entry documents a patch release fixing issue #6981.

Suggested labels

A-Parser

Suggested reviewers

  • dyc3

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarises the main change by specifying the module affected (css_analyze), the specific pseudo-class 'local', and the NoUnknownPseudoClass rule along with the issue number, making it concise, descriptive, and directly related to the changeset.
Description Check ✅ Passed The description identifies the fix for issue #6981 and notes that new tests were added, which aligns with the changes made to support CSS Modules pseudo-classes in the NoUnknownPseudoClass rule.

📜 Recent 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 552134e and 3c6b0eb.

📒 Files selected for processing (1)
  • .changeset/big-pans-begin.md (1 hunks)

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

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 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 efc9980 and 5150705.

⛔ Files ignored due to path filters (1)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • .changeset/big-pans-begin.md (1 hunks)
  • crates/biome_css_analyze/src/keywords.rs (1 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (3 hunks)
  • crates/biome_css_analyze/src/utils.rs (2 hunks)
  • crates/biome_css_analyze/tests/spec_tests.rs (1 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_css_analyze/tests/spec_tests.rs
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css
.changeset/**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/big-pans-begin.md
🧬 Code graph analysis (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (2)
crates/biome_css_analyze/src/utils.rs (1)
  • is_css_module_pseudo_class (152-154)
crates/biome_analyze/src/context.rs (1)
  • is_css_modules (190-192)
⏰ 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). (11)
  • GitHub Check: autofix
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 5, 2025

CodSpeed Performance Report

Merging #7685 will not alter performance

Comparing dbezrukov/6981 (3c6b0eb) with main (efc9980)

Summary

✅ 29 untouched
⏩ 111 skipped1

Footnotes

  1. 111 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (1)

180-180: Consider optional parentheses for clarity.

The validation logic is correct and the operator precedence is sound (&& binds tighter than ||). However, explicit parentheses might improve readability at a glance:

-        if is_valid_class || is_css_modules && is_css_module_pseudo_class(lower_name) {
+        if is_valid_class || (is_css_modules && is_css_module_pseudo_class(lower_name)) {
📜 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 811efaf and ef6959c.

⛔ Files ignored due to path filters (1)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • .changeset/big-pans-begin.md (1 hunks)
  • crates/biome_css_analyze/src/keywords.rs (1 hunks)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (3 hunks)
  • crates/biome_css_analyze/src/utils.rs (2 hunks)
  • crates/biome_css_analyze/tests/spec_tests.rs (1 hunks)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/big-pans-begin.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css
  • crates/biome_css_analyze/src/keywords.rs
  • crates/biome_css_analyze/tests/spec_tests.rs
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_css_analyze/src/utils.rs
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
🧬 Code graph analysis (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (2)
crates/biome_css_analyze/src/utils.rs (1)
  • is_css_module_pseudo_class (152-154)
crates/biome_analyze/src/context.rs (1)
  • is_css_modules (190-192)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_css_parser)
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
🔇 Additional comments (3)
crates/biome_css_analyze/src/utils.rs (1)

145-154: LGTM! Well-documented helper function.

The implementation is clean, follows the existing pattern of other predicates in this file, and includes proper rustdoc with a reference link. The binary search approach is efficient.

crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (2)

3-6: LGTM! Import updated correctly.

The new helper is imported alongside existing utilities. Clean addition.


149-149: LGTM! Properly retrieves CSS modules flag.

Correctly obtains the CSS modules configuration from the rule context.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (1)

180-180: Logic is correct.

The validation properly accepts CSS module pseudo-classes (:global, :local) when CSS modules are enabled, whilst falling back to standard validation otherwise.

For improved readability, consider adding explicit parentheses to make the operator precedence clearer:

-        if is_valid_class || is_css_modules && is_css_module_pseudo_class(lower_name) {
+        if is_valid_class || (is_css_modules && is_css_module_pseudo_class(lower_name)) {
📜 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 ef6959c and 552134e.

📒 Files selected for processing (1)
  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs
🧬 Code graph analysis (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (2)
crates/biome_css_analyze/src/utils.rs (1)
  • is_css_module_pseudo_class (152-154)
crates/biome_analyze/src/context.rs (1)
  • is_css_modules (190-192)
⏰ 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). (10)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_css_analyze)
  • GitHub Check: Bench (biome_css_formatter)
  • GitHub Check: Bench (biome_css_parser)
🔇 Additional comments (1)
crates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rs (1)

3-6: LGTM!

The import of is_css_module_pseudo_class is correctly added and alphabetically sorted with the other utils imports.

@ematipico ematipico merged commit 52071f5 into main Oct 6, 2025
15 checks passed
@ematipico ematipico deleted the dbezrukov/6981 branch October 6, 2025 05:43
@github-actions github-actions bot mentioned this pull request Oct 6, 2025
cadunass pushed a commit to cadunass/biome that referenced this pull request Oct 9, 2025
…nPseudoClass rule (biomejs#6981) (biomejs#7685)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <[email protected]>
andogq pushed a commit to andogq/biome that referenced this pull request Oct 14, 2025
…nPseudoClass rule (biomejs#6981) (biomejs#7685)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-CSS Language: CSS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants