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 authored and ljharb committed May 16, 2021
1 parent 2bb3a8a commit 9c78340
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
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 9c78340

Please sign in to comment.