Skip to main content

selector-type-no-unknown

Disallow unknown type selectors.

unknown {}
/** โ†‘
* This type selector */

This rule considers tags defined in the HTML, SVG, and MathML specifications to be known.

Options#

true#

The following patterns are considered violations:

unknown {}
tag {}

The following patterns are not considered violations:

input {}
ul li {}
li > a {}

Optional secondary options#

ignore: ["custom-elements", "default-namespace"]#

"custom-elements"#

Allow custom elements.

The following patterns are considered violations:

unknown {}
x-Foo {}

The following patterns are not considered violations:

x-foo {}

"default-namespace"#

Allow unknown type selectors if they belong to the default namespace.

The following patterns are considered violations:

namespace|unknown {}

The following patterns are not considered violations:

unknown {}

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

Given:

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

The following patterns are not considered violations:

custom-namespace|unknown {}
my-namespace|unknown {}
my-other-namespace|unknown {}

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

Given:

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

The following patterns are not considered violations:

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