-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
feat(biome_css_analyzer): noUnknownUnit #2535
Conversation
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.
I have brought stylelint
tests (link). However, root { --margin: 10px + 10pix; }
was not added because the syntax seems incorrect.
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.
I have brought stylelint
tests (link). However, @font-face { unicode-range: U+0100-024F; }
was not added because this F
is parsed as an unknown unit.
1a149ce
to
ba1aef2
Compare
CodSpeed Performance ReportMerging #2535 will improve performances by 34.29%Comparing Summary
Benchmarks breakdown
|
Sorry. I wasn't sure how to add elements to |
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.
I don't think we need the options for the time being. We can evaluate some options if some users actually need them.
const RESOLUTION_MEDIA_FEATURE_NAMES: [&str; 3] = | ||
["resolution", "min-resolution", "max-resolution"]; | ||
|
||
fn is_css_hack_unit(value: &str) -> bool { |
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.
Can you please document what this hack is for and why it exists?
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.
I have added a description of the function and the reason for using this function where it's called.
Understood. I will not add the options for now. (Implementing these options, which in |
crates/biome_css_analyze/tests/specs/nursery/noUnknownUnit/invalid.css.snap.new
Outdated
Show resolved
Hide resolved
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.
Thank you!
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.
Awesome!
Can you add a table for all the rules that are being implemented? |
The only options implemented in Therefore, the table will look as follows:
|
@neokidev Sorry I meant a centralised table for all rules so that users can easily tell what's the implementation status of the rules. The details as to why the rules are partially implemented can be added later on. |
@Mouvedia we don't have a place for that, with so much granularity. The best we can provide is:
|
Summary
close #2515
Implement unit-no-unknown
However, the
stylelint
optionsignoreUnits
andignoreFunctions
are not implemented.Test Plan
added tests and snapshots