eslint-config-entva 2.18.0 → 2.18.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +495 -493
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,517 +1,519 @@
|
|
1
|
-
import { ignoreRule, mainRule, testRule } from 'eslint-config-entva-base';
|
1
|
+
import { ignoreRule, mainRule as baseMainRule, testRule } from 'eslint-config-entva-base';
|
2
2
|
import react from 'eslint-plugin-react';
|
3
3
|
import jsxA11Y from 'eslint-plugin-jsx-a11y';
|
4
4
|
import reactHooks from 'eslint-plugin-react-hooks';
|
5
5
|
import importPlugin from 'eslint-plugin-import';
|
6
6
|
import globals from 'globals';
|
7
7
|
|
8
|
-
export
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
'react-hooks': reactHooks,
|
17
|
-
import: importPlugin,
|
18
|
-
},
|
8
|
+
export const mainRule = {
|
9
|
+
files: ['**/*.{js,mjs,cjs,jsx}'],
|
10
|
+
plugins: {
|
11
|
+
react,
|
12
|
+
'jsx-a11y': jsxA11Y,
|
13
|
+
'react-hooks': reactHooks,
|
14
|
+
import: importPlugin,
|
15
|
+
},
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
languageOptions: {
|
18
|
+
globals: {
|
19
|
+
...globals.browser,
|
20
|
+
...globals.node,
|
21
|
+
},
|
25
22
|
|
26
|
-
|
27
|
-
|
23
|
+
ecmaVersion: 'latest',
|
24
|
+
sourceType: 'module',
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
},
|
26
|
+
parserOptions: {
|
27
|
+
ecmaFeatures: {
|
28
|
+
generators: false,
|
29
|
+
objectLiteralDuplicateProperties: false,
|
30
|
+
jsx: true,
|
35
31
|
},
|
36
32
|
},
|
33
|
+
},
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
},
|
35
|
+
settings: {
|
36
|
+
'import/resolver': {
|
37
|
+
node: {
|
38
|
+
extensions: ['.js', '.mjs', '.cjs', '.jsx', '.json'],
|
43
39
|
},
|
40
|
+
},
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
react: {
|
50
|
-
pragma: 'React',
|
51
|
-
version: 'detect',
|
52
|
-
},
|
42
|
+
'import/extensions': ['.js', '.mjs', '.cjs', '.jsx', '.json'],
|
43
|
+
'import/core-modules': [],
|
44
|
+
'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
|
53
45
|
|
54
|
-
|
46
|
+
react: {
|
47
|
+
pragma: 'React',
|
48
|
+
version: 'detect',
|
55
49
|
},
|
56
50
|
|
57
|
-
|
58
|
-
|
59
|
-
html: 'enforce',
|
60
|
-
custom: 'enforce',
|
61
|
-
explicitSpread: 'ignore',
|
62
|
-
exceptions: [],
|
63
|
-
}],
|
64
|
-
|
65
|
-
'react/forbid-prop-types': ['off', {
|
66
|
-
forbid: ['any', 'array', 'object'],
|
67
|
-
checkContextTypes: true,
|
68
|
-
checkChildContextTypes: true,
|
69
|
-
}],
|
70
|
-
|
71
|
-
'react/require-default-props': ['off', {
|
72
|
-
forbidDefaultForRequired: true,
|
73
|
-
}],
|
74
|
-
|
75
|
-
'react/no-array-index-key': ['off'],
|
76
|
-
|
77
|
-
'react/jsx-no-bind': ['off', {
|
78
|
-
ignoreRefs: true,
|
79
|
-
allowArrowFunctions: true,
|
80
|
-
allowFunctions: false,
|
81
|
-
allowBind: false,
|
82
|
-
ignoreDOMComponents: true,
|
83
|
-
}],
|
84
|
-
|
85
|
-
'react/prop-types': ['off', {
|
86
|
-
ignore: [],
|
87
|
-
customValidators: [],
|
88
|
-
skipUndeclared: false,
|
89
|
-
}],
|
90
|
-
|
91
|
-
'react/react-in-jsx-scope': ['off'],
|
92
|
-
|
93
|
-
'react/function-component-definition': [2, {
|
94
|
-
namedComponents: 'arrow-function',
|
95
|
-
}],
|
96
|
-
|
97
|
-
'react/jsx-max-props-per-line': ['error', {
|
98
|
-
maximum: 1,
|
99
|
-
when: 'multiline',
|
100
|
-
}],
|
101
|
-
|
102
|
-
'react/jsx-uses-react': ['off'],
|
103
|
-
|
104
|
-
'react/no-unstable-nested-components': ['error', {
|
105
|
-
allowAsProps: true,
|
106
|
-
}],
|
107
|
-
|
108
|
-
'react/no-unused-class-component-methods': ['off'],
|
109
|
-
'react-hooks/exhaustive-deps': 'off',
|
110
|
-
|
111
|
-
'react/display-name': 'off',
|
112
|
-
|
113
|
-
'react/jsx-one-expression-per-line': ['off', {
|
114
|
-
allow: 'single-child',
|
115
|
-
}],
|
116
|
-
|
117
|
-
'jsx-a11y/anchor-is-valid': ['off', {
|
118
|
-
components: ['Link'],
|
119
|
-
specialLink: ['to'],
|
120
|
-
aspects: ['noHref', 'invalidHref', 'preferButton'],
|
121
|
-
}],
|
122
|
-
|
123
|
-
'jsx-a11y/anchor-has-content': ['off', {
|
124
|
-
components: [],
|
125
|
-
}],
|
126
|
-
|
127
|
-
'jsx-a11y/no-static-element-interactions': ['off', {
|
128
|
-
handlers: [
|
129
|
-
'onClick',
|
130
|
-
'onMouseDown',
|
131
|
-
'onMouseUp',
|
132
|
-
'onKeyPress',
|
133
|
-
'onKeyDown',
|
134
|
-
'onKeyUp',
|
135
|
-
],
|
136
|
-
}],
|
137
|
-
|
138
|
-
'jsx-a11y/click-events-have-key-events': ['off'],
|
139
|
-
|
140
|
-
'jsx-a11y/media-has-caption': ['off', {
|
141
|
-
audio: [],
|
142
|
-
video: [],
|
143
|
-
track: [],
|
144
|
-
}],
|
145
|
-
|
146
|
-
'jsx-a11y/no-noninteractive-element-interactions': ['off', {
|
147
|
-
handlers: [
|
148
|
-
'onClick',
|
149
|
-
'onMouseDown',
|
150
|
-
'onMouseUp',
|
151
|
-
'onKeyPress',
|
152
|
-
'onKeyDown',
|
153
|
-
'onKeyUp',
|
154
|
-
],
|
155
|
-
}],
|
156
|
-
|
157
|
-
'jsx-a11y/label-has-for': ['off', {
|
158
|
-
components: [],
|
159
|
-
|
160
|
-
required: {
|
161
|
-
every: ['nesting', 'id'],
|
162
|
-
},
|
163
|
-
|
164
|
-
allowChildren: false,
|
165
|
-
}],
|
166
|
-
|
167
|
-
'jsx-a11y/label-has-associated-control': ['off', {
|
168
|
-
labelComponents: [],
|
169
|
-
labelAttributes: [],
|
170
|
-
controlComponents: [],
|
171
|
-
assert: 'both',
|
172
|
-
depth: 25,
|
173
|
-
}],
|
174
|
-
|
175
|
-
'jsx-a11y/control-has-associated-label': ['off', {
|
176
|
-
labelAttributes: ['label'],
|
177
|
-
controlComponents: [],
|
178
|
-
ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
179
|
-
|
180
|
-
ignoreRoles: [
|
181
|
-
'grid',
|
182
|
-
'listbox',
|
183
|
-
'menu',
|
184
|
-
'menubar',
|
185
|
-
'radiogroup',
|
186
|
-
'row',
|
187
|
-
'tablist',
|
188
|
-
'toolbar',
|
189
|
-
'tree',
|
190
|
-
'treegrid',
|
191
|
-
],
|
51
|
+
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
|
52
|
+
},
|
192
53
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
54
|
+
rules: {
|
55
|
+
'react/jsx-props-no-spreading': ['off', {
|
56
|
+
html: 'enforce',
|
57
|
+
custom: 'enforce',
|
58
|
+
explicitSpread: 'ignore',
|
59
|
+
exceptions: [],
|
60
|
+
}],
|
61
|
+
|
62
|
+
'react/forbid-prop-types': ['off', {
|
63
|
+
forbid: ['any', 'array', 'object'],
|
64
|
+
checkContextTypes: true,
|
65
|
+
checkChildContextTypes: true,
|
66
|
+
}],
|
67
|
+
|
68
|
+
'react/require-default-props': ['off', {
|
69
|
+
forbidDefaultForRequired: true,
|
70
|
+
}],
|
71
|
+
|
72
|
+
'react/no-array-index-key': ['off'],
|
73
|
+
|
74
|
+
'react/jsx-no-bind': ['off', {
|
75
|
+
ignoreRefs: true,
|
76
|
+
allowArrowFunctions: true,
|
77
|
+
allowFunctions: false,
|
78
|
+
allowBind: false,
|
79
|
+
ignoreDOMComponents: true,
|
80
|
+
}],
|
81
|
+
|
82
|
+
'react/prop-types': ['off', {
|
83
|
+
ignore: [],
|
84
|
+
customValidators: [],
|
85
|
+
skipUndeclared: false,
|
86
|
+
}],
|
87
|
+
|
88
|
+
'react/react-in-jsx-scope': ['off'],
|
89
|
+
|
90
|
+
'react/function-component-definition': [2, {
|
91
|
+
namedComponents: 'arrow-function',
|
92
|
+
}],
|
93
|
+
|
94
|
+
'react/jsx-max-props-per-line': ['error', {
|
95
|
+
maximum: 1,
|
96
|
+
when: 'multiline',
|
97
|
+
}],
|
98
|
+
|
99
|
+
'react/jsx-uses-react': ['off'],
|
100
|
+
|
101
|
+
'react/no-unstable-nested-components': ['error', {
|
102
|
+
allowAsProps: true,
|
103
|
+
}],
|
104
|
+
|
105
|
+
'react/no-unused-class-component-methods': ['off'],
|
106
|
+
'react-hooks/exhaustive-deps': 'off',
|
107
|
+
|
108
|
+
'react/display-name': 'off',
|
109
|
+
|
110
|
+
'react/jsx-one-expression-per-line': ['off', {
|
111
|
+
allow: 'single-child',
|
112
|
+
}],
|
113
|
+
|
114
|
+
'jsx-a11y/anchor-is-valid': ['off', {
|
115
|
+
components: ['Link'],
|
116
|
+
specialLink: ['to'],
|
117
|
+
aspects: ['noHref', 'invalidHref', 'preferButton'],
|
118
|
+
}],
|
119
|
+
|
120
|
+
'jsx-a11y/anchor-has-content': ['off', {
|
121
|
+
components: [],
|
122
|
+
}],
|
123
|
+
|
124
|
+
'jsx-a11y/no-static-element-interactions': ['off', {
|
125
|
+
handlers: [
|
126
|
+
'onClick',
|
127
|
+
'onMouseDown',
|
128
|
+
'onMouseUp',
|
129
|
+
'onKeyPress',
|
130
|
+
'onKeyDown',
|
131
|
+
'onKeyUp',
|
132
|
+
],
|
133
|
+
}],
|
134
|
+
|
135
|
+
'jsx-a11y/click-events-have-key-events': ['off'],
|
136
|
+
|
137
|
+
'jsx-a11y/media-has-caption': ['off', {
|
138
|
+
audio: [],
|
139
|
+
video: [],
|
140
|
+
track: [],
|
141
|
+
}],
|
142
|
+
|
143
|
+
'jsx-a11y/no-noninteractive-element-interactions': ['off', {
|
144
|
+
handlers: [
|
145
|
+
'onClick',
|
146
|
+
'onMouseDown',
|
147
|
+
'onMouseUp',
|
148
|
+
'onKeyPress',
|
149
|
+
'onKeyDown',
|
150
|
+
'onKeyUp',
|
151
|
+
],
|
152
|
+
}],
|
153
|
+
|
154
|
+
'jsx-a11y/label-has-for': ['off', {
|
155
|
+
components: [],
|
156
|
+
|
157
|
+
required: {
|
158
|
+
every: ['nesting', 'id'],
|
159
|
+
},
|
198
160
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
161
|
+
allowChildren: false,
|
162
|
+
}],
|
163
|
+
|
164
|
+
'jsx-a11y/label-has-associated-control': ['off', {
|
165
|
+
labelComponents: [],
|
166
|
+
labelAttributes: [],
|
167
|
+
controlComponents: [],
|
168
|
+
assert: 'both',
|
169
|
+
depth: 25,
|
170
|
+
}],
|
171
|
+
|
172
|
+
'jsx-a11y/control-has-associated-label': ['off', {
|
173
|
+
labelAttributes: ['label'],
|
174
|
+
controlComponents: [],
|
175
|
+
ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
176
|
+
|
177
|
+
ignoreRoles: [
|
178
|
+
'grid',
|
179
|
+
'listbox',
|
180
|
+
'menu',
|
181
|
+
'menubar',
|
182
|
+
'radiogroup',
|
183
|
+
'row',
|
184
|
+
'tablist',
|
185
|
+
'toolbar',
|
186
|
+
'tree',
|
187
|
+
'treegrid',
|
188
|
+
],
|
189
|
+
|
190
|
+
depth: 5,
|
191
|
+
}],
|
192
|
+
|
193
|
+
'react-hooks/rules-of-hooks': ['error'],
|
194
|
+
'jsx-a11y/accessible-emoji': ['off'],
|
195
|
+
|
196
|
+
'jsx-a11y/alt-text': 'off',
|
197
|
+
|
198
|
+
'jsx-a11y/aria-activedescendant-has-tabindex': ['error'],
|
199
|
+
'jsx-a11y/aria-props': ['error'],
|
200
|
+
'jsx-a11y/aria-proptypes': ['error'],
|
201
|
+
|
202
|
+
'jsx-a11y/aria-role': ['error', {
|
203
|
+
ignoreNonDOM: false,
|
204
|
+
}],
|
205
|
+
|
206
|
+
'jsx-a11y/aria-unsupported-elements': ['error'],
|
207
|
+
|
208
|
+
'jsx-a11y/autocomplete-valid': ['off', {
|
209
|
+
inputComponents: [],
|
210
|
+
}],
|
211
|
+
|
212
|
+
'jsx-a11y/heading-has-content': ['error', {
|
213
|
+
components: [''],
|
214
|
+
}],
|
215
|
+
|
216
|
+
'jsx-a11y/html-has-lang': ['error'],
|
217
|
+
'jsx-a11y/iframe-has-title': ['error'],
|
218
|
+
'jsx-a11y/img-redundant-alt': ['error'],
|
219
|
+
'jsx-a11y/interactive-supports-focus': ['error'],
|
220
|
+
'jsx-a11y/lang': ['error'],
|
221
|
+
'jsx-a11y/mouse-events-have-key-events': ['error'],
|
222
|
+
'jsx-a11y/no-access-key': ['error'],
|
223
|
+
|
224
|
+
'jsx-a11y/no-autofocus': ['error', {
|
225
|
+
ignoreNonDOM: true,
|
226
|
+
}],
|
227
|
+
|
228
|
+
'jsx-a11y/no-distracting-elements': ['error', {
|
229
|
+
elements: ['marquee', 'blink'],
|
230
|
+
}],
|
231
|
+
|
232
|
+
'jsx-a11y/no-interactive-element-to-noninteractive-role': ['error', {
|
233
|
+
tr: ['none', 'presentation'],
|
234
|
+
}],
|
235
|
+
|
236
|
+
'jsx-a11y/no-noninteractive-element-to-interactive-role': ['error', {
|
237
|
+
ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
238
|
+
ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
239
|
+
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
|
240
|
+
table: ['grid'],
|
241
|
+
td: ['gridcell'],
|
242
|
+
}],
|
243
|
+
|
244
|
+
'jsx-a11y/no-noninteractive-tabindex': ['error', {
|
245
|
+
tags: [],
|
246
|
+
roles: ['tabpanel'],
|
247
|
+
}],
|
248
|
+
|
249
|
+
'jsx-a11y/no-onchange': ['off'],
|
250
|
+
'jsx-a11y/no-redundant-roles': ['error'],
|
251
|
+
'jsx-a11y/role-has-required-aria-props': ['error'],
|
252
|
+
'jsx-a11y/role-supports-aria-props': ['error'],
|
253
|
+
'jsx-a11y/scope': ['error'],
|
254
|
+
'jsx-a11y/tabindex-no-positive': ['error'],
|
255
|
+
|
256
|
+
'react/forbid-dom-props': ['off', {
|
257
|
+
forbid: [],
|
258
|
+
}],
|
259
|
+
|
260
|
+
'react/jsx-boolean-value': ['error', 'never', {
|
261
|
+
always: [],
|
262
|
+
}],
|
263
|
+
|
264
|
+
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
265
|
+
'react/jsx-closing-tag-location': ['error'],
|
266
|
+
|
267
|
+
'react/jsx-curly-spacing': ['error', 'never', {
|
268
|
+
allowMultiline: true,
|
269
|
+
}],
|
270
|
+
|
271
|
+
'react/jsx-handler-names': ['off', {
|
272
|
+
eventHandlerPrefix: 'handle',
|
273
|
+
eventHandlerPropPrefix: 'on',
|
274
|
+
}],
|
275
|
+
|
276
|
+
'react/jsx-indent-props': ['error', 2],
|
277
|
+
'react/jsx-key': ['off'],
|
278
|
+
|
279
|
+
'react/jsx-no-duplicate-props': ['error', {
|
280
|
+
ignoreCase: true,
|
281
|
+
}],
|
282
|
+
|
283
|
+
'react/jsx-no-literals': ['off', {
|
284
|
+
noStrings: true,
|
285
|
+
}],
|
286
|
+
|
287
|
+
'react/jsx-no-undef': ['error'],
|
288
|
+
|
289
|
+
'react/jsx-pascal-case': ['error', {
|
290
|
+
allowAllCaps: true,
|
291
|
+
ignore: [],
|
292
|
+
}],
|
293
|
+
|
294
|
+
'react/sort-prop-types': ['off', {
|
295
|
+
ignoreCase: true,
|
296
|
+
callbacksLast: false,
|
297
|
+
requiredFirst: false,
|
298
|
+
sortShapeProp: true,
|
299
|
+
}],
|
300
|
+
|
301
|
+
'react/jsx-sort-prop-types': ['off'],
|
302
|
+
|
303
|
+
'react/jsx-sort-props': ['off', {
|
304
|
+
ignoreCase: true,
|
305
|
+
callbacksLast: false,
|
306
|
+
shorthandFirst: false,
|
307
|
+
shorthandLast: false,
|
308
|
+
noSortAlphabetically: false,
|
309
|
+
reservedFirst: true,
|
310
|
+
}],
|
311
|
+
|
312
|
+
'react/jsx-sort-default-props': ['off', {
|
313
|
+
ignoreCase: true,
|
314
|
+
}],
|
315
|
+
|
316
|
+
'react/jsx-uses-vars': ['error'],
|
317
|
+
'react/no-danger': ['warn'],
|
318
|
+
'react/no-deprecated': ['error'],
|
319
|
+
'react/no-did-mount-set-state': ['off'],
|
320
|
+
'react/no-did-update-set-state': ['error'],
|
321
|
+
'react/no-will-update-set-state': ['error'],
|
322
|
+
'react/no-direct-mutation-state': ['off'],
|
323
|
+
'react/no-is-mounted': ['error'],
|
324
|
+
'react/no-multi-comp': ['off'],
|
325
|
+
'react/no-set-state': ['off'],
|
326
|
+
'react/no-string-refs': ['error'],
|
327
|
+
'react/no-unknown-property': ['error'],
|
328
|
+
'react/prefer-es6-class': ['error', 'always'],
|
329
|
+
|
330
|
+
'react/prefer-stateless-function': ['error', {
|
331
|
+
ignorePureComponents: true,
|
332
|
+
}],
|
333
|
+
|
334
|
+
'react/require-render-return': ['error'],
|
335
|
+
'react/self-closing-comp': ['error'],
|
336
|
+
|
337
|
+
'react/sort-comp': ['error', {
|
338
|
+
order: [
|
339
|
+
'static-variables',
|
340
|
+
'static-methods',
|
341
|
+
'instance-variables',
|
342
|
+
'lifecycle',
|
343
|
+
'/^handle.+$/',
|
344
|
+
'/^on.+$/',
|
345
|
+
'getters',
|
346
|
+
'setters',
|
347
|
+
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
|
348
|
+
'instance-methods',
|
349
|
+
'everything-else',
|
350
|
+
'rendering',
|
351
|
+
],
|
352
|
+
|
353
|
+
groups: {
|
354
|
+
lifecycle: [
|
355
|
+
'displayName',
|
356
|
+
'propTypes',
|
357
|
+
'contextTypes',
|
358
|
+
'childContextTypes',
|
359
|
+
'mixins',
|
360
|
+
'statics',
|
361
|
+
'defaultProps',
|
362
|
+
'constructor',
|
363
|
+
'getDefaultProps',
|
364
|
+
'getInitialState',
|
365
|
+
'state',
|
366
|
+
'getChildContext',
|
367
|
+
'getDerivedStateFromProps',
|
368
|
+
'componentWillMount',
|
369
|
+
'UNSAFE_componentWillMount',
|
370
|
+
'componentDidMount',
|
371
|
+
'componentWillReceiveProps',
|
372
|
+
'UNSAFE_componentWillReceiveProps',
|
373
|
+
'shouldComponentUpdate',
|
374
|
+
'componentWillUpdate',
|
375
|
+
'UNSAFE_componentWillUpdate',
|
376
|
+
'getSnapshotBeforeUpdate',
|
377
|
+
'componentDidUpdate',
|
378
|
+
'componentDidCatch',
|
379
|
+
'componentWillUnmount',
|
354
380
|
],
|
355
381
|
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
'react/jsx-child-element-spacing': ['off'],
|
486
|
-
'react/no-this-in-sfc': ['error'],
|
487
|
-
'react/jsx-max-depth': ['off'],
|
488
|
-
'react/jsx-props-no-multi-spaces': ['error'],
|
489
|
-
'react/no-unsafe': ['off'],
|
490
|
-
'react/jsx-fragments': ['error', 'syntax'],
|
491
|
-
|
492
|
-
'react/jsx-curly-newline': ['error', {
|
493
|
-
multiline: 'consistent',
|
494
|
-
singleline: 'consistent',
|
495
|
-
}],
|
496
|
-
|
497
|
-
'react/state-in-constructor': ['error', 'always'],
|
498
|
-
'react/static-property-placement': ['error', 'property assignment'],
|
499
|
-
'react/prefer-read-only-props': ['off'],
|
500
|
-
|
501
|
-
'react/jsx-no-script-url': ['error', [{
|
502
|
-
name: 'Link',
|
503
|
-
props: ['to'],
|
504
|
-
}]],
|
505
|
-
|
506
|
-
'react/jsx-no-useless-fragment': ['error'],
|
507
|
-
'react/no-adjacent-inline-elements': ['off'],
|
508
|
-
'react/jsx-newline': ['off'],
|
509
|
-
'react/jsx-no-constructed-context-values': ['error'],
|
510
|
-
'react/no-namespace': ['error'],
|
511
|
-
'react/prefer-exact-props': ['error'],
|
512
|
-
'react/no-arrow-function-lifecycle': ['error'],
|
513
|
-
'react/no-invalid-html-attribute': ['error'],
|
514
|
-
},
|
382
|
+
rendering: ['/^render.+$/', 'render'],
|
383
|
+
},
|
384
|
+
}],
|
385
|
+
|
386
|
+
'react/jsx-wrap-multilines': ['error', {
|
387
|
+
declaration: 'parens-new-line',
|
388
|
+
assignment: 'parens-new-line',
|
389
|
+
return: 'parens-new-line',
|
390
|
+
arrow: 'parens-new-line',
|
391
|
+
condition: 'parens-new-line',
|
392
|
+
logical: 'parens-new-line',
|
393
|
+
prop: 'parens-new-line',
|
394
|
+
}],
|
395
|
+
|
396
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
|
397
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
398
|
+
'react/jsx-indent': ['error', 2],
|
399
|
+
|
400
|
+
'react/jsx-no-target-blank': ['error', {
|
401
|
+
enforceDynamicLinks: 'always',
|
402
|
+
links: true,
|
403
|
+
forms: false,
|
404
|
+
}],
|
405
|
+
|
406
|
+
'react/jsx-filename-extension': ['error', {
|
407
|
+
extensions: ['.jsx'],
|
408
|
+
}],
|
409
|
+
|
410
|
+
'react/jsx-no-comment-textnodes': ['error'],
|
411
|
+
'react/no-render-return-value': ['error'],
|
412
|
+
|
413
|
+
'react/require-optimization': ['off', {
|
414
|
+
allowDecorators: [],
|
415
|
+
}],
|
416
|
+
|
417
|
+
'react/no-find-dom-node': ['error'],
|
418
|
+
|
419
|
+
'react/forbid-component-props': ['off', {
|
420
|
+
forbid: [],
|
421
|
+
}],
|
422
|
+
|
423
|
+
'react/forbid-elements': ['off', {
|
424
|
+
forbid: [],
|
425
|
+
}],
|
426
|
+
|
427
|
+
'react/no-danger-with-children': ['error'],
|
428
|
+
|
429
|
+
'react/no-unused-prop-types': ['error', {
|
430
|
+
customValidators: [],
|
431
|
+
skipShapeProps: true,
|
432
|
+
}],
|
433
|
+
|
434
|
+
'react/style-prop-object': ['error'],
|
435
|
+
'react/no-unescaped-entities': ['error'],
|
436
|
+
'react/no-children-prop': ['error'],
|
437
|
+
|
438
|
+
'react/jsx-tag-spacing': ['error', {
|
439
|
+
closingSlash: 'never',
|
440
|
+
beforeSelfClosing: 'always',
|
441
|
+
afterOpening: 'never',
|
442
|
+
beforeClosing: 'never',
|
443
|
+
}],
|
444
|
+
|
445
|
+
'react/jsx-space-before-closing': ['off', 'always'],
|
446
|
+
|
447
|
+
'react/forbid-foreign-prop-types': ['warn', {
|
448
|
+
allowInPropTypes: true,
|
449
|
+
}],
|
450
|
+
|
451
|
+
'react/void-dom-elements-no-children': ['error'],
|
452
|
+
|
453
|
+
'react/default-props-match-prop-types': ['error', {
|
454
|
+
allowRequiredDefaults: false,
|
455
|
+
}],
|
456
|
+
|
457
|
+
'react/no-redundant-should-component-update': ['error'],
|
458
|
+
'react/no-unused-state': ['error'],
|
459
|
+
|
460
|
+
'react/boolean-prop-naming': ['off', {
|
461
|
+
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
|
462
|
+
rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+',
|
463
|
+
message: '',
|
464
|
+
}],
|
465
|
+
|
466
|
+
'react/no-typos': ['error'],
|
467
|
+
|
468
|
+
'react/jsx-curly-brace-presence': ['error', {
|
469
|
+
props: 'never',
|
470
|
+
children: 'never',
|
471
|
+
}],
|
472
|
+
|
473
|
+
'react/destructuring-assignment': ['error', 'always'],
|
474
|
+
'react/no-access-state-in-setstate': ['error'],
|
475
|
+
|
476
|
+
'react/button-has-type': ['error', {
|
477
|
+
button: true,
|
478
|
+
submit: true,
|
479
|
+
reset: false,
|
480
|
+
}],
|
481
|
+
|
482
|
+
'react/jsx-child-element-spacing': ['off'],
|
483
|
+
'react/no-this-in-sfc': ['error'],
|
484
|
+
'react/jsx-max-depth': ['off'],
|
485
|
+
'react/jsx-props-no-multi-spaces': ['error'],
|
486
|
+
'react/no-unsafe': ['off'],
|
487
|
+
'react/jsx-fragments': ['error', 'syntax'],
|
488
|
+
|
489
|
+
'react/jsx-curly-newline': ['error', {
|
490
|
+
multiline: 'consistent',
|
491
|
+
singleline: 'consistent',
|
492
|
+
}],
|
493
|
+
|
494
|
+
'react/state-in-constructor': ['error', 'always'],
|
495
|
+
'react/static-property-placement': ['error', 'property assignment'],
|
496
|
+
'react/prefer-read-only-props': ['off'],
|
497
|
+
|
498
|
+
'react/jsx-no-script-url': ['error', [{
|
499
|
+
name: 'Link',
|
500
|
+
props: ['to'],
|
501
|
+
}]],
|
502
|
+
|
503
|
+
'react/jsx-no-useless-fragment': ['error'],
|
504
|
+
'react/no-adjacent-inline-elements': ['off'],
|
505
|
+
'react/jsx-newline': ['off'],
|
506
|
+
'react/jsx-no-constructed-context-values': ['error'],
|
507
|
+
'react/no-namespace': ['error'],
|
508
|
+
'react/prefer-exact-props': ['error'],
|
509
|
+
'react/no-arrow-function-lifecycle': ['error'],
|
510
|
+
'react/no-invalid-html-attribute': ['error'],
|
515
511
|
},
|
512
|
+
};
|
513
|
+
|
514
|
+
export default [
|
515
|
+
ignoreRule,
|
516
|
+
baseMainRule,
|
517
|
+
mainRule,
|
516
518
|
testRule,
|
517
519
|
];
|