-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
61 lines (61 loc) · 2.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
58
59
60
61
module.exports = {
plugins: ["import", "react", "react-hooks"],
env: {
browser: true,
es6: true,
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
node: {
extensions: [".js", ".jsx"],
},
},
},
parserOptions: {
ecmaVersion: "latest",
ecmaFeatures: {
jsx: true,
},
sourceType: "module",
},
// https://github.com/benmosher/eslint-plugin-import/blob/master/config/errors.js
extends: ["plugin:import/errors"],
rules: {
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
"react/jsx-no-comment-textnodes": "warn",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
"react/jsx-no-duplicate-props": ["warn", { ignoreCase: true }],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
"react/jsx-no-target-blank": "warn",
//https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
"react/jsx-no-undef": "error",
//https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
"react/jsx-uses-vars": "warn",
//https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
"react/no-danger-with-children": "warn",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
"react/style-prop-object": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
"react/no-deprecated": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
"react/no-unescaped-entities": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
"react/no-unknown-property": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
"react/self-closing-comp": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
"react/void-dom-elements-no-children": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
"react/jsx-curly-brace-presence": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
"react/jsx-key": "warn",
//https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
"react/jsx-no-useless-fragment": "warn",
// https://www.npmjs.com/package/eslint-plugin-react-hooks
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
};