You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds an option for enabling/disabling wrap-multilines in the
context of the enclosing expression. In facebook/react, we only care
about jsx expressions in return statements:
facebook/react#4007 (comment)
Copy file name to clipboardExpand all lines: docs/rules/wrap-multilines.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# Prevent missing parentheses around multilines JSX (wrap-multilines)
1
+
# Prevent missing parentheses around multiline JSX (wrap-multilines)
2
2
3
-
Wrapping multilines JSX in parentheses can improve readability and/or convenience.
3
+
Wrapping multiline JSX in parentheses can improve readability and/or convenience. It optionally takes a second parameter in the form of an object, containing places to apply the rule. By default, `"declaration"`, `"assignment"`, and `"return"` syntax is checked, but these can be explicitly disabled. Any syntax type missing in the object will follow the default behavior (become enabled).
4
4
5
5
## Rule Details
6
6
@@ -30,4 +30,15 @@ var Hello = React.createClass({
30
30
);
31
31
}
32
32
});
33
+
34
+
// When [1, {declaration: false}]
35
+
var hello;
36
+
hello =<div>
37
+
<p>Hello</p>
38
+
</div>
39
+
40
+
// When [1, {declaration: true, assignment: false, return: true}]
0 commit comments