1 | # selector-combinator-whitelist
|
2 |
|
3 | Specify a whitelist of allowed combinators.
|
4 |
|
5 |
|
6 | ```css
|
7 | a + b {}
|
8 | /** ↑
|
9 | * This combinator */
|
10 | ```
|
11 |
|
12 | This rule normalizes the whitespace descendant combinator to be a single space.
|
13 |
|
14 | This rule ignores [reference combinators](https://www.w3.org/TR/selectors4/#idref-combinators) e.g. `/for/`.
|
15 |
|
16 | ## Options
|
17 |
|
18 | `array|string`: `["array", "of", "combinators"]|"combinator"`
|
19 |
|
20 | Given:
|
21 |
|
22 | ```
|
23 | [">", " "]
|
24 | ```
|
25 |
|
26 | The following patterns are considered violations:
|
27 |
|
28 |
|
29 | ```css
|
30 | a + b {}
|
31 | ```
|
32 |
|
33 |
|
34 | ```css
|
35 | a ~ b {}
|
36 | ```
|
37 |
|
38 | The following patterns are _not_ considered violations:
|
39 |
|
40 |
|
41 | ```css
|
42 | a > b {}
|
43 | ```
|
44 |
|
45 |
|
46 | ```css
|
47 | a b {}
|
48 | ```
|
49 |
|
50 |
|
51 | ```css
|
52 | a
|
53 | b {}
|
54 | ```
|