Fix bug with importing empty type (#904)

This commit is contained in:
Brian Ng authored and Christopher Chedeau committed 2017-03-05 19:08:42 -08:00
1 parent c852d1631c
commit f6bbc2ed2e
3 files changed
+5

No files matched your search

+2
View File
@@ -529,6 +529,8 @@ function genericPrintNoParens(path, options, print) {
}
fromParts.push(grouped.length === 0 ? line : " ", "from ");
} else if (n.importKind && n.importKind === "type") {
parts.push("{} from ");
}
fromParts.push(path.call(print, "source"), ";");
@@ -353,12 +353,14 @@ exports[`import_type_specifier.js 1`] = `
*/
import { Foo, type Baz } from \\"../module\\";
import type {} from 'foo';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* @flow
*/
import { Foo, type Baz } from \\"../module\\";
import type {} from \\"foo\\";
"
`;
@@ -3,3 +3,4 @@
*/
import { Foo, type Baz } from "../module";
import type {} from 'foo';