Add import type and export type support to TypeScript (#11171)

* Add support for type only imports in TS (#11053)
* Implement "export type {}" (#11122)
* Add "exportKind: type" when needed with TS (#11157)
* Add `onlyRemoveTypeImports` option to `transform-typescript` (#11173)
* Add onlyRemoveTypeImports to preset-typescript (#11179)

Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Raja Sekar <rajasekarm.dev@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Henry Zhu <smiley.we@gmail.com>
Co-authored-by: Siddhant N Trivedi <sidntrivedi012@gmail.com>
This commit is contained in:
Nicolò Ribaudo
2020-03-16 22:58:51 +01:00
committed by GitHub
parent 20d9a10186
commit 740260b236
68 changed files with 1799 additions and 44 deletions

View File

@@ -382,7 +382,8 @@ defineType("ImportDeclaration", {
validate: assertNodeType("StringLiteral"),
},
importKind: {
// Handle Flowtype's extension "import {typeof foo} from"
// Handle TypeScript/Flowtype's extension "import type foo from"
// TypeScript doesn't support typeof
validate: assertOneOf("type", "typeof", "value"),
optional: true,
},