1 | # block-closing-brace-space-after
|
2 |
|
3 | Require a single space or disallow whitespace after the closing brace of blocks.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { color: pink; }
|
8 | /** ↑
|
9 | * The space after this brace */
|
10 | ```
|
11 |
|
12 | This rule allows a trailing semicolon after the closing brace of a block. For example,
|
13 |
|
14 |
|
15 | ```css
|
16 | :root {
|
17 | --toolbar-theme: {
|
18 | background-color: hsl(120, 70%, 95%);
|
19 | };
|
20 | /* ↑
|
21 | * This semicolon */
|
22 | }
|
23 | ```
|
24 |
|
25 | ## Options
|
26 |
|
27 | `string`: `"always"|"never"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line"`
|
28 |
|
29 | ### `"always"`
|
30 |
|
31 | There _must always_ be a single space after the closing brace.
|
32 |
|
33 | The following patterns are considered violations:
|
34 |
|
35 |
|
36 | ```css
|
37 | a { color: pink; }b { color: red; }
|
38 | ```
|
39 |
|
40 |
|
41 | ```css
|
42 | a { color: pink; }
|
43 | b { color: red; }
|
44 | ```
|
45 |
|
46 | The following patterns are _not_ considered violations:
|
47 |
|
48 |
|
49 | ```css
|
50 | a { color: pink; } b { color: red; }
|
51 | ```
|
52 |
|
53 | ### `"never"`
|
54 |
|
55 | There _must never_ be whitespace after the closing brace.
|
56 |
|
57 | The following patterns are considered violations:
|
58 |
|
59 |
|
60 | ```css
|
61 | a { color: pink; } b { color: red; }
|
62 | ```
|
63 |
|
64 |
|
65 | ```css
|
66 | a { color: pink; }
|
67 | b { color: red; }
|
68 | ```
|
69 |
|
70 | The following patterns are _not_ considered violations:
|
71 |
|
72 |
|
73 | ```css
|
74 | a { color: pink; }b { color: red; }
|
75 | ```
|
76 |
|
77 |
|
78 | ```css
|
79 | a { color: pink;
|
80 | }b { color: red; }
|
81 | ```
|
82 |
|
83 | ### `"always-single-line"`
|
84 |
|
85 | There _must always_ be a single space after the closing brace in single-line blocks.
|
86 |
|
87 | The following patterns are considered violations:
|
88 |
|
89 |
|
90 | ```css
|
91 | a { color: pink; }b { color: red; }
|
92 | ```
|
93 |
|
94 | The following patterns are _not_ considered violations:
|
95 |
|
96 |
|
97 | ```css
|
98 | a { color: pink; } b { color: red; }
|
99 | ```
|
100 |
|
101 |
|
102 | ```css
|
103 | a { color: pink;
|
104 | }b { color: red; }
|
105 | ```
|
106 |
|
107 | ### `"never-single-line"`
|
108 |
|
109 | There _must never_ be whitespace after the closing brace in single-line blocks.
|
110 |
|
111 | The following patterns are considered violations:
|
112 |
|
113 |
|
114 | ```css
|
115 | a { color: pink; } b { color: red; }
|
116 | ```
|
117 |
|
118 | The following patterns are _not_ considered violations:
|
119 |
|
120 |
|
121 | ```css
|
122 | a { color: pink; }b { color: red; }
|
123 | ```
|
124 |
|
125 |
|
126 | ```css
|
127 | a { color: pink;
|
128 | } b { color: red; }
|
129 | ```
|
130 |
|
131 | ### `"always-multi-line"`
|
132 |
|
133 | There _must always_ be a single space after the closing brace in multi-line blocks.
|
134 |
|
135 | The following patterns are considered violations:
|
136 |
|
137 |
|
138 | ```css
|
139 | a { color: pink;
|
140 | }b { color: red; }
|
141 | ```
|
142 |
|
143 | The following patterns are _not_ considered violations:
|
144 |
|
145 |
|
146 | ```css
|
147 | a { color: pink; }b { color: red; }
|
148 | ```
|
149 |
|
150 |
|
151 | ```css
|
152 | a { color: pink;
|
153 | } b { color: red; }
|
154 | ```
|
155 |
|
156 | ### `"never-multi-line"`
|
157 |
|
158 | There _must never_ be whitespace after the closing brace in multi-line blocks.
|
159 |
|
160 | The following patterns are considered violations:
|
161 |
|
162 |
|
163 | ```css
|
164 | a { color: pink;
|
165 | } b { color: red; }
|
166 | ```
|
167 |
|
168 | The following patterns are _not_ considered violations:
|
169 |
|
170 |
|
171 | ```css
|
172 | a { color: pink; } b { color: red; }
|
173 | ```
|
174 |
|
175 |
|
176 | ```css
|
177 | a { color: pink;
|
178 | }b { color: red; }
|
179 | ```
|