eslint-plugin-perfectionist
Version:
ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
14 lines (13 loc) • 468 B
TypeScript
import { TSESTree } from '@typescript-eslint/types'
/**
* Extracts a numeric value from an AST expression node.
*
* Handles literal numbers, binary expressions, and unary expressions
* recursively to compute the final numeric value.
*
* @param expression - The AST node to evaluate.
* @returns The numeric value of the expression, or null if not evaluable.
*/
export declare function computeExpressionNumberValue(
expression: TSESTree.Node,
): number | null