lib/linter.js
function getAncestors(node) {
    const ancestorsStartingAtParent = [];

    for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
        ancestorsStartingAtParent.push(ancestor);
    }

    return ancestorsStartingAtParent.reverse();
}
function getAncestors(node) {
    const ancestorsStartingAtParent = [];

    for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
        ancestorsStartingAtParent.push(ancestor);
    }

    return ancestorsStartingAtParent.reverse();
}
function getAncestors ( node ) { const ancestorsStartingAtParent = [ ] ; for ( let ancestor = node . parent ; ancestor ; ancestor = ancestor . parent ) { ancestorsStartingAtParent . push ( ancestor ) ; } return ancestorsStartingAtParent . reverse ( ) ; }
Gets all the ancestors of a given node
@param {ASTNode} node The node
@returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting
from the root node and going inwards to the parent node.
Gets all the ancestors of a given node