Skip to content

Incosistent AST for typeArgument and typeParameters #220

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy