UNPKG

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