Skip to content

Commit fcbff9a

Browse files
committed
Implement arrow function multiline wrap
1 parent 321f354 commit fcbff9a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/rules/jsx-wrap-multilines.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
var DEFAULTS = {
1212
declaration: true,
1313
assignment: true,
14-
return: true
14+
return: true,
15+
arrow: true
1516
};
1617

1718
// ------------------------------------------------------------------------------
@@ -38,6 +39,9 @@ module.exports = {
3839
},
3940
return: {
4041
type: 'boolean'
42+
},
43+
arrow: {
44+
type: 'boolean'
4145
}
4246
},
4347
additionalProperties: false
@@ -107,6 +111,14 @@ module.exports = {
107111
if (isEnabled('return')) {
108112
check(node.argument);
109113
}
114+
},
115+
116+
'ArrowFunctionExpression:exit': function (node) {
117+
var arrowBody = node.body;
118+
119+
if (isEnabled('arrow') && arrowBody.type !== 'BlockStatement') {
120+
check(arrowBody);
121+
}
110122
}
111123
};
112124

0 commit comments

Comments
 (0)