UNPKG

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