lib/rules/indent-legacy.js
function getParentNodeByType(node, type, stopAtList) {
            let parent = node.parent;
            const stopAtSet = new Set(stopAtList || ["Program"]);

            while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") {
                parent = parent.parent;
            }

            return parent.type === type ? parent : null;
        }
function getParentNodeByType(node, type, stopAtList) {
            let parent = node.parent;
            const stopAtSet = new Set(stopAtList || ["Program"]);

            while (parent.type !== type && !stopAtSet.has(parent.type) && parent.type !== "Program") {
                parent = parent.parent;
            }

            return parent.type === type ? parent : null;
        }
function getParentNodeByType ( node , type , stopAtList ) { let parent = node . parent ; const stopAtSet = new Set ( stopAtList || [ "Program" ] ) ; while ( parent . type !== type && ! stopAtSet . has ( parent . type ) && parent . type !== "Program" ) { parent = parent . parent ; } return parent . type === type ? parent : null ; }
Returns a parent node of given node based on a specified type
if not present then return null
@param {ASTNode} node node to examine
@param {string} type type that is being looked for
@param {string} stopAtList end points for the evaluating code
@returns {ASTNode|void} if found then node otherwise null
Returns a parent node of given node based on a specified type if not present then return null