Skip to content

selector-disallowed-list

Reports a rule whose selector list, with whitespace collapsed, is in the list option (selectors, or /regex/).

A project can forbid selectors that cause trouble, such as * or a bare element, which restyle everything. The rule is a policy: with no list it reports nothing.

Reported
ul.nav, a[x~=y], a[x=y], b > c {}
css:
lint:
rules:
selector-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
less:
lint:
rules:
selector-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
scss:
lint:
rules:
selector-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
Option Type Default Description
list list [] The disallowed selectors: text, or /regex/.

Suppress one line with sudsy-disable-next-line selector-disallowed-list in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint selector-disallowed-list full