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