Skip to main content

property-allowed-list

指定允许的属性列表。

¥Specify a list of allowed properties.

a { color: red; }
/** ↑

* This property */

此规则忽略预处理器变量(例如 $sass@less)。

¥This rule ignores preprocessor variables (e.g. $sass, @less).

message 次要选项 可以接受该规则的参数。

¥The message secondary option can accept the arguments of this rule.

选项

¥Options

Array<string>

["array", "of", "properties", "/regex/"]

鉴于:

¥Given:

{
"property-allowed-list": ["display", "animation", "/^background/", "--foo"]
}

以下模式被视为问题:

¥The following patterns are considered problems:

a { color: red; }
a {
animation: my-animation 2s;
color: red;
}
a { borkgrund: orange; }
a { --bar: red; }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { display: block; }
a { -webkit-animation: my-animation 2s; }
a {
animation: my-animation 2s;
-webkit-animation: my-animation 2s;
display: block;
}
a { background: red; }
a { background-color: red; }
a { --foo: red; }