eslint-codemod-utils
Version:
A collection of AST helper functions for more complex ESLint rule fixes.
12 lines (11 loc) • 528 B
TypeScript
import type { Scope } from 'eslint';
/**
* A useful function for finding a variable / variables value. This function
* traverses the scopes upwards until it arrives at the global scope. It will
* return when it exhausts the scopes or finds the variable.
*
* @param scope The current scope the variable exists in:
* @param identifierName The identifier / variable we're trying to look up
* @returns
*/
export declare function getIdentifierInParentScope(scope: Scope.Scope, identifierName: string): Scope.Variable | null;