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