1 | # selector-max-empty-lines
|
2 |
|
3 | Limit the number of adjacent empty lines within selectors.
|
4 |
|
5 |
|
6 | ```css
|
7 | a,
|
8 | /* ← */
|
9 | b { /* ↑ */
|
10 | color: red; /* ↑ */
|
11 | } /* ↑ */
|
12 | /** ↑
|
13 | * This empty line */
|
14 | ```
|
15 |
|
16 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
17 |
|
18 | ## Options
|
19 |
|
20 | `int`: Maximum number of adjacent empty lines allowed.
|
21 |
|
22 | For example, with `0`:
|
23 |
|
24 | The following patterns are considered violations:
|
25 |
|
26 |
|
27 | ```css
|
28 | a
|
29 |
|
30 | b {
|
31 | color: red;
|
32 | }
|
33 | ```
|
34 |
|
35 |
|
36 | ```css
|
37 | a,
|
38 |
|
39 | b {
|
40 | color: red;
|
41 | }
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | a
|
47 |
|
48 | >
|
49 | b {
|
50 | color: red;
|
51 | }
|
52 | ```
|
53 |
|
54 |
|
55 | ```css
|
56 | a
|
57 | >
|
58 |
|
59 | b {
|
60 | color: red;
|
61 | }
|
62 | ```
|
63 |
|
64 | The following patterns are _not_ considered violations:
|
65 |
|
66 |
|
67 | ```css
|
68 | a b {
|
69 | color: red;
|
70 | }
|
71 | ```
|
72 |
|
73 |
|
74 | ```css
|
75 | a
|
76 | b {
|
77 | color: red;
|
78 | }
|
79 | ```
|
80 |
|
81 |
|
82 | ```css
|
83 | a,
|
84 | b {
|
85 | color: red;
|
86 | }
|
87 | ```
|
88 |
|
89 |
|
90 | ```css
|
91 | a > b {
|
92 | color: red;
|
93 | }
|
94 | ```
|
95 |
|
96 |
|
97 | ```css
|
98 | a
|
99 | >
|
100 | b {
|
101 | color: red;
|
102 | }
|
103 | ```
|