Skip to content

Commit

Permalink
Update: remove untested check from no-else-return
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Sep 23, 2017
1 parent a7668c2 commit b9748d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/no-else-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ module.exports = {

/**
* Check to see if the node is valid for evaluation,
* meaning it has an else and not an else-if
* meaning it has an else.
*
* @param {Node} node The node being evaluated
* @returns {boolean} True if the node is valid
*/
function hasElse(node) {
return node.alternate && node.consequent && node.alternate.type !== "IfStatement";
return node.alternate && node.consequent;
}

/**
Expand Down

0 comments on commit b9748d9

Please sign in to comment.