-
-
Notifications
You must be signed in to change notification settings - Fork 373
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): implement noUnknownTypeSelector #2871
base: main
Are you sure you want to change the base?
feat(biome_css_analyzer): implement noUnknownTypeSelector #2871
Conversation
e64097d
to
1ab268f
Compare
CodSpeed Performance ReportMerging #2871 will not alter performanceComparing Summary
|
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!
version: "next", | ||
name: "noUnknownTypeSelector", | ||
language: "css", | ||
recommended: false, |
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.
recommended: false, | |
recommended: true, | |
sources: &[RuleSource::Stylelint("selector-type-no-unknown")], |
.note(markup! { | ||
"See "<Hyperlink href="https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors">"MDN web docs"</Hyperlink>" for more details." | ||
}).note(markup! { | ||
"To resolve this issue, replace the unknown type selector with valid one." |
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.
"To resolve this issue, replace the unknown type selector with valid one." | |
"Consider replacing the unknown type selector with valid one." |
fn is_custom_element(prop: &str) -> bool { | ||
prop.contains('-') && prop.eq(prop.to_lowercase().as_str()) | ||
} |
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.
You should define this outside of the function.
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.
There are a lot of missing ones.
e.g. nobr
, model
, strike
, glyphRef
, etc.
check https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-type-no-unknown/index.mjs#L94-L97 and https://github.com/stylelint/stylelint/blob/main/lib/reference/selectors.mjs#L47
Closes #2543
Summary
implements selector-type-no-unknown
Test Plan
Add snapshots.