UNPKG

1.54 kBMarkdownView Raw
1# selector-type-no-unknown
2
3Disallow unknown type selectors.
4
5```css
6 unknown {}
7/** ↑
8 * This type selector */
9```
10
11This rule considers tags defined in the HTML, SVG, and MathML specifications to be known.
12
13## Options
14
15### `true`
16
17The following patterns are considered violations:
18
19```css
20unknown {}
21```
22
23```css
24tag {}
25```
26
27The following patterns are *not* considered violations:
28
29```css
30input {}
31```
32
33```css
34ul li {}
35```
36
37```css
38li > a {}
39```
40
41## Optional secondary options
42
43### `ignore: ["custom-elements", "default-namespace"]`
44
45#### `"custom-elements"`
46
47Allow custom elements.
48
49The following patterns are considered violations:
50
51```css
52unknown {}
53```
54
55```css
56x-Foo {}
57```
58
59The following patterns are *not* considered violations:
60
61```css
62x-foo {}
63```
64
65#### `"default-namespace"`
66
67Allow unknown type selectors if they belong to the default namespace.
68
69The following patterns are considered violations:
70
71```css
72namespace|unknown {}
73```
74
75The following patterns are *not* considered violations:
76
77```css
78unknown {}
79```
80
81### `ignoreNamespaces: ["/regex/", /regex/, "string"]`
82
83Given:
84
85```js
86["/^my-/", "custom-namespace"]
87```
88
89The following patterns are *not* considered violations:
90
91```css
92custom-namespace|unknown {}
93```
94
95```css
96my-namespace|unknown {}
97```
98
99```css
100my-other-namespace|unknown {}
101```
102
103### `ignoreTypes: ["/regex/", /regex/, "string"]`
104
105Given:
106
107```js
108["/^my-/", "custom-type"]
109```
110
111The following patterns are *not* considered violations:
112
113```css
114custom-type {}
115```
116
117```css
118my-type {}
119```
120
121```css
122my-other-type {}
123```