-
-
Notifications
You must be signed in to change notification settings - Fork 760
fix(css_analyze): handle CSS Modules pseudo-class 'local' in NoUnknownPseudoClass rule (#6981) #7685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 3c6b0eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
|
Caution Review failedThe pull request is closed. WalkthroughAdds CSS Modules awareness to the NoUnknownPseudoClass lint: introduces a new Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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. Comment |
There was a problem hiding this 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
⛔ Files ignored due to path filters (1)
crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css.snapis excluded by!**/*.snapand 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.rscrates/biome_css_analyze/src/keywords.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rscrates/biome_css_analyze/tests/spec_tests.rscrates/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.rscrates/biome_css_analyze/src/keywords.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rscrates/biome_css_analyze/tests/spec_tests.rscrates/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.rscrates/biome_css_analyze/src/keywords.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rscrates/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.rscrates/biome_css_analyze/src/keywords.rscrates/biome_css_analyze/src/lint/correctness/no_unknown_pseudo_class.rscrates/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.rscrates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css
.changeset/**/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/**/*.md: Create changesets using thejust new-changesetcommand; 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 Performance ReportMerging #7685 will not alter performanceComparing Summary
Footnotes
|
…nPseudoClass rule (#6981)
811efaf to
ef6959c
Compare
There was a problem hiding this 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
⛔ Files ignored due to path filters (1)
crates/biome_css_analyze/tests/specs/correctness/noUnknownPseudoClass/validGlobal.css.snapis excluded by!**/*.snapand 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.rscrates/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.rscrates/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.rscrates/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.rscrates/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.
There was a problem hiding this 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
📒 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_classis correctly added and alphabetically sorted with the other utils imports.
…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]>
…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]>
Summary
Fix (#6981)
Test Plan
new tests