Skip to content

property-allowed-list

Reports a property that is not in the list option (names, or /regex/). Custom properties are not reported, and an empty list allows everything.

A project can limit the properties its styles use, for example to a design system’s set, so a one-off property fails in review rather than later in the browser. The rule is a policy: with no list it reports nothing.

With this configuration:

property-allowed-list: { level: warn, options: { list: [color, "/^wid/"] } }
unit-allowed-list: { level: warn, options: { list: [px, em] } }
function-allowed-list: { level: warn, options: { list: [var] } }
at-rule-allowed-list: { level: warn, options: { list: [media] } }
media-feature-name-allowed-list: { level: warn, options: { list: [max-width] } }
selector-pseudo-class-allowed-list: { level: warn, options: { list: [focus] } }
selector-pseudo-element-allowed-list: { level: warn, options: { list: [after] } }
selector-combinator-allowed-list: { level: warn, options: { list: [" "] } }
selector-attribute-operator-allowed-list: { level: warn, options: { list: ["="] } }
Reported
...
a:hover::before > b { color: red; float: left; width: calc(1px + 2em); height: 1rem }
}
css:
lint:
rules:
property-allowed-list:
level: warn # off (default), warn, error
options:
list: []
less:
lint:
rules:
property-allowed-list:
level: warn # off (default), warn, error
options:
list: []
scss:
lint:
rules:
property-allowed-list:
level: warn # off (default), warn, error
options:
list: []
Option Type Default Description
list list [] The allowed properties: names, or /regex/.

Suppress one line with sudsy-disable-next-line property-allowed-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 property-allowed-list full