1 | # function-comma-newline-after
|
2 |
|
3 | Require a newline or disallow whitespace after the commas of functions.
|
4 |
|
5 |
|
6 | ```css
|
7 | a { transform: translate(1,
|
8 | 1) } /* ↑ */
|
9 | /** ↑
|
10 | * These commas */
|
11 | ```
|
12 |
|
13 | The [`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 |
|
21 | There _must always_ be a newline after the commas.
|
22 |
|
23 | The following patterns are considered violations:
|
24 |
|
25 |
|
26 | ```css
|
27 | a { transform: translate(1,1) }
|
28 | ```
|
29 |
|
30 |
|
31 | ```css
|
32 | a { transform: translate(1 ,1) }
|
33 | ```
|
34 |
|
35 |
|
36 | ```css
|
37 | a { transform: translate(1
|
38 | ,1) }
|
39 | ```
|
40 |
|
41 | The following patterns are _not_ considered violations:
|
42 |
|
43 |
|
44 | ```css
|
45 | a {
|
46 | transform: translate(1,
|
47 | 1)
|
48 | }
|
49 | ```
|
50 |
|
51 | ### `"always-multi-line"`
|
52 |
|
53 | There _must always_ be a newline after the commas in multi-line functions.
|
54 |
|
55 | The following patterns are considered violations:
|
56 |
|
57 |
|
58 | ```css
|
59 | a { transform: translate(1
|
60 | ,1) }
|
61 | ```
|
62 |
|
63 | The following patterns are _not_ considered violations:
|
64 |
|
65 |
|
66 | ```css
|
67 | a { transform: translate(1,1) }
|
68 | ```
|
69 |
|
70 |
|
71 | ```css
|
72 | a { transform: translate(1 ,1) }
|
73 | ```
|
74 |
|
75 |
|
76 | ```css
|
77 | a {
|
78 | transform: translate(1,
|
79 | 1)
|
80 | }
|
81 | ```
|
82 |
|
83 | ### `"never-multi-line"`
|
84 |
|
85 | There _must never_ be whitespace after the commas in multi-line functions.
|
86 |
|
87 | The following patterns are considered violations:
|
88 |
|
89 |
|
90 | ```css
|
91 | a { transform: translate(1
|
92 | , 1) }
|
93 | ```
|
94 |
|
95 | The following patterns are _not_ considered violations:
|
96 |
|
97 |
|
98 | ```css
|
99 | a { transform: translate(1, 1) }
|
100 | ```
|
101 |
|
102 |
|
103 | ```css
|
104 | a { transform: translate(1 , 1) }
|
105 | ```
|
106 |
|
107 |
|
108 | ```css
|
109 | a {
|
110 | transform: translate(1
|
111 | ,1)
|
112 | }
|
113 | ```
|