Skip to content

Commit

Permalink
Specify assumptions for needsParens
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Mar 24, 2020
1 parent dad0b56 commit 5944447
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/no-extra-boolean-cast.js
Expand Up @@ -141,6 +141,9 @@ module.exports = {

/**
* Determines whether the given node needs to be parenthesized when replacing the previous node.
* It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list
* of possible parent node types. By the same assumption, the node's role in a particular parent is already known.
* For example, if the parent is `ConditionalExpression`, `previousNode` must be its `test` child.
* @param {ASTNode} previousNode Previous node.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node needs to be parenthesized.
Expand Down

0 comments on commit 5944447

Please sign in to comment.