Skip to content

Commit 9c78340

Browse files
ertrzyiksljharb
authored andcommitted
fixup! [Fix] no-duplicates: ensure autofix avoids excessive newlines
1 parent 2bb3a8a commit 9c78340

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

tests/src/rules/no-duplicates.js

+10-13
Original file line numberDiff line numberDiff line change
@@ -302,32 +302,30 @@ ruleTester.run('no-duplicates', rule, {
302302

303303
test({
304304
code: `
305-
import {x} from './foo'
306-
import {y} from './foo'
307-
// some-tool-disable-next-line
305+
import {x} from './foo'
306+
import {y} from './foo'
307+
// some-tool-disable-next-line
308308
`,
309309
// Not autofix bail.
310310
output: `
311-
import {x,y} from './foo'
312-
313-
// some-tool-disable-next-line
311+
import {x,y} from './foo'
312+
// some-tool-disable-next-line
314313
`,
315314
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
316315
}),
317316

318317
test({
319318
code: `
320-
import {x} from './foo'
321-
// comment
319+
import {x} from './foo'
320+
// comment
322321
323-
import {y} from './foo'
322+
import {y} from './foo'
324323
`,
325324
// Not autofix bail.
326325
output: `
327-
import {x,y} from './foo'
328-
// comment
326+
import {x,y} from './foo'
327+
// comment
329328
330-
331329
`,
332330
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
333331
}),
@@ -401,7 +399,6 @@ ruleTester.run('no-duplicates', rule, {
401399
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
402400
}),
403401

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

0 commit comments

Comments
 (0)