Strip Flow's new shorthand import-type specifiers
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"babel-messages": "^6.8.0",
|
||||
"babel-runtime": "^6.20.0",
|
||||
"babel-types": "^6.21.0",
|
||||
"babylon": "^6.11.0",
|
||||
"babylon": "^6.15.0",
|
||||
"debug": "^2.2.0",
|
||||
"globals": "^9.0.0",
|
||||
"invariant": "^2.2.0",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user