@@ -79,6 +79,11 @@ const mockImportDeclaration = {
79
79
} ,
80
80
} ;
81
81
82
+ const mockImportDeclarationImportKindType = {
83
+ importKind : 'type' ,
84
+ ...mockImportDeclaration
85
+ } ;
86
+
82
87
describe ( 'create' , ( ) => {
83
88
it ( 'should return object' , ( ) => {
84
89
const created = create ( { options : [ [ ] ] } )
@@ -455,4 +460,31 @@ describe('create.ImportDeclaration', () => {
455
460
expect ( getFilename ) . toBeCalledTimes ( 1 )
456
461
expect ( report ) . not . toBeCalled ( )
457
462
} )
463
+
464
+ it ( 'should not report if excludeTypeImportChecks is true' , ( ) => {
465
+ resolveImportPath . mockReturnValue ( 'src/components/ui/Text' )
466
+ const getFilename = jest . fn ( ( ) =>
467
+ path . join ( process . cwd ( ) , 'src/pages/index.tsx' )
468
+ )
469
+ const report = jest . fn ( )
470
+ const { ImportDeclaration : checkImport } = create ( {
471
+ options : [
472
+ [
473
+ {
474
+ module : 'src/components/ui' ,
475
+ allowReferenceFrom : [ 'src/aaa' ] ,
476
+ allowSameModule : false ,
477
+ excludeTypeImportChecks : true ,
478
+ } ,
479
+ ] ,
480
+ ] ,
481
+ getFilename,
482
+ report,
483
+ } )
484
+
485
+ checkImport ( mockImportDeclarationImportKindType )
486
+
487
+ expect ( getFilename ) . toBeCalledTimes ( 1 )
488
+ expect ( report ) . not . toBeCalled ( )
489
+ } )
458
490
} )
0 commit comments