UNPKG

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