Repository navigation
fix: handle var() and env() in no-invalid-at-rules - #570
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change replaces ChangesUnsupported matching-tree handling
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
DMartens
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks. Leaving open for others to review.
Prerequisites checklist
AI acknowledgment
What did you do?
What did you expect to happen?
No lint error. The prelude is valid, and the lexer does not support matching values containing
env()orvar(), so the rule should skip them, asno-invalid-propertiesalready does forenv().What actually happened?
The rule crashed:
What is the purpose of this pull request?
This PR makes
no-invalid-at-rulesskip preludes and descriptor values containingvar()orenv(), so they no longer crash the rule or get reported as unknown descriptors.What changes did you make? (Give an overview)
no-invalid-at-rulesnow returns early when the lexer reports it cannot match a prelude or descriptor value containingvar()orenv().isEnvMatchError, which compared CSSTree's message text and only coveredenv(), withisUnsupportedMatchingTreeError, which checks the error'snameand covers both functions.no-invalid-propertiesnow uses it.Related Issues
refs #532 (its
@supports env(safe-area-inset-top) {}test case crashes without this fix)Is there anything you'd like reviewers to focus on?
Summary by CodeRabbit
Bug Fixes
var()and user-agentenv()values in at-rule conditions and descriptors without reporting false errors.Tests
var()andenv()usage in@supportsconditions and@pagedescriptors.