Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
armano2 opened this issue Feb 5, 2021 · 1 comment · Fixed by #3076
Closed

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

armano2 opened this issue Feb 5, 2021 · 1 comment · Fixed by #3076
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree

Comments

@armano2
Copy link
Member

armano2 commented Feb 5, 2021

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')
@armano2 armano2 added package: typescript-estree Issues related to @typescript-eslint/typescript-estree AST PRs and Issues about the AST structure labels Feb 5, 2021
@bradzacher bradzacher added the breaking change This change will require a new major version to be released label Feb 5, 2021
@armano2 armano2 changed the title Proposal: Change AST structure of TSImportType to be more align with rest of AST [RFC] AST structure of TSImportType to be more align with rest of AST Feb 6, 2021
@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Oct 25, 2021
@JoshuaKGoldberg
Copy link
Member

#3076 is merged into #5886; closing this issue now accordingly. It'll be released as a part of the v6 major release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants