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

fix(typescript-estree): [ts 4.2] add support for import type equal declaration #3189

Merged
merged 1 commit into from Mar 18, 2021

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Mar 16, 2021

typescript 4.2 introduced new missing syntax:

import type foo = require('bar');
export import type foo = require('bar');

AST addition

TSImportEqualsDeclaration <: Node {
  importKind: 'type' | 'value';
}

fixes #3183, ref babel/babel#12962, microsoft/TypeScript#41573

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @armano2!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@armano2 armano2 added AST PRs and Issues about the AST structure package: typescript-estree Issues related to @typescript-eslint/typescript-estree labels Mar 16, 2021
@armano2 armano2 requested a review from bradzacher March 16, 2021 07:17
@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #3189 (541d17d) into master (7b6f2ab) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3189   +/-   ##
=======================================
  Coverage   92.91%   92.91%           
=======================================
  Files         316      316           
  Lines       10808    10809    +1     
  Branches     3056     3057    +1     
=======================================
+ Hits        10042    10043    +1     
  Misses        342      342           
  Partials      424      424           
Flag Coverage Δ
unittest 92.91% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/typescript-estree/src/convert.ts 98.24% <100.00%> (+<0.01%) ⬆️

@armano2 armano2 changed the title fix(typescript-estree): [ts 4.2] type imports in import equal declaration fix(typescript-estree): [ts 4.2] add support for import type equal declaration Mar 16, 2021
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks
totally don't see the point of this syntax but whatever 🤷‍♂️

@bradzacher bradzacher merged commit 6a25faf into master Mar 18, 2021
@bradzacher bradzacher deleted the fix/import-equal-type branch March 18, 2021 19:55
@dimitropoulos
Copy link
Contributor

same, and, actually, if someone can explain why this syntax would ever actually be needed I'd benefit from (and, would appreciate) hearing why.

@armano2
Copy link
Member Author

armano2 commented Mar 22, 2021

reason can be fond in this pr microsoft/TypeScript#41573

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AST PRs and Issues about the AST structure package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ts 4.2: type imports in import equal declaration
3 participants