@@ -35,11 +35,11 @@ function checkImports(imported, context) {
35
35
}
36
36
37
37
function checkTypeImports ( imported , context ) {
38
- for ( const [ module , nodes ] of imported . entries ( ) ) {
38
+ Array . from ( imported ) . forEach ( ( [ module , nodes ] ) => {
39
39
const typeImports = nodes . filter ( ( node ) => node . importKind === 'type' ) ;
40
40
if ( nodes . length > 1 ) {
41
- const someInlineTypeImports = nodes . filter ( ( node ) => node . specifiers . some ( ( spec ) => spec . importKind === 'type' ) ) ;
42
- if ( typeImports . length > 0 && someInlineTypeImports . length > 0 ) {
41
+ const someInlineTypeImports = nodes . some ( ( node ) => node . specifiers . some ( ( spec ) => spec . importKind === 'type' ) ) ;
42
+ if ( typeImports . length > 0 && someInlineTypeImports ) {
43
43
const message = `'${ module } ' imported multiple times.` ;
44
44
const sourceCode = context . getSourceCode ( ) ;
45
45
const fix = getTypeFix ( nodes , sourceCode , context ) ;
@@ -59,11 +59,11 @@ function checkTypeImports(imported, context) {
59
59
} ) ;
60
60
}
61
61
}
62
- }
62
+ } ) ;
63
63
}
64
64
65
65
function checkInlineTypeImports ( imported , context ) {
66
- for ( const [ module , nodes ] of imported . entries ( ) ) {
66
+ Array . from ( imported ) . forEach ( ( [ module , nodes ] ) => {
67
67
if ( nodes . length > 1 ) {
68
68
const message = `'${ module } ' imported multiple times.` ;
69
69
const sourceCode = context . getSourceCode ( ) ;
@@ -83,7 +83,7 @@ function checkInlineTypeImports(imported, context) {
83
83
} ) ;
84
84
} ) ;
85
85
}
86
- }
86
+ } ) ;
87
87
}
88
88
89
89
function isComma ( token ) {
0 commit comments