UNPKG

1.93 kBMarkdownView Raw
1# function-comma-newline-after
2
3Require a newline or disallow whitespace after the commas of functions.
4
5<!-- prettier-ignore -->
6```css
7a { transform: translate(1,
8 1) } /* ↑ */
9/** ↑
10 * These commas */
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 after 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### `"always-multi-line"`
52
53There _must always_ be a newline after the commas in multi-line functions.
54
55The following patterns are considered violations:
56
57<!-- prettier-ignore -->
58```css
59a { transform: translate(1
60 ,1) }
61```
62
63The following patterns are _not_ considered violations:
64
65<!-- prettier-ignore -->
66```css
67a { transform: translate(1,1) }
68```
69
70<!-- prettier-ignore -->
71```css
72a { transform: translate(1 ,1) }
73```
74
75<!-- prettier-ignore -->
76```css
77a {
78 transform: translate(1,
79 1)
80}
81```
82
83### `"never-multi-line"`
84
85There _must never_ be whitespace after the commas in multi-line functions.
86
87The following patterns are considered violations:
88
89<!-- prettier-ignore -->
90```css
91a { transform: translate(1
92 , 1) }
93```
94
95The following patterns are _not_ considered violations:
96
97<!-- prettier-ignore -->
98```css
99a { transform: translate(1, 1) }
100```
101
102<!-- prettier-ignore -->
103```css
104a { transform: translate(1 , 1) }
105```
106
107<!-- prettier-ignore -->
108```css
109a {
110 transform: translate(1
111 ,1)
112}
113```