Skip to content

Commit

Permalink
Merge branch 'import-js:main' into feature/no_duplicates_require
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandemic1617 committed Nov 26, 2023
2 parents 98d4eab + 9fd3c42 commit dc1f757
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,68 @@ import {x,y} from './foo'
errors: ["'../constants' imported multiple times.", "'../constants' imported multiple times."],
...jsxConfig,
}),

test({
code: `
import {A1,} from 'foo';
import {B1,} from 'foo';
import {C1,} from 'foo';
import {
A2,
} from 'bar';
import {
B2,
} from 'bar';
import {
C2,
} from 'bar';
`,
output: `
import {A1,B1,C1} from 'foo';
${''}
import {
A2,
${''}
B2,
C2} from 'bar';
${''}
`,
errors: [
{
message: "'foo' imported multiple times.",
line: 2,
column: 27,
},
{
message: "'foo' imported multiple times.",
line: 3,
column: 27,
},
{
message: "'foo' imported multiple times.",
line: 4,
column: 27,
},
{
message: "'bar' imported multiple times.",
line: 8,
column: 16,
},
{
message: "'bar' imported multiple times.",
line: 11,
column: 16,
},
{
message: "'bar' imported multiple times.",
line: 14,
column: 16,
},
],
...jsxConfig,
}),
],
});

Expand Down

0 comments on commit dc1f757

Please sign in to comment.