Skip to content

Commit 4d0a47a

Browse files
committed
add some testes
1 parent a5bad73 commit 4d0a47a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/src/rules/no-duplicates.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,41 @@ context('TypeScript', function () {
572572
},
573573
],
574574
}),
575+
test({
576+
code: "import {type x} from 'foo'; import type {y} from 'foo'",
577+
...parserConfig,
578+
output: `import {type x,y} from 'foo'; `,
579+
errors: [
580+
{
581+
line: 1,
582+
column: 22,
583+
message: "'foo' imported multiple times.",
584+
},
585+
{
586+
line: 1,
587+
column: 50,
588+
message: "'foo' imported multiple times.",
589+
},
590+
],
591+
}),
592+
test({
593+
code: "import {type x} from './foo'; import {type y} from './foo'",
594+
...parserConfig,
595+
options: [{ 'prefer-inline': true }],
596+
output: `import {type x,type y} from './foo'; `,
597+
errors: [
598+
{
599+
line: 1,
600+
column: 22,
601+
message: "'./foo' imported multiple times.",
602+
},
603+
{
604+
line: 1,
605+
column: 52,
606+
message: "'./foo' imported multiple times.",
607+
},
608+
],
609+
}),
575610
test({
576611
code: "import {type x} from './foo'; import {type y} from './foo'",
577612
...parserConfig,

0 commit comments

Comments
 (0)