lib/linter.js
function getScope(scopeManager, currentNode) {

    // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.
    const inner = currentNode.type !== "Program";

    for (let node = currentNode; node; node = node.parent) {
        const scope = scopeManager.acquire(node, inner);

        if (scope) {
            if (scope.type === "function-expression-name") {
                return scope.childScopes[0];
            }
            return scope;
        }
    }

    return scopeManager.scopes[0];
}
function getScope(scopeManager, currentNode) {

    // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.
    const inner = currentNode.type !== "Program";

    for (let node = currentNode; node; node = node.parent) {
        const scope = scopeManager.acquire(node, inner);

        if (scope) {
            if (scope.type === "function-expression-name") {
                return scope.childScopes[0];
            }
            return scope;
        }
    }

    return scopeManager.scopes[0];
}
function getScope ( scopeManager , currentNode ) { // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. const inner = currentNode . type !== "Program" ; for ( let node = currentNode ; node ; node = node . parent ) { const scope = scopeManager . acquire ( node , inner ) ; if ( scope ) { if ( scope . type === "function-expression-name" ) { return scope . childScopes [ 0 ] ; } return scope ; } } return scopeManager . scopes [ 0 ] ; }
Gets the scope for the current node
@param {ScopeManager} scopeManager The scope manager for this AST
@param {ASTNode} currentNode The node to get the scope of
@returns {eslint-scope.Scope} The scope information for this node
Gets the scope for the current node