This repository was archived by the owner on Sep 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-0
lines changed
test/mixed-fixtures/syntax-flow Expand file tree Collapse file tree 5 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 22
22
"babel-core" : " ^6.18.2" ,
23
23
"babel-plugin-add-module-exports" : " ~0.2.1" ,
24
24
"babel-plugin-lodash" : " 3.2.10" ,
25
+ "babel-plugin-syntax-flow" : " ^6.18.0" ,
25
26
"babel-plugin-syntax-jsx" : " ^6.18.0" ,
26
27
"babel-plugin-transform-object-rest-spread" : " ^6.19.0" ,
27
28
"babel-plugin-transform-runtime" : " ^6.15.0" ,
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ export default function lodash({ types }) {
74
74
_ . each ( specs , spec => {
75
75
const { imported, local } = spec ;
76
76
const binding = file . scope . getBinding ( local ) ;
77
+ const { importKind = 'value' } = binding . path . parent ;
78
+
79
+ // Skip type specifiers.
80
+ if ( importKind != 'value' ) {
81
+ return ;
82
+ }
77
83
const isChain = isLodash && imported == 'chain' ;
78
84
79
85
_ . each ( binding . referencePaths , refPath => {
Original file line number Diff line number Diff line change
1
+ {
2
+ "plugins" : [
3
+ " syntax-flow"
4
+ ],
5
+ "presets" : [
6
+ " es2015"
7
+ ]
8
+ }
Original file line number Diff line number Diff line change
1
+ import type { Predicate } from 'lodash' ;
2
+
3
+ function a ( b : Predicate < * > ) { }
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ function a ( b : Predicate < * > ) { }
You can’t perform that action at this time.
0 commit comments