Skip to main content

selector-attribute-name-disallowed-list

指定不允许的属性名称列表。

¥Specify a list of disallowed attribute names.

    [class~="foo"] {}
/** ↑

* This name */

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

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

选项

¥Options

Array<string>

["array", "of", "attribute-names", "/regex/"]

鉴于:

¥Given:

{
"selector-attribute-name-disallowed-list": ["class", "id", "/^data-/"]
}

以下模式被视为问题:

¥The following patterns are considered problems:

[class*="foo"] {}
[id~="bar"] {}
[data-foo*="bar"] {}

以下模式不被视为问题:

¥The following patterns are not considered problems:

[lang~="en-us"] {}
[target="_blank"] {}
[href$=".bar"] {}