-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (50 loc) · 1.78 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
52
53
54
55
56
57
import reactRules from 'eslint-plugin-react';
// import { rules as importRule } from 'eslint-plugin-import';
import eslint from './eslint';
import reactHooksRule from 'eslint-plugin-react-hooks';
import airbnbBP from 'eslint-config-airbnb-base/rules/best-practices';
import airbnbERR from 'eslint-config-airbnb-base/rules/errors';
import airbnbES from 'eslint-config-airbnb-base/rules/es6';
// import airbnbImports from 'eslint-config-airbnb-base/rules/imports';
import airbnbNode from 'eslint-config-airbnb-base/rules/node';
import airbnbStrict from 'eslint-config-airbnb-base/rules/strict';
import airbnbStyle from 'eslint-config-airbnb-base/rules/style';
import airbnbVariables from 'eslint-config-airbnb-base/rules/variables';
import airbnbReact from 'eslint-config-airbnb/rules/react';
import airbnbReactHooks from 'eslint-config-airbnb/rules/react-hooks';
export const rules = {};
Object.assign(rules,
airbnbBP.rules,
airbnbERR.rules,
airbnbES.rules,
// airbnbImports.rules,
airbnbNode.rules,
airbnbStrict.rules,
airbnbStyle.rules,
airbnbVariables.rules,
airbnbReact.rules,
airbnbReactHooks.rules,
);
export const esLinter = new eslint.Linter();
Object.keys(reactRules.rules).forEach(ruleKey => {
esLinter.defineRule(`react/${ruleKey}`, reactRules.rules[ruleKey]);
});
Object.keys(reactHooksRule.rules).forEach(ruleKey => {
esLinter.defineRule(`react-hooks/${ruleKey}`, reactHooksRule.rules[ruleKey]);
});
export const config = {
rules,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
env: {
browser: true
},
}
// Object.keys(importRule.rules).forEach(ruleKey => {
// esLinter.defineRule(`import/${ruleKey}`, importRule.rules[ruleKey]);
// });