lib/rules/no-var.js
function getScopeNode(node) {
    for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
        if (SCOPE_NODE_TYPE.test(currentNode.type)) {
            return currentNode;
        }
    }

    /* istanbul ignore next : unreachable */
    return null;
}
function getScopeNode(node) {
    for (let currentNode = node; currentNode; currentNode = currentNode.parent) {
        if (SCOPE_NODE_TYPE.test(currentNode.type)) {
            return currentNode;
        }
    }

    /* istanbul ignore next : unreachable */
    return null;
}
function getScopeNode ( node ) { for ( let currentNode = node ; currentNode ; currentNode = currentNode . parent ) { if ( SCOPE_NODE_TYPE . test ( currentNode . type ) ) { return currentNode ; } } /* istanbul ignore next : unreachable */ return null ; }
Gets the scope node which directly contains a given node.

@param {ASTNode} node - A node to get. This is a `VariableDeclaration` or
an `Identifier`.
@returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`,
`SwitchStatement`, `ForStatement`, `ForInStatement`, and
`ForOfStatement`.
Gets the scope node which directly contains a given node .