daidodo / format-imports-vscode

Format imports and exports for JavaScript and TypeScript in VS Code.
https://marketplace.visualstudio.com/items?itemName=dozerg.tsimportsorter
MIT License
62 stars 5 forks source link

Type-only imports are converted to regular ones on sort #14

Closed danielkcz closed 4 years ago

danielkcz commented 4 years ago

Describe the bug TS 3.8 introduced the new feature of Type-Only imports which is really for optimizing.

Unfortunately, the extension is not able to preserve it and the keyword is removed during the sort.

To Reproduce

import type { Client } from 'urql'

Expected behavior Import should keep type keyword.

Actual behavior

import { Client } from 'urql'

OS (please complete the following information):

VS Code (please complete the following information):

I believe the fix should be fairly trivial and I am able to work on the PR.

daidodo commented 4 years ago

Feature has been release from v2.1.4.

@FredyC, thanks very much for the contribution!

danielkcz commented 4 years ago

Working nicely. I thank you for your quick response and fix.