1 | # selector-pseudo-element-no-unknown
|
2 |
|
3 | Disallow unknown pseudo-element selectors.
|
4 |
|
5 |
|
6 | ```css
|
7 | a::before {}
|
8 | /** ↑
|
9 | * This pseudo-element selector */
|
10 | ```
|
11 |
|
12 | This rule considers pseudo-element selectors defined in the CSS Specifications, up to and including Editor's Drafts, to be known.
|
13 |
|
14 | This rule ignores vendor-prefixed pseudo-element selectors.
|
15 |
|
16 | ## Options
|
17 |
|
18 | ### `true`
|
19 |
|
20 | The following patterns are considered problems:
|
21 |
|
22 |
|
23 | ```css
|
24 | a::pseudo {}
|
25 | ```
|
26 |
|
27 |
|
28 | ```css
|
29 | a::PSEUDO {}
|
30 | ```
|
31 |
|
32 |
|
33 | ```css
|
34 | a::element {}
|
35 | ```
|
36 |
|
37 | The following patterns are _not_ considered problems:
|
38 |
|
39 |
|
40 | ```css
|
41 | a:before {}
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | a::before {}
|
47 | ```
|
48 |
|
49 |
|
50 | ```css
|
51 | ::selection {}
|
52 | ```
|
53 |
|
54 |
|
55 | ```css
|
56 | input::-moz-placeholder {}
|
57 | ```
|
58 |
|
59 | ## Optional secondary options
|
60 |
|
61 | ### `ignorePseudoElements: ["/regex/", "string"]`
|
62 |
|
63 | Given:
|
64 |
|
65 | ```json
|
66 | ["/^my-/", "pseudo-element"]
|
67 | ```
|
68 |
|
69 | The following patterns are _not_ considered problems:
|
70 |
|
71 |
|
72 | ```css
|
73 | a::pseudo-element {}
|
74 | ```
|
75 |
|
76 |
|
77 | ```css
|
78 | a::my-pseudo {}
|
79 | ```
|
80 |
|
81 |
|
82 | ```css
|
83 | a::my-other-pseudo {}
|
84 | ```
|