UNPKG

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