Don't consider flow types as bindings

This commit is contained in:
Amjad Masad
2016-03-10 11:47:33 -08:00
parent 986ac9950a
commit 342f9d5eb5
4 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
declare class foo {}
const foo = 1;

View File

@@ -0,0 +1 @@
var foo = 1;

View File

@@ -0,0 +1,3 @@
{
"plugins": ["check-es2015-constants", "transform-es2015-block-scoping", "transform-flow-strip-types"]
}

View File

@@ -48,6 +48,9 @@ let collectorVisitor = {
// this will be hit again once we traverse into it after this iteration
if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return;
// Skip flow declarations
if (path.isFlow()) return;
// we've ran into a declaration!
path.scope.getFunctionParent().registerDeclaration(path);
},