-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
216 lines (215 loc) · 5.74 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
'use strict';
module.exports = {
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
parser: 'babel-eslint',
env: {
es6: true,
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:import/errors',
],
plugins: [
'babel',
'react',
'import',
],
settings: {
react: {
version: 'detect',
},
},
rules: {
'no-cond-assign': 2,
'no-console': 1,
'no-debugger': 2,
'no-irregular-whitespace': 2,
'no-unexpected-multiline': 2,
'no-unsafe-negation': 2,
'valid-jsdoc': [2, {
requireParamDescription: false,
requireReturn: false,
prefer: { returns: 'return' },
}],
'class-methods-use-this': [2, {
exceptMethods: [
'constructor',
'componentWillMount',
'render',
'componentDidMount',
'componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'render',
'componentDidUpdate',
'componentWillUnmount',
'componentDidCatch',
],
}],
curly: 2,
'default-case': 2,
'dot-notation': 2,
eqeqeq: 2,
'guard-for-in': 2,
'no-alert': 1,
'no-caller': 2,
'no-empty-function': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-label': 2,
'no-global-assign': 2,
'no-invalid-this': 0,
'no-labels': 2,
'no-loop-func': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-new-func': 2,
'no-new-wrappers': 2,
'no-new': 2,
'no-return-assign': 0,
'no-throw-literal': 2,
'no-unmodified-loop-condition': 2,
'no-useless-concat': 2,
'no-void': 2,
'no-warning-comments': 1,
'no-with': 2,
radix: [2, 'as-needed'],
'no-shadow': 0,
'no-undef': 2,
'no-undefined': 2,
'no-unused-vars': [2, { args: 'after-used' }],
'no-use-before-define': 2,
'array-bracket-spacing': [2, 'never'],
'brace-style': 2,
camelcase: 2,
'comma-dangle': [2, 'always-multiline'],
'comma-spacing': 2,
'comma-style': 2,
'computed-property-spacing': 2,
'consistent-this': 2,
'eol-last': 2,
'func-call-spacing': 2,
indent: [2, 2, { SwitchCase: 1 }],
'jsx-quotes': [2, 'prefer-double'],
'key-spacing': 2,
'keyword-spacing': 2,
'linebreak-style': 2,
'max-len': [2, {
code: 120,
tabWidth: 2,
ignoreComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'new-cap': 0,
'new-parens': 2,
'no-array-constructor': 2,
'no-lonely-if': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multiple-empty-lines': [2, { max: 2 }],
'no-nested-ternary': 2,
'no-new-object': 2,
'no-trailing-spaces': 2,
'no-unneeded-ternary': 2,
'no-whitespace-before-property': 2,
'object-curly-spacing': 0,
'one-var': [2, {
var: 'never',
let: 'never',
const: 'never',
}],
'operator-linebreak': [2, 'before'],
'padded-blocks': [2, 'never'],
'quote-props': [2, 'as-needed'],
quotes: [2, 'single', { allowTemplateLiterals: true }],
semi: 0,
'semi-spacing': 2,
'space-before-blocks': 2,
'space-before-function-paren': [2, {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'spaced-comment': [2, 'always'],
'arrow-body-style': [2, 'as-needed'],
'arrow-parens': [2, 'as-needed'],
'arrow-spacing': 2,
'constructor-super': 2,
'generator-star-spacing': [2, 'before'],
'no-duplicate-imports': 2,
'no-new-symbol': 2,
'no-this-before-super': 2,
'no-useless-constructor': 2,
'no-var': 2,
'object-shorthand': [2, 'always'],
'prefer-const': 2,
'prefer-rest-params': 2,
'prefer-spread': 2,
'prefer-template': 2,
'rest-spread-spacing': 2,
'yield-star-spacing': [2, 'before'],
'react/forbid-prop-types': [2, { forbid: ['any', 'array', 'object'] }],
'react/no-access-state-in-setstate': 2,
'react/no-children-prop': 2,
'react/no-danger-with-children': 2,
'react/no-deprecated': 2,
'react/no-direct-mutation-state': 2,
'react/no-typos': 2,
'react/no-string-refs': 2,
'react/no-will-update-set-state': 2,
'react/prop-types': [2, {}],
'react/react-in-jsx-scope': 2,
'react/require-render-return': 2,
'react/self-closing-comp': 2,
'react/sort-comp': [2, {
order: [
'static-methods',
'lifecycle',
'everything-else',
'/^render.+$/',
'render',
],
}],
'react/jsx-boolean-value': [2, 'never'],
'react/jsx-closing-bracket-location': [2, 'line-aligned'],
'react/jsx-closing-tag-location': 2,
'react/jsx-curly-spacing': [2, 'never'],
'react/jsx-equals-spacing': [2, 'never'],
'react/jsx-first-prop-new-line': [2, 'multiline'],
'react/jsx-indent': [2, 2],
'react/jsx-key': 2,
'react/jsx-no-bind': [2, { ignoreRefs: true }],
'react/jsx-no-duplicate-props': 2,
'react/jsx-no-target-blank': 2,
'react/jsx-pascal-case': 2,
'import/no-unresolved': [2, { commonjs: true, amd: true }],
'import/named': 2,
'import/default': 2,
'import/export': 2,
'import/no-named-as-default': 2,
'import/no-named-as-default-member': 2,
'import/no-extraneous-dependencies': 2,
'import/first': 2,
'import/no-duplicates': 2,
'import/no-namespace': 2,
'import/extensions': [2, { js: 'never', jsx: 'never', json: 'never' }],
'import/newline-after-import': 2,
'import/no-named-default': 2,
'import/order': [2, { 'newlines-between': 'always' }],
'babel/object-curly-spacing': [2, 'always'],
'babel/no-invalid-this': 2,
'babel/semi': 2,
},
};