UNPKG

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