Skip to content

Typescript: Inconsistent properties in TS function like nodes [parser, estree] #9231

@armano2

Description

@armano2

Bug Report

Current Behavior
Ast structure is inconsistent for function like nodes.

requested change

  • property params should be renamed to parameters
  • property typeAnnotation should be renamed to returnType if used as return type

affected nodes

  • TSCallSignatureDeclaration
  • TSConstructSignatureDeclaration
  • TSFunctionType
  • TSConstructorType
  • TSMethodSignature

Input Code

interface A {
  (a: string): string
  new(a: string): string
}

Other function like nodes (FunctionExpression, ArrowFunctionExpression, FunctionDeclaration, ....) have properties:

  • typeParameters
  • params
  • returnType

Estree

https://github.com/estree/estree/blob/master/extensions/type-annotations.md#functions

Environment

  • Babel version(s): 7.2.3
  • Node/npm version: 6-11
  • OS: win/linux
  • Monorepo: no
  • How you are using Babel: cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: types

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions