Skip to content

Commit 64868fc

Browse files
author
Joachim Seminck
committed
Update docs
1 parent 278f1f6 commit 64868fc

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

docs/rules/jsx-wrap-multilines.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ Wrapping multiline JSX in parentheses can improve readability and/or convenience
66

77
## Rule Details
88

9-
This rule optionally takes a second parameter in the form of an object, containing places to apply the rule. By default, all the syntax listed below will be checked, but these can be explicitly disabled. Any syntax type missing in the object will follow the default behavior (become enabled).
9+
This rule optionally takes a second parameter in the form of an object, containing places to apply the rule. By default, all the syntax listed below will be checked except the conditionals, but these can be explicitly disabled. Any syntax type missing in the object will follow the default behavior (become enabled).
1010

1111
There are the possible syntax available:
1212

1313
* `declaration`
1414
* `assignment`
1515
* `return`
1616
* `arrow`
17+
* `conditional` (not enabled by default)
1718

1819
The following patterns are considered warnings:
1920

@@ -101,6 +102,7 @@ function hello() {
101102
);
102103
}
103104
```
105+
104106
The following patterns are considered warnings when configured `{arrow: true}`.
105107

106108
```jsx
@@ -118,3 +120,27 @@ var hello = () => (
118120
</div>
119121
);
120122
```
123+
124+
The following patterns are considered warnings when configured `{conditional: true}`.
125+
126+
```jsx
127+
<div>
128+
{myExpression &&
129+
<div>
130+
<p>Hello World</p>
131+
</div>
132+
}
133+
</div>
134+
```
135+
136+
The following patterns are not considered warnings when configured `{arrow: true}`.
137+
138+
```jsx
139+
<div>
140+
{myExpression && (
141+
<div>
142+
<p>Hello World</p>
143+
</div>
144+
)}
145+
</div>
146+
```

0 commit comments

Comments
 (0)