Skip to content

Commit

Permalink
fixup! [Fix] no-duplicates: ensure autofix avoids excessive newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ertrzyiks committed May 16, 2021
1 parent d2c6a50 commit b9de5e4
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tests/src/rules/no-duplicates.js
Expand Up @@ -302,32 +302,30 @@ ruleTester.run('no-duplicates', rule, {

test({
code: `
import {x} from './foo'
import {y} from './foo'
// some-tool-disable-next-line
import {x} from './foo'
import {y} from './foo'
// some-tool-disable-next-line
`,
// Not autofix bail.
output: `
import {x,y} from './foo'
// some-tool-disable-next-line
import {x,y} from './foo'
// some-tool-disable-next-line
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),

test({
code: `
import {x} from './foo'
// comment
import {x} from './foo'
// comment
import {y} from './foo'
import {y} from './foo'
`,
// Not autofix bail.
output: `
import {x,y} from './foo'
// comment
import {x,y} from './foo'
// comment
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),
Expand Down Expand Up @@ -401,7 +399,6 @@ ruleTester.run('no-duplicates', rule, {
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),


// #2027 long import list generate empty lines
test({
code: "import { Foo } from './foo';\nimport { Bar } from './foo';\nexport const value = {}",
Expand Down

0 comments on commit b9de5e4

Please sign in to comment.