Strip Flow's new shorthand import-type specifiers

This commit is contained in:
Jeff Morrison
2016-12-24 17:30:13 -06:00
parent d2113d4881
commit b820d8ebc9
4 changed files with 13 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ export let Pure = {
};
export let Flow = {
types: ["Flow", "ImportDeclaration", "ExportDeclaration"],
types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
checkPath({ node }: NodePath): boolean {
if (t.isFlow(node)) {
return true;
@@ -113,6 +113,8 @@ export let Flow = {
return node.importKind === "type" || node.importKind === "typeof";
} else if (t.isExportDeclaration(node)) {
return node.exportKind === "type";
} else if (t.isImportSpecifier(node)) {
return node.importKind === "type" || node.importKind === "typeof";
} else {
return false;
}