eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
Let's change the utils `isBooleanNode(node)` to `isInControlFlow(node)`
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/d3e4b805da31c6ed7275e2e2e770b6b0fbcf11c2/rules/utils/boolean.js#L26-L37
Currently, this function is too complicated, judging both the node itself and the node's parent.
It is easy to false positives (#1840). Let's split this into two functions
-
isBooleanExpression(node)
- Implemented -
isInControlFlow(node)
- create a new function