lib/rules/no-extra-boolean-cast.js
function isInBooleanContext(node, parent) {
            return (
                (BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
                    node === parent.test) ||

                // !<bool>
                (parent.type === "UnaryExpression" &&
                    parent.operator === "!")
            );
        }
function isInBooleanContext(node, parent) {
            return (
                (BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 &&
                    node === parent.test) ||

                // !<bool>
                (parent.type === "UnaryExpression" &&
                    parent.operator === "!")
            );
        }
function isInBooleanContext ( node , parent ) { return ( ( BOOLEAN_NODE_TYPES . indexOf ( parent . type ) !== - 1 && node === parent . test ) || // !<bool> ( parent . type === "UnaryExpression" && parent . operator === "!" ) ) ; }
Check if a node is in a context where its value would be coerced to a boolean at runtime.

@param {Object} node The node
@param {Object} parent Its parent
@returns {boolean} If it is in a boolean context
Check if a node is in a context where its value would be coerced to a boolean at runtime .