selector-no-deprecated
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesssuspiciousno fixdefault: offcss/stylelint-recommended
What it does
Section titled “What it does”Reports a deprecated pseudo-class, pseudo-element or HTML or SVG element used as a type selector (center {}).
Why it matters
Section titled “Why it matters”A deprecated selector targets something that the standard removed, so it matches less and less over time, and browsers may drop it.
To fix, use the replacement named in the specification.
Example
Section titled “Example”...center, a:matches(b), a::content, b {}Configuration
Section titled “Configuration”css: lint: rules: selector-no-deprecated: level: warn # off (default), warn, error options: ignore: []less: lint: rules: selector-no-deprecated: level: warn # off (default), warn, error options: ignore: []scss: lint: rules: selector-no-deprecated: level: warn # off (default), warn, error options: ignore: []| Option | Type | Default | Description |
|---|---|---|---|
ignore |
list | [] |
Names left out: names, or /regex/. |
Enabled by the presets: css/stylelint-recommended.
Suppress one line with sudsy-disable-next-line selector-no-deprecated 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-no-deprecated |
full |