selector-type-no-unknown
Disallow unknown type selectors.
unknown {}/** ↑ * This type selector */Use this rule to avoid mistyped type selectors, e.g. buton. Browsers accept them as valid, but they match nothing.
This rule considers tags defined in the HTML, SVG, and MathML specifications to be known.
This rule supports 1 message argument: the unknown type selector.
Options
Section titled “Options”{ "selector-type-no-unknown": true}The following patterns are considered problems:
unknown {}tag {}The following patterns are not considered problems:
input {}ul li {}li > a {}Optional secondary options
Section titled “Optional secondary options”ignore
Section titled “ignore”{ "ignore": ["array", "of", "options"] }"custom-elements"
Section titled “"custom-elements"”Allow custom elements.
{ "selector-type-no-unknown": [true, { "ignore": ["custom-elements"] }]}The following patterns are considered problems:
unknown {}x-Foo {}The following patterns are not considered problems:
x-foo {}"default-namespace"
Section titled “"default-namespace"”Allow unknown type selectors if they belong to the default namespace.
{ "selector-type-no-unknown": [true, { "ignore": ["default-namespace"] }]}The following patterns are considered problems:
namespace|unknown {}The following patterns are not considered problems:
unknown {}ignoreNamespaces
Section titled “ignoreNamespaces”{ "ignoreNamespaces": ["array", "of", "namespaces", "/regex/"] }Given:
{ "selector-type-no-unknown": [ true, { "ignoreNamespaces": ["/^my-/", "custom-namespace"] } ]}The following patterns are not considered problems:
custom-namespace|unknown {}my-namespace|unknown {}my-other-namespace|unknown {}ignoreTypes
Section titled “ignoreTypes”{ "ignoreTypes": ["array", "of", "types", "/regex/"] }Given:
{ "selector-type-no-unknown": [ true, { "ignoreTypes": ["/^my-/", "custom-type"] } ]}The following patterns are not considered problems:
custom-type {}my-type {}my-other-type {}