UNPKG

eslint-codemod-utils

Version:

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

12 lines (11 loc) 391 B
import type { ESLintNode } from '../types'; /** * Given a valid node return true if the node is of the specified type. * * This function uses the `is` assertion to resolve the correct TS type for the consumer. * * @return boolean */ export declare function isNodeOfType<T extends ESLintNode, K extends T['type']>(node: unknown, type: K): node is Extract<ESLintNode, { type: K; }>;