1 | # block-no-empty
|
2 |
|
3 | Disallow empty blocks.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { }
|
8 | /** ↑
|
9 | * Blocks like this */
|
10 | ```
|
11 |
|
12 | ## Options
|
13 |
|
14 | ### `true`
|
15 |
|
16 | The following patterns are considered violations:
|
17 |
|
18 |
|
19 | ```css
|
20 | a {}
|
21 | ```
|
22 |
|
23 |
|
24 | ```css
|
25 | a { }
|
26 | ```
|
27 |
|
28 |
|
29 | ```css
|
30 | @media print {
|
31 | a {}
|
32 | }
|
33 | ```
|
34 |
|
35 | The following patterns are _not_ considered violations:
|
36 |
|
37 |
|
38 | ```css
|
39 | a {
|
40 | /* foo */
|
41 | }
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | @media print {
|
47 | a {
|
48 | color: pink;
|
49 | }
|
50 | }
|
51 | ```
|
52 |
|
53 | ## Optional secondary options
|
54 |
|
55 | ### `ignore: ["comments"]`
|
56 |
|
57 | Exclude comments from being treated as content inside of a block.
|
58 |
|
59 | The following patterns are considered violations:
|
60 |
|
61 |
|
62 | ```css
|
63 | a {
|
64 | /* foo */
|
65 | }
|
66 | ```
|
67 |
|
68 |
|
69 | ```css
|
70 | @media print {
|
71 | a {
|
72 | /* foo */
|
73 | }
|
74 | }
|
75 | ```
|