Skip to content

selector-attribute-operator-disallowed-list

Reports an attribute selector operator that is in the list option.

A project can forbid an operator, such as *=, whose substring match is easy to misread or slow. 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-attribute-operator-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
less:
lint:
rules:
selector-attribute-operator-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
scss:
lint:
rules:
selector-attribute-operator-disallowed-list:
level: warn # off (default), warn, error
options:
list: []
Option Type Default Description
list list [] The disallowed operators (=, ~=, |=, ^=, $=, *=).

Suppress one line with sudsy-disable-next-line selector-attribute-operator-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-attribute-operator-disallowed-list full