Skip to content

Commit

Permalink
Implement arrow function multiline wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
ColCh committed Aug 29, 2016
1 parent 321f354 commit fcbff9a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/rules/jsx-wrap-multilines.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
var DEFAULTS = {
declaration: true,
assignment: true,
return: true
return: true,
arrow: true
};

// ------------------------------------------------------------------------------
Expand All @@ -38,6 +39,9 @@ module.exports = {
},
return: {
type: 'boolean'
},
arrow: {
type: 'boolean'
}
},
additionalProperties: false
Expand Down Expand Up @@ -107,6 +111,14 @@ module.exports = {
if (isEnabled('return')) {
check(node.argument);
}
},

'ArrowFunctionExpression:exit': function (node) {
var arrowBody = node.body;

if (isEnabled('arrow') && arrowBody.type !== 'BlockStatement') {
check(arrowBody);
}
}
};

Expand Down

0 comments on commit fcbff9a

Please sign in to comment.