Home / Class/ BaseNode Class — react Architecture

BaseNode Class — react Architecture

Architecture documentation for the BaseNode class in estree.d.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  384bdfdb_904f_b952_7323_041a8c33db9e["BaseNode"]
  2f56868f_fbeb_d9d6_f88a_31c4a1c75017["estree.d.ts"]
  384bdfdb_904f_b952_7323_041a8c33db9e -->|defined in| 2f56868f_fbeb_d9d6_f88a_31c4a1c75017

Relationship Graph

Source Code

packages/eslint-plugin-react-hooks/src/types/estree.d.ts lines 11–72

declare module 'estree' {
  // The Exhaustive deps rule mutates the AST to add parent nodes for efficient traversal.
  // We need to augment the `estree` types to support that.
  interface BaseNode {
    parent?: Node;
  }

  // Adding types that aren't built-in to estree or estree-jsx.
  // Namely, the specific TS and Flow types that we're using.
  interface AsExpression extends BaseExpression {
    type: 'AsExpression';
    expression: Expression | Identifier;
  }

  interface OptionalCallExpression extends BaseCallExpression {
    type: 'OptionalCallExpression';
  }

  interface OptionalMemberExpression extends MemberExpression {
    type: 'OptionalMemberExpression';
  }

  interface TSAsExpression extends BaseExpression {
    type: 'TSAsExpression';
    expression: Expression | Identifier;
  }

  interface TSTypeQuery extends BaseNode {
    type: 'TSTypeQuery';
    exprName: Identifier;
  }

  interface TSTypeReference extends BaseNode {
    type: 'TSTypeReference';
    typeName: Identifier;
  }

  interface TypeCastExpression extends BaseExpression {
    type: 'TypeCastExpression';
    expression: Expression | Identifier;
  }

  // Extend the set of known Expression types
  interface ExpressionMap {
    AsExpression: AsExpression;
    OptionalCallExpression: OptionalCallExpression;
    OptionalMemberExpression: OptionalMemberExpression;
    TSAsExpression: TSAsExpression;
    TypeCastExpression: TypeCastExpression;
  }

  // Extend the set of known Node types
  interface NodeMap {
    AsExpression: AsExpression;
    OptionalCallExpression: OptionalCallExpression;
    OptionalMemberExpression: OptionalMemberExpression;
    TSAsExpression: TSAsExpression;
    TSTypeQuery: TSTypeQuery;
    TSTypeReference: TSTypeReference;
    TypeCastExpression: TypeCastExpression;
  }
}

Frequently Asked Questions

What is the BaseNode class?
BaseNode is a class in the react codebase, defined in packages/eslint-plugin-react-hooks/src/types/estree.d.ts.
Where is BaseNode defined?
BaseNode is defined in packages/eslint-plugin-react-hooks/src/types/estree.d.ts at line 11.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free