@@ -438,7 +438,7 @@ describe('TypeScript', () => {
438
438
439
439
test ( Object . assign ( {
440
440
code : 'import type T from "a";' ,
441
- options : [ {
441
+ options : [ {
442
442
packageDir : packageDirWithTypescriptDevDependencies ,
443
443
devDependencies : false ,
444
444
includeTypes : true ,
@@ -464,6 +464,16 @@ typescriptRuleTester.run('no-extraneous-dependencies typescript type imports', r
464
464
filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
465
465
parser : parsers . BABEL_OLD ,
466
466
} ) ,
467
+ test ( {
468
+ code : 'import { type MyType } from "not-a-dependency";' ,
469
+ filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
470
+ parser : parsers . BABEL_OLD ,
471
+ } ) ,
472
+ test ( {
473
+ code : 'import { type MyType, type OtherType } from "not-a-dependency";' ,
474
+ filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
475
+ parser : parsers . BABEL_OLD ,
476
+ } ) ,
467
477
] ,
468
478
invalid : [
469
479
test ( {
@@ -476,13 +486,29 @@ typescriptRuleTester.run('no-extraneous-dependencies typescript type imports', r
476
486
} ] ,
477
487
} ) ,
478
488
test ( {
479
- code : `import type { Foo } from 'not-a-dependency'` ,
489
+ code : `import type { Foo } from 'not-a-dependency'; ` ,
480
490
options : [ { includeTypes : true } ] ,
481
491
filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
482
492
parser : parsers . BABEL_OLD ,
483
493
errors : [ {
484
494
message : `'not-a-dependency' should be listed in the project's dependencies. Run 'npm i -S not-a-dependency' to add it` ,
485
495
} ] ,
486
496
} ) ,
497
+ test ( {
498
+ code : 'import Foo, { type MyType } from "not-a-dependency";' ,
499
+ filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
500
+ parser : parsers . BABEL_OLD ,
501
+ errors : [ {
502
+ message : `'not-a-dependency' should be listed in the project's dependencies. Run 'npm i -S not-a-dependency' to add it` ,
503
+ } ] ,
504
+ } ) ,
505
+ test ( {
506
+ code : 'import { type MyType, Foo } from "not-a-dependency";' ,
507
+ filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
508
+ parser : parsers . BABEL_OLD ,
509
+ errors : [ {
510
+ message : `'not-a-dependency' should be listed in the project's dependencies. Run 'npm i -S not-a-dependency' to add it` ,
511
+ } ] ,
512
+ } ) ,
487
513
] ,
488
514
} ) ;
0 commit comments