diff --git a/src/transform.js b/src/transform.js index ec6b1dc..a35ef26 100644 --- a/src/transform.js +++ b/src/transform.js @@ -692,10 +692,6 @@ const transform = { }, ExportDeclaration: { exit(path) { - if (path.node.exportKind == "type") { - path.node.exportKind = "value"; - } - if (path.node.source) { stripSuffixFromImportSource(path); } @@ -703,13 +699,13 @@ const transform = { }, ImportDeclaration: { exit(path) { - path.node.importKind = "value"; + // TODO(#223): Handle "typeof" imports stripSuffixFromImportSource(path); } }, ImportSpecifier: { exit(path) { - path.node.importKind = "value"; + // TODO(#223): Handle "typeof" imports } }, DeclareVariable: { diff --git a/test/fixtures/convert/imports/default_import/ts.js b/test/fixtures/convert/imports/default_import/ts.js index 47623ea..30ab763 100644 --- a/test/fixtures/convert/imports/default_import/ts.js +++ b/test/fixtures/convert/imports/default_import/ts.js @@ -1,2 +1,2 @@ -import A from "./depsA"; -import B from "../depsB"; \ No newline at end of file +import type A from "./depsA"; +import type B from "../depsB"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/export_type_from/ts.js b/test/fixtures/convert/imports/export_type_from/ts.js index 66b9885..f65fa18 100644 --- a/test/fixtures/convert/imports/export_type_from/ts.js +++ b/test/fixtures/convert/imports/export_type_from/ts.js @@ -1,2 +1,2 @@ -export { A, B } from "./depA"; -export { C, D } from "../depB"; \ No newline at end of file +export type { A, B } from "./depA"; +export type { C, D } from "../depB"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/import_node_module/ts.js b/test/fixtures/convert/imports/import_node_module/ts.js index e4fcf73..2b4ce46 100644 --- a/test/fixtures/convert/imports/import_node_module/ts.js +++ b/test/fixtures/convert/imports/import_node_module/ts.js @@ -1 +1 @@ -import A from "dep"; \ No newline at end of file +import type A from "dep"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/named_import_declaration_kind/ts.js b/test/fixtures/convert/imports/named_import_declaration_kind/ts.js index f0f61e9..c6adfd1 100644 --- a/test/fixtures/convert/imports/named_import_declaration_kind/ts.js +++ b/test/fixtures/convert/imports/named_import_declaration_kind/ts.js @@ -1,2 +1,2 @@ -import { A, B } from "./depA"; -import { C, D } from "../depB"; \ No newline at end of file +import type { A, B } from "./depA"; +import type { C, D } from "../depB"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/named_import_specifier_kind/ts.js b/test/fixtures/convert/imports/named_import_specifier_kind/ts.js index 9adbe55..6183462 100644 --- a/test/fixtures/convert/imports/named_import_specifier_kind/ts.js +++ b/test/fixtures/convert/imports/named_import_specifier_kind/ts.js @@ -1,2 +1,2 @@ -import { A, B, C } from "./depA"; -import { D, E, F } from "../depB"; \ No newline at end of file +import { type A, type B, C } from "./depA"; +import { type D, type E, F } from "../depB"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/typed_and_non_typed_imports/flow.js b/test/fixtures/convert/imports/typed_and_non_typed_imports/flow.js new file mode 100644 index 0000000..209b0f8 --- /dev/null +++ b/test/fixtures/convert/imports/typed_and_non_typed_imports/flow.js @@ -0,0 +1,2 @@ +import { A } from "./depA.js"; +import type { B } from "./depA.js"; \ No newline at end of file diff --git a/test/fixtures/convert/imports/typed_and_non_typed_imports/ts.js b/test/fixtures/convert/imports/typed_and_non_typed_imports/ts.js new file mode 100644 index 0000000..897dd56 --- /dev/null +++ b/test/fixtures/convert/imports/typed_and_non_typed_imports/ts.js @@ -0,0 +1,2 @@ +import { A } from "./depA"; +import type { B } from "./depA"; \ No newline at end of file