selector-type-no-unknown
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesscorrectnessno fixdefault: offcss/stylelint-recommended
What it does
Section titled “What it does”Reports a type selector that is not an HTML, SVG or MathML element; custom elements are accepted. Keyframe selectors and the arguments of :lang(), :nth-child() and the like are not reported.
Why it matters
Section titled “Why it matters”An unknown type selector never matches, so the rule does nothing. It is almost always a typo (dvi) or a class that lost its dot.
To fix, correct the name or add the missing . or #.
Example
Section titled “Example”...a { background: image-set(url("a.png") 1x); margin: 1PX 2% 1e3em }...foo, div, b::slotted(x-y), svg > circle {}::-webkit-scrollbar-thumb:horizontal {}...@page :first { margin: 1cm }...Configuration
Section titled “Configuration”css: lint: rules: selector-type-no-unknown: level: warn # off (default), warn, error options: ignore: []less: lint: rules: selector-type-no-unknown: level: warn # off (default), warn, error options: ignore: []scss: lint: rules: selector-type-no-unknown: 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-type-no-unknown 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-type-no-unknown |
full |