Skip to content

Latest commit

 

History

History
115 lines (82 loc) · 1.52 KB

File metadata and controls

115 lines (82 loc) · 1.52 KB

selector-disallowed-list

Specify a list of disallowed selectors.

    .foo > .bar
/** ↑
 * This is selector */

Options

array|string|regexp: ["array", "of", "selectors", /or/, "/regex/"]|"selector"|"/regex/"|/regex/

If a string is surrounded with "/" (e.g. "/\.foo/"), it is interpreted as a regular expression.

Given:

["a > .foo", "/\\[data-.+]/"]

The following patterns are considered problems:

a > .foo {}
a[data-auto="1"] {}
.foo, [data-auto="1"] {}

The following patterns are not considered problems:

.foo {}
a
>
.foo {}
.bar > a > .foo {}
.data-auto {}
a[href] {}

Optional secondary options

splitList: true | false (default: false)

Iterate through each individual selector in a selector list.

For example, with true.

Given:

[".foo"]

The following pattern is considered a problem:

.bar, .foo {}

The following pattern is not considered a problem:

.bar .foo {}

ignore: ["inside-block"]

Ignore selectors that are inside a block.

Given:

[".foo"]

The following pattern is not considered a problem:

.bar {
  .foo {}
}