Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit ffa194c

Browse files
committed
fix configuration for disabling duplicate imports
1 parent c7d4837 commit ffa194c

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

src/flow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
'flowtype',
44
],
55
rules: {
6+
'no-duplicate-imports': 'off', // to support separate imports of types
67
'flowtype/array-style-complex-type': 'off',
78
'flowtype/array-style-simple-type': 'off',
89
'flowtype/arrow-parens': ['error', 'always'],

src/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module.exports = {
125125
'no-dupe-class-members': 'error',
126126
'no-dupe-keys': 'error',
127127
'no-duplicate-case': 'error',
128-
'no-duplicate-imports': 'off',
128+
'no-duplicate-imports': 'error',
129129
'no-else-return': ['error', {
130130
allowElseIf: false,
131131
}],

src/typescript.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = {
1818
},
1919
],
2020
rules: {
21-
'no-duplicate-imports': 'error',
2221
'@typescript-eslint/adjacent-overload-signatures': 'error',
2322
'@typescript-eslint/array-type': ['error', {
2423
default: 'array-simple',

tests/flow.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ describe('Rules Configurations', () => {
1111
describe('flow', () => {
1212
const localRules = Object.keys(localConfig.rules);
1313
const pluginRules = Object.keys(plugin.rules).map((ruleName) => `flowtype/${ruleName}`);
14+
const overridenRuleNames = [
15+
'no-duplicate-imports',
16+
];
1417

1518
it('has configuration for all supported rules', () => {
1619
const notConfiguredPluginRules = pluginRules.filter((ruleName) => !localRules.includes(ruleName));
@@ -19,7 +22,9 @@ describe('Rules Configurations', () => {
1922
});
2023

2124
it('does not have configuration for not existing rules', () => {
22-
const extraLocalRules = localRules.filter((ruleName) => !pluginRules.includes(ruleName));
25+
const extraLocalRules = localRules
26+
.filter((ruleName) => !pluginRules.includes(ruleName))
27+
.filter((ruleName) => !overridenRuleNames.includes(ruleName));
2328

2429
expect(extraLocalRules).toEqual([]);
2530
});

tests/typescript.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ describe('Rules Configurations', () => {
1515
'brace-style',
1616
'func-call-spacing',
1717
'indent',
18-
'no-duplicate-imports',
1918
'no-empty-function',
2019
'quotes',
2120
'require-await',

0 commit comments

Comments
 (0)