UNPKG

eslint-codemod-utils

Version:

A collection of AST helper functions for more complex ESLint rule fixes.

9 lines (8 loc) 349 B
import type { EslintNode } from '../types'; /** * Traverses the node's parents until the specified `type` is found. If no `type` is found * in the traversal it will return `null`. */ export declare function closestOfType<NodeType extends EslintNode['type']>(node: EslintNode, type: NodeType): Extract<EslintNode, { type: NodeType; }> | null;