Skip to content

Commit

Permalink
fixup! fixup! Remove empty line after import
Browse files Browse the repository at this point in the history
  • Loading branch information
ertrzyiks committed Apr 15, 2021
1 parent 3f75b3e commit ea2cab3
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ ruleTester.run('no-duplicates', rule, {
// Not autofix bail.
output: `
import {x,y} from './foo'
// some-tool-disable-next-line
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
Expand All @@ -327,7 +327,7 @@ ruleTester.run('no-duplicates', rule, {
import {x,y} from './foo'
// comment
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),
Expand Down Expand Up @@ -411,3 +411,31 @@ ruleTester.run('no-duplicates', rule, {
],
});

context('TypeScript', function() {
getNonDefaultParsers()
.filter((parser) => parser !== require.resolve('typescript-eslint-parser'))
.forEach((parser) => {
const parserConfig = {
parser: parser,
settings: {
'import/parsers': { [parser]: ['.ts'] },
'import/resolver': { 'eslint-import-resolver-typescript': true },
},
};

ruleTester.run('no-duplicates', rule, {
valid: [
// #1667: ignore duplicate if is a typescript type import
test(
{
code: "import type { x } from './foo'; import y from './foo'",
parser,
},
parserConfig,
),
],
invalid: [],
});
});
});

0 comments on commit ea2cab3

Please sign in to comment.