Skip to content

Incosistent AST for typeArgument and typeParameters #220

Closed
@armano2

Description

@armano2

While doing #219 i notice that we have small inconsistency in AST, sometimes we are outputting TSTypeParameterDeclaration and TSTypeParameterInstantiation without nodes and sometimes we are omitting this node completely.

if (superClass.types[0] && superClass.types[0].typeArguments) {
result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(
superClass.types[0].typeArguments
);
}

if (node.typeArguments && node.typeArguments.length) {
result.typeParameters = this.convertTypeArgumentsToTypeParameters(
node.typeArguments
);
}

if (node.typeParameters && node.typeParameters.length) {
result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
node.typeParameters
);
}

if (node.typeParameters) {
result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
node.typeParameters
);
}

we should align it, but i'm unsure if we should always have it or not

additionally we should handle #146 in update for it

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions