-
Notifications
You must be signed in to change notification settings - Fork 3
/
frontend.js
98 lines (95 loc) · 2.54 KB
/
frontend.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = {
extends: './base.js',
env: {
browser: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
parser: 'babel-eslint',
plugins: ['react', 'react-hooks'],
rules: {
// Off
'react/jsx-sort-props': 'off',
// Errors
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-curly-brace-presence': ['error', { props: 'never' }],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 2,
'react/react-in-jsx-scope': 2,
'react/prop-types': 'error',
'jsx-quotes': [2, 'prefer-single'],
'promise/always-return': 0, // turned off due for redux
'no-shadow': 'error',
'react/prefer-stateless-function': 'error',
// Warnings - will become errors in next major version
// === Unspecified ===
// 'react/display-name'
// 'react/forbid-component-props '
// 'react/forbid-prop-types'
// 'react/jsx-boolean-value'
// 'react/jsx-closing-bracket-location'
// 'react/jsx-curly-spacing'
// 'react/jsx-equals-spacing'
// 'react/jsx-filename-extension'
// 'react/jsx-first-prop-new-line'
// 'react/jsx-handler-names'
// 'react/jsx-indent'
// 'react/jsx-indent-props'
// 'react/jsx-key'
// 'react/jsx-max-props-per-line'
// 'react/jsx-no-bind'
// 'react/jsx-no-comment-textnodes '
// 'react/jsx-no-duplicate-props'
// 'react/jsx-no-literals'
// 'react/jsx-no-target-blank'
// 'react/jsx-no-undef'
// 'react/jsx-pascal-case'
// 'react/jsx-space-before-closing'
// 'react/jsx-tag-spacing'
// 'react/jsx-wrap-multilines'
// 'react/no-children-prop'
// 'react/no-comment-textnodes'
// 'react/no-danger'
// 'react/no-danger-with-children'
// 'react/no-deprecated'
// 'react/no-did-mount-set-state'
// 'react/no-did-update-set-state'
// 'react/no-direct-mutation-state'
// 'react/no-find-dom-node'
// 'react/no-is-mounted'
// 'react/no-multi-comp'
// 'react/no-render-return-value'
// 'react/no-set-state'
// 'react/no-string-refs'
// 'react/no-unescaped-entities'
// 'react/no-unknown-property'
// 'react/no-unused-prop-types'
// 'react/prefer-es6-class'
// 'react/prefer-stateless-function'
// 'react/require-extension'
// 'react/require-optimization'
// 'react/require-render-return'
// 'react/self-closing-comp'
// 'react/sort-comp'
// 'react/sort-prop-types'
// 'react/style-prop-object'
// 'react/wrap-multilines'
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
react: {
pragma: 'React',
version: 'detect',
},
},
};