Skip to main content

Function: getTypeOfNode()

function getTypeOfNode(
node: Readonly<Node>,
context: RuleContext<string, BaseOptions>
): Type | null;

Defined in: util/rule.ts:84

Resolve the TypeScript type for an ESTree node when parser services are available; otherwise return null.

Parameters​

node​

Readonly<Node>

ESTree node to inspect.

context​

RuleContext<string, BaseOptions>

ESLint rule context.

Returns​

Type | null

TypeScript type or null when type information is unavailable.