This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
forked from DianaSuvorova/eslint-plugin-react-redux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (48 loc) · 2.29 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const rules = {
'connect-prefer-minimum-two-arguments': require('./lib/rules/connect-prefer-minimum-two-arguments'),
'connect-prefer-named-arguments': require('./lib/rules/connect-prefer-named-arguments'),
'mapDispatchToProps-prefer-shorthand': require('./lib/rules/mapDispatchToProps-prefer-shorthand'),
'mapDispatchToProps-returns-object': require('./lib/rules/mapDispatchToProps-returns-object'),
'mapDispatchToProps-prefer-parameters-names': require('./lib/rules/mapDispatchToProps-prefer-parameters-names'),
'mapStateToProps-no-store': require('./lib/rules/mapStateToProps-no-store'),
'mapStateToProps-prefer-hoisted': require('./lib/rules/mapStateToProps-prefer-hoisted'),
'mapStateToProps-prefer-parameters-names': require('./lib/rules/mapStateToProps-prefer-parameters-names'),
'mapStateToProps-prefer-selectors': require('./lib/rules/mapStateToProps-prefer-selectors'),
'useSelector-prefer-selectors': require('./lib/rules/useSelector-prefer-selectors'),
'no-unused-prop-types': require('./lib/rules/no-unused-prop-types'),
'prefer-separate-component-file': require('./lib/rules/prefer-separate-component-file'),
};
function configureAsError() {
const result = {};
Object.keys(rules).forEach((key) => {
result[`@bolteu/react-redux/${key}`] = 2;
});
return result;
}
const activeRulesConfig = configureAsError();
module.exports = {
deprecatedRules: [],
rules,
configs: {
recommended: {
plugins: ['@bolteu/react-redux'],
rules: {
'@bolteu/react-redux/connect-prefer-minimum-two-arguments': 0,
'@bolteu/react-redux/connect-prefer-named-arguments': 2,
'@bolteu/react-redux/mapDispatchToProps-prefer-parameters-names': 2,
'@bolteu/react-redux/mapDispatchToProps-prefer-shorthand': 2,
'@bolteu/react-redux/mapDispatchToProps-returns-object': 2,
'@bolteu/react-redux/mapStateToProps-no-store': 2,
'@bolteu/react-redux/mapStateToProps-prefer-hoisted': 2,
'@bolteu/react-redux/mapStateToProps-prefer-parameters-names': 2,
'@bolteu/react-redux/useSelector-prefer-selectors': 2,
'@bolteu/react-redux/no-unused-prop-types': 2,
'@bolteu/react-redux/prefer-separate-component-file': 1,
},
},
all: {
plugins: ['@bolteu/react-redux'],
rules: activeRulesConfig,
},
},
};