selector-max-attribute
What it does
Section titled “What it does”Reports a selector with more attribute selectors than the max option.
Why it matters
Section titled “Why it matters”Each attribute selector adds the specificity of a class and one more thing to match, so a limit keeps rules short and easy to override.
Example
Section titled “Example”.a.b.c, #x #y, a b c d, [p][q], * *, a:hover:focus { color: red }....i {...Configuration
Section titled “Configuration”css: lint: rules: selector-max-attribute: level: warn # off (default), warn, error options: max: 0less: lint: rules: selector-max-attribute: level: warn # off (default), warn, error options: max: 0scss: lint: rules: selector-max-attribute: level: warn # off (default), warn, error options: max: 0| Option | Type | Default | Description |
|---|---|---|---|
max |
int | 0 |
The most attribute selectors a selector may have. |
Suppress one line with sudsy-disable-next-line selector-max-attribute in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | selector-max-attribute |
full |