UNPKG

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