Skip to content

Commit

Permalink
Strip Flow's new shorthand import-type specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmo committed Dec 24, 2016
1 parent b2e6926 commit e05422b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Expand Up @@ -57,7 +57,14 @@ export default function ({ types: t }) {
node = node.expression;
} while (t.isTypeCastExpression(node));
path.replaceWith(node);
}
},

ImportSpecifier(path) {
const { node } = path;
if (node.importKind !== null) {
path.remove();
}
},
}
};
}
Expand Up @@ -97,5 +97,9 @@ import type2, { foo3 } from "bar";
import type * as namespace from "bar";
export type { foo };
export type { foo2 } from "bar";
import {type T} from "foo";
import {type T2, V1} from "foo";
import {typeof V2} from "foo";
import {typeof V3, V4} from "foo";
export interface foo5 { p: number }
export interface foo6<T> { p: T }
Expand Up @@ -90,3 +90,8 @@ var identity;

import type from "foo";
import type2, { foo3 } from "bar";

import "foo";
import { V1 } from "foo";
import "foo";
import { V4 } from "foo";

0 comments on commit e05422b

Please sign in to comment.