@@ -438,7 +438,7 @@ describe('TypeScript', () => {
438438
439439 test ( Object . assign ( {
440440 code : 'import type T from "a";' ,
441- options : [ {
441+ options : [ {
442442 packageDir : packageDirWithTypescriptDevDependencies ,
443443 devDependencies : false ,
444444 includeTypes : true ,
@@ -464,6 +464,16 @@ typescriptRuleTester.run('no-extraneous-dependencies typescript type imports', r
464464 filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
465465 parser : parsers . BABEL_OLD ,
466466 } ) ,
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+ } ) ,
467477 ] ,
468478 invalid : [
469479 test ( {
@@ -476,13 +486,29 @@ typescriptRuleTester.run('no-extraneous-dependencies typescript type imports', r
476486 } ] ,
477487 } ) ,
478488 test ( {
479- code : `import type { Foo } from 'not-a-dependency'` ,
489+ code : `import type { Foo } from 'not-a-dependency'; ` ,
480490 options : [ { includeTypes : true } ] ,
481491 filename : testFilePath ( './no-unused-modules/typescript/file-ts-a.ts' ) ,
482492 parser : parsers . BABEL_OLD ,
483493 errors : [ {
484494 message : `'not-a-dependency' should be listed in the project's dependencies. Run 'npm i -S not-a-dependency' to add it` ,
485495 } ] ,
486496 } ) ,
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+ } ) ,
487513 ] ,
488514} ) ;
0 commit comments