-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
📎 Port selector-class-pattern
from stylelint-stylistic
#5004
Comments
selector-class-pattern
from stylelintselector-class-pattern
from stylelint-stylistic
On this, please consider native CSS features like nesting syntax (already supported by all major browsers) or custom selectors (which reached STAGE 1 last year and we may see it shipped this year). Also this rule may interact with @custom-selector :--headings h1, h2, h3, h4, h5, h6;
@custom-selector :--blocks .MyStack, .MyBox;
:global {
/* ↑ Ignored */
.class-blue {}
/* ↑ Not a valid selector */
:local(.class-blue) {}
/* ↑ Ignored ↑ Not valid selector */
:--headings, :--blocks {
/* ↑ Ignored selectors */
margin-block: 10dvh;
}
:local(.MyComponent) {
/* ↑ Ignored ↑ Valid selector */
color: red;
}
:global(.MyNewClass) {
/* ↑ Ignored ↑ Valid selector */
color: red;
}
.MyClass {
/* ↑ Valid selector */
color: red;
}
} |
What do you think about using In This is an important limitation that users should be aware of. Simply, we can't use regular expressions coming from JS because they are different from the ones we can use in Rust. However, that's fine because the engine we use in I don't think this rule is beginner-friendly. |
That's a good point. Sure, let's use the name |
Description
Add a new CSS lint rule implementing the same functionality as
selector-class-pattern
from stylelint-stylistic. Add an option to be able to specify a regex to match against. We don't usually add options on the first iteration of a new rule, but this is an exception since the functionality of the rule does not work without it.Source: https://stylelint.io/user-guide/rules/selector-class-pattern/
Suggested name:
useNamingConvention
Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.
The text was updated successfully, but these errors were encountered: