TS2310

Type 'X' recursively references itself as a base type.

Broken Code ❌

interface Node extends Node {
  value: string;
}

Fixed Code ✔️

interface Node {
  value: string;
  parent?: Node;
}

Alternative:

interface BaseNode {
  value: string;
}
 
interface Node extends BaseNode {
  parent?: Node;
}

An interface cannot extend itself directly. If you need self-referential structures, use optional properties instead.