notes/node_modules/stylelint/lib/rules/selector-no-type/README.md

1.0 KiB

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 {}