Given the following class hierarchy:
class Foo {
fooMember = 1;
}
class Bar extends Foo {
barMember = 2;
}
The AST output of @typescript-eslint/parser references the extends Foo statement as a superClass with the following properties:
superClass: Identifier {
type: "Identifier",
name: "Foo",
range: [ 50 53 ]
}
Is it possible to extract the ClassDeclaration corresponding to Foo from this entry, and if so, how?
Is the same solution applicable if the extended class is imported?
Conceptually this should be possible, given that Typescript correctly infers errors such as public-private definition mismatch between parent-child classes etc.