Skip to content

[RFC] AST structure of TSImportType to be more align with rest of AST #2998

Closed
@armano2

Description

@armano2

THIS IS BREAKING CHANGE

What is this change about?

TSImportType has boolean property isTypeOf that is inconsistent with other usages of typeof within AST structure.

isTypeOf property is unique (not used anywhere else in code)

type x = typeof import('x')
TSImportType:
  - isTypeOf: boolean
type x = typeof window
TSTypeQuery:
  - exprName: Identifier

Why we should change it?

  • Improve consistency of ast structure.
  • Align generated structure with babel representation
  • Allow consumers (eg. prettier) to correctly place comment - link
    typeof /* comment */ import('x')

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedpackage: 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