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 7297422
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 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

0 comments on commit 7297422

Please sign in to comment.