UNPKG

2.34 kBMarkdownView Raw
1# block-closing-brace-space-before
2
3Require a single space or disallow whitespace before the closing brace of blocks.
4
5```css
6a { color: pink; }
7/** ↑
8 * The space before this brace */
9```
10
11The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.
12
13## Options
14
15`string`: `"always"|"never"|"always-single-line"|"never-single-line"|"always-multi-line"|"never-multi-line"`
16
17### `"always"`
18
19There *must always* be a single space before the closing brace.
20
21The following patterns are considered violations:
22
23```css
24a { color: pink;}
25```
26
27```css
28a
29{ color: pink;}
30```
31
32The following patterns are *not* considered violations:
33
34```css
35a { color: pink; }
36```
37
38```css
39a {
40color: pink; }
41```
42
43### `"never"`
44
45There *must never* be whitespace before the closing brace.
46
47The following patterns are considered violations:
48
49```css
50a { color: pink; }
51```
52
53```css
54a
55{ color: pink; }
56```
57
58The following patterns are *not* considered violations:
59
60```css
61a{ color: pink;}
62```
63
64```css
65a{
66color: pink;}
67```
68
69### `"always-single-line"`
70
71There *must always* be a single space before the closing brace in single-line blocks.
72
73The following patterns are considered violations:
74
75```css
76a { color: pink;}
77```
78
79The following patterns are *not* considered violations:
80
81```css
82a { color: pink; }
83```
84
85```css
86a {
87color: pink;}
88```
89
90### `"never-single-line"`
91
92There *must never* be whitespace before the closing brace in single-line blocks.
93
94The following patterns are considered violations:
95
96```css
97a { color: pink; }
98```
99
100The following patterns are *not* considered violations:
101
102```css
103a { color: pink;}
104```
105
106```css
107a {
108color: pink; }
109```
110
111### `"always-multi-line"`
112
113There *must always* be a single space before the closing brace in multi-line blocks.
114
115The following patterns are considered violations:
116
117```css
118a {
119color: pink;}
120```
121
122The following patterns are *not* considered violations:
123
124```css
125a { color: pink;}
126```
127
128```css
129a {
130color: pink; }
131```
132
133### `"never-multi-line"`
134
135There *must never* be whitespace before the closing brace in multi-line blocks.
136
137The following patterns are considered violations:
138
139```css
140a {
141color: pink; }
142```
143
144The following patterns are *not* considered violations:
145
146```css
147a { color: pink; }
148```
149
150```css
151a {
152color: pink;}
153```