Skip to content

Commit 519d256

Browse files
committed
[Tests] no-duplicates: add passing test case from #2601
1 parent afa2cc2 commit 519d256

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/src/rules/no-duplicates.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as path from 'path';
22
import { test as testUtil, getNonDefaultParsers, parsers } from '../utils';
3+
import jsxConfig from '../../../config/react';
34

45
import { RuleTester } from 'eslint';
56
import eslintPkg from 'eslint/package.json';
@@ -412,6 +413,44 @@ import {x,y} from './foo'
412413
output: "import Bar, { Foo } from './foo';\nexport const value = {}",
413414
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
414415
}),
416+
417+
test({
418+
code: `
419+
import {
420+
DEFAULT_FILTER_KEYS,
421+
BULK_DISABLED,
422+
} from '../constants';
423+
import React from 'react';
424+
import {
425+
BULK_ACTIONS_ENABLED
426+
} from '../constants';
427+
428+
const TestComponent = () => {
429+
return <div>
430+
</div>;
431+
}
432+
433+
export default TestComponent;
434+
`,
435+
output: `
436+
import {
437+
DEFAULT_FILTER_KEYS,
438+
BULK_DISABLED,
439+
440+
BULK_ACTIONS_ENABLED
441+
} from '../constants';
442+
import React from 'react';
443+
444+
const TestComponent = () => {
445+
return <div>
446+
</div>;
447+
}
448+
449+
export default TestComponent;
450+
`,
451+
errors: ["'../constants' imported multiple times.", "'../constants' imported multiple times."],
452+
...jsxConfig,
453+
}),
415454
],
416455
});
417456

0 commit comments

Comments
 (0)