UNPKG

1.86 kBMarkdownView Raw
1# function-parentheses-newline-inside
2
3Require 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
16The `--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
24There *must always* be a newline inside the parentheses.
25
26The following patterns are considered violations:
27
28```css
29a { transform: translate(1, 1); }
30```
31
32```css
33a { transform: translate(1,
34 1
35 ); }
36```
37
38The following patterns are *not* considered violations:
39
40```css
41a {
42 transform: translate(
43 1, 1
44 );
45}
46```
47
48```css
49a {
50 transform: translate(
51 1,
52 1
53 );
54}
55```
56
57### `"always-multi-line"`
58
59There *must always* be a newline inside the parentheses of multi-line functions.
60
61The following patterns are considered violations:
62
63```css
64a { transform: translate(1,
65 1) }
66```
67
68The following patterns are *not* considered violations:
69
70```css
71a { transform: translate(1, 1) }
72```
73
74```css
75a { transform: translate( 1, 1 ) }
76```
77
78```css
79a {
80 transform: translate(
81 1, 1
82 );
83}
84```
85
86```css
87a {
88 transform: translate(
89 1,
90 1
91 );
92}
93```
94
95### `"never-multi-line"`
96
97The following patterns are considered violations:
98
99```css
100a {
101 transform: translate(
102 1, 1
103 );
104}
105```
106
107```css
108a {
109 transform: translate(
110 1,
111 1
112 );
113}
114```
115
116The following patterns are *not* considered violations:
117
118```css
119a { transform: translate(1, 1) }
120```
121
122```css
123a { transform: translate( 1, 1 ) }
124```
125
126```css
127a { transform: translate(1,
128 1) }
129```