#selector-no-type

Disallow type selectors.

禁用类型选择器。

    a {}
/** ↑
 * This type of selector */

#Options

#true

The following patterns are considered warnings:

以下模式被认为是个警告:

a {}
a, .foo {}
a > [foo] {}

The following patterns are not considered warnings:

以下模式正常:

.foo {}
[foo] {}
#foo {}
.bar > #foo {}
#foo.bar {}

#Optional secondary options

#ignore: ["compounded", "descendant"]

#"compounded"

Allow compounded type selectors -- i.e. type selectors chained with other selectors.

允许复合类型选择器 -- 如,类型选择器后面跟着一系列其他选择器。

The following patterns are not considered warnings:

以下模式正常:

a.foo {}
a#bar {}

#"descendant"

Allow descendant type selectors.

允许子类型选择器。

The following patterns are not considered warnings:

以下模式正常:

.foo a {}
#bar a.foo {}

#ignoreTypes: ["/regex/", "string"]

Given:

给出:

["/^my-/", "custom"]

The following patterns are not considered warnings:

以下模式正常:

custom {}
my-type {}
my-other-type {}