Skip to content

Commit

Permalink
simplify concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
hduprat committed Aug 12, 2022
1 parent 09e6167 commit de4f91d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rules/jsx-no-leaked-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ function getIsCoerceValidNestedLogicalExpression(node) {
function extractExpressionBetweenLogicalAnds(node) {
if (node.type !== 'LogicalExpression') return [node];
if (node.operator !== '&&') return [node];
const op = [];
return op.concat(extractExpressionBetweenLogicalAnds(node.left), extractExpressionBetweenLogicalAnds(node.right));
return [].concat(extractExpressionBetweenLogicalAnds(node.left), extractExpressionBetweenLogicalAnds(node.right));
}

function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNode) {
Expand Down

0 comments on commit de4f91d

Please sign in to comment.