Don't consider flow types as bindings
This commit is contained in:
2
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/actual.js
vendored
Normal file
2
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare class foo {}
|
||||
const foo = 1;
|
||||
1
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/expected.js
vendored
Normal file
1
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/expected.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var foo = 1;
|
||||
3
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/options.json
vendored
Normal file
3
packages/babel-plugin-check-es2015-constants/test/fixtures/general/flow-declar/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["check-es2015-constants", "transform-es2015-block-scoping", "transform-flow-strip-types"]
|
||||
}
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user