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

Use "import type" syntax for TypeScript #108884

Closed
cyberalien opened this issue Oct 18, 2020 · 3 comments
Closed

Use "import type" syntax for TypeScript #108884

cyberalien opened this issue Oct 18, 2020 · 3 comments
Assignees
Labels
typescript Typescript support issues upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@cyberalien
Copy link

As of version 3.8, TypeScript supports import type syntax for imports.

When using it in VSCode, all automatically imported types default to import { Whatever }, even if other imports in the same file use import type { Whatever }.

Is it possible to add option to use import type syntax for type imports that are automatically added by VSCode?

@vscodebot
Copy link

vscodebot bot commented Oct 18, 2020

@mjbvz
Copy link
Collaborator

mjbvz commented Oct 18, 2020

Already discussed under microsoft/TypeScript#36038

import type only needs to be used in specific cases where you want to ensure the import will not result in a real import. It is better handled by explicitly marking the import instead of automatically doing so

@mjbvz mjbvz closed this as completed Oct 18, 2020
@mjbvz mjbvz added typescript Typescript support issues upstream-issue-linked This is an upstream issue that has been reported upstream labels Oct 18, 2020
@cyberalien
Copy link
Author

Thank you for linking that discussion. Following it I found a solution: microsoft/TypeScript#36412 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
typescript Typescript support issues upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

2 participants