eslint-config-fe 2.1.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rules/react.js CHANGED
@@ -1,526 +1,525 @@
1
1
  module.exports = {
2
- rules: {
3
- /**
2
+ rules: {
3
+ /**
4
4
  * 检查hooks规则
5
5
  *
6
6
  * https://reactjs.org/docs/hooks-rules.html
7
7
  */
8
- 'react-hooks/rules-of-hooks': 'error',
9
-
10
- /**
8
+ 'react-hooks/rules-of-hooks': 'error',
9
+
10
+ /**
11
11
  * 检查副作用的依赖
12
12
  *
13
13
  * https://reactjs.org/docs/hooks-rules.html
14
14
  */
15
- 'react-hooks/exhaustive-deps': 'error',
16
-
17
- /**
15
+ 'react-hooks/exhaustive-deps': 'error',
16
+
17
+ /**
18
18
  * 关闭默认属性类型定义
19
19
  *
20
20
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md
21
21
  */
22
- 'react/default-props-match-prop-types': 'off',
23
-
24
- /**
22
+ 'react/default-props-match-prop-types': 'off',
23
+
24
+ /**
25
25
  * 关闭组件的displayName定义
26
26
  *
27
27
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
28
28
  */
29
- 'react/display-name': 'off',
30
-
31
- /**
29
+ 'react/display-name': 'off',
30
+
31
+ /**
32
32
  * 关闭限制自定义组件的 className、style 属性
33
33
  *
34
34
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
35
35
  */
36
- // 'react/forbid-component-props': 'off',
37
-
38
- /**
36
+ // 'react/forbid-component-props': 'off',
37
+
38
+ /**
39
39
  * 关闭禁止原生组件使用
40
40
  *
41
41
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md
42
42
  */
43
- 'react/forbid-elements': 'off',
44
-
45
- /**
43
+ 'react/forbid-elements': 'off',
44
+
45
+ /**
46
46
  * 检查所有的对象确保 propTypes 属性没有被使用
47
47
  *
48
48
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
49
49
  */
50
- 'react/forbid-foreign-prop-types': 'warn',
51
-
52
- /**
50
+ 'react/forbid-foreign-prop-types': 'warn',
51
+
52
+ /**
53
53
  * 关闭检查 propTypes 未被使用
54
54
  *
55
55
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
56
56
  */
57
- 'react/forbid-prop-types': 'off',
58
-
59
- /**
57
+ 'react/forbid-prop-types': 'off',
58
+
59
+ /**
60
60
  * 避免使用 true 作为属性值
61
61
  *
62
62
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
63
63
  */
64
- 'react/jsx-boolean-value': ['error', 'never'],
65
-
66
- /**
64
+ 'react/jsx-boolean-value': ['error', 'never'],
65
+
66
+ /**
67
67
  * 闭合标签和开标签对齐
68
68
  *
69
69
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
70
70
  */
71
- 'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
72
-
73
- /**
71
+ 'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
72
+
73
+ /**
74
74
  * 避免jsx模板大括号里面出现空格
75
75
  *
76
76
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
77
77
  */
78
- 'react/jsx-curly-spacing': ['error', 'never'],
79
-
80
- /**
78
+ 'react/jsx-curly-spacing': ['error', 'never'],
79
+
80
+ /**
81
81
  * 避免jsx模板等号周围出现空格
82
82
  *
83
83
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
84
84
  */
85
- 'react/jsx-equals-spacing': ['error', 'never'],
86
-
87
- /**
85
+ 'react/jsx-equals-spacing': ['error', 'never'],
86
+
87
+ /**
88
88
  * 限制哪些文件支持jsx语法
89
89
  *
90
90
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
91
91
  */
92
- 'react/jsx-filename-extension': [
93
- 'error',
94
- {
95
- extensions: ['.js', '.jsx', '.es', '.tsx']
96
- }
97
- ],
98
-
99
- /**
92
+ 'react/jsx-filename-extension': [
93
+ 'error',
94
+ {
95
+ extensions: ['.js', '.jsx', '.es', '.tsx']
96
+ }
97
+ ],
98
+
99
+ /**
100
100
  * 限制多行属性换行
101
101
  *
102
102
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
103
103
  */
104
- 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
105
-
106
- /**
104
+ 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
105
+
106
+ /**
107
107
  * 关闭组件中的事件属性前加上on
108
108
  *
109
109
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
110
110
  */
111
- 'react/jsx-handler-names': 'off',
112
-
113
- /**
111
+ 'react/jsx-handler-names': 'off',
112
+
113
+ /**
114
114
  * 限制jsx中的属性换行缩进为2
115
115
  *
116
116
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
117
117
  */
118
- 'react/jsx-indent-props': ['error', 2],
119
-
120
- /**
118
+ 'react/jsx-indent-props': ['error', 2],
119
+
120
+ /**
121
121
  * 限制jsx中的属性换行缩进为2
122
122
  *
123
123
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
124
124
  */
125
- 'react/jsx-indent': ['error', 2],
126
-
127
- /**
125
+ 'react/jsx-indent': ['error', 2],
126
+
127
+ /**
128
128
  * 避免缺少 key 属性
129
129
  *
130
130
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
131
131
  *
132
132
  */
133
- 'react/jsx-key': 'error',
134
-
135
- /**
133
+ 'react/jsx-key': 'error',
134
+
135
+ /**
136
136
  * 限制超过一个属性就换行
137
137
  *
138
138
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
139
139
  */
140
- 'react/jsx-max-props-per-line': [
141
- 'error',
142
- {
143
- when: 'multiline'
144
- }
145
- ],
146
-
147
- /**
140
+ 'react/jsx-max-props-per-line': [
141
+ 'error',
142
+ {
143
+ when: 'multiline'
144
+ }
145
+ ],
146
+
147
+ /**
148
148
  * 限制使用 bind 方法
149
149
  *
150
150
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
151
151
  */
152
- 'react/jsx-no-bind': [
153
- 'warn',
154
- {
155
- ignoreRefs: true,
156
- allowArrowFunctions: true,
157
- allowBind: false,
158
- ignoreDOMComponents: true
159
- }
160
- ],
161
-
162
- /**
152
+ 'react/jsx-no-bind': [
153
+ 'warn',
154
+ {
155
+ ignoreRefs: true,
156
+ allowArrowFunctions: true,
157
+ allowBind: false,
158
+ ignoreDOMComponents: true
159
+ }
160
+ ],
161
+
162
+ /**
163
163
  * 限制文本节点使用注释
164
164
  *
165
165
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
166
166
  */
167
- 'react/jsx-no-comment-textnodes': 'warn',
168
-
169
- /**
167
+ 'react/jsx-no-comment-textnodes': 'warn',
168
+
169
+ /**
170
170
  * 避免出现重复的 prop
171
171
  *
172
172
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
173
173
  */
174
- 'react/jsx-no-duplicate-props': [
175
- 'error',
176
- {
177
- ignoreCase: true
178
- }
179
- ],
180
-
181
- /**
174
+ 'react/jsx-no-duplicate-props': [
175
+ 'error',
176
+ {
177
+ ignoreCase: true
178
+ }
179
+ ],
180
+
181
+ /**
182
182
  * 关闭文本字符串转成模板字面量
183
183
  *
184
184
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
185
185
  */
186
- 'react/jsx-no-literals': 'off',
187
-
188
- /**
186
+ 'react/jsx-no-literals': 'off',
187
+
188
+ /**
189
189
  * 限制需要rel='noreferrer'
190
190
  *
191
191
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
192
192
  */
193
- 'react/jsx-no-target-blank': 'error',
194
-
195
- /**
193
+ 'react/jsx-no-target-blank': 'error',
194
+
195
+ /**
196
196
  * 不允许jsx中出现未声明的变量
197
197
  *
198
198
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
199
199
  */
200
- 'react/jsx-no-undef': 'error',
201
-
202
- /**
200
+ 'react/jsx-no-undef': 'error',
201
+
202
+ /**
203
203
  * 限制驼峰jsx标签名,忽略全大写加下划线
204
204
  *
205
205
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
206
206
  */
207
- 'react/jsx-pascal-case': [
208
- 'error',
209
- {
210
- allowAllCaps: true
211
- }
212
- ],
213
-
214
- /**
207
+ 'react/jsx-pascal-case': [
208
+ 'error',
209
+ {
210
+ allowAllCaps: true
211
+ }
212
+ ],
213
+
214
+ /**
215
215
  * 关闭检查属性顺序
216
216
  *
217
217
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
218
218
  */
219
- 'react/jsx-sort-props': 'off',
220
-
221
- /**
219
+ 'react/jsx-sort-props': 'off',
220
+
221
+ /**
222
222
  * 限制开标签结束前有空格
223
223
  *
224
224
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
225
225
  */
226
- 'react/jsx-tag-spacing': [
227
- 'error',
228
- {
229
- closingSlash: 'never',
230
- beforeSelfClosing: 'always',
231
- beforeClosing: 'never',
232
- afterOpening: 'never'
233
- }
234
- ],
235
-
236
- /**
226
+ 'react/jsx-tag-spacing': [
227
+ 'error',
228
+ {
229
+ closingSlash: 'never',
230
+ beforeSelfClosing: 'always',
231
+ beforeClosing: 'never',
232
+ afterOpening: 'never'
233
+ }
234
+ ],
235
+
236
+ /**
237
237
  * 限制定义 React 全局变量
238
238
  */
239
- 'react/jsx-uses-react': 'error',
240
-
241
- /**
239
+ 'react/jsx-uses-react': 'error',
240
+
241
+ /**
242
242
  * 避免jsx中变量未被使用
243
243
  *
244
244
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
245
245
  */
246
- 'react/jsx-uses-vars': 'error',
247
-
248
- /**
246
+ 'react/jsx-uses-vars': 'error',
247
+
248
+ /**
249
249
  * 限制用括号包裹jsx,并且jsx需要换行
250
250
  *
251
251
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
252
252
  */
253
- 'react/jsx-wrap-multilines': [
254
- 'error',
255
- {
256
- declaration: 'parens-new-line',
257
- assignment: 'parens-new-line',
258
- return: 'parens-new-line',
259
- arrow: 'parens-new-line'
260
- }
261
- ],
262
-
263
- /**
253
+ 'react/jsx-wrap-multilines': [
254
+ 'error',
255
+ {
256
+ declaration: 'parens-new-line',
257
+ assignment: 'parens-new-line',
258
+ return: 'parens-new-line',
259
+ arrow: 'parens-new-line'
260
+ }
261
+ ],
262
+
263
+ /**
264
264
  * 限制结束标签和开始标签对齐
265
265
  *
266
266
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
267
267
  */
268
- 'react/jsx-closing-tag-location': 'error',
269
-
270
- /**
268
+ 'react/jsx-closing-tag-location': 'error',
269
+
270
+ /**
271
271
  * 避免属性间出现多空格
272
272
  *
273
273
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
274
274
  */
275
- 'react/jsx-props-no-multi-spaces': 'error',
276
-
277
- /**
275
+ 'react/jsx-props-no-multi-spaces': 'error',
276
+
277
+ /**
278
278
  * 避免使用 index 作为 key
279
279
  *
280
280
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
281
281
  */
282
- 'react/no-array-index-key': 'error',
283
-
284
- /**
282
+ 'react/no-array-index-key': 'error',
283
+
284
+ /**
285
285
  * 避免出现 children 作为 prop
286
286
  *
287
287
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
288
288
  */
289
- 'react/no-children-prop': 'error',
290
-
291
- /**
289
+ 'react/no-children-prop': 'error',
290
+
291
+ /**
292
292
  * 避免 dangerouslySetInnerHTML 属性和 children 共存
293
293
  *
294
294
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
295
295
  */
296
- 'react/no-danger-with-children': 'error',
297
-
298
- /**
296
+ 'react/no-danger-with-children': 'error',
297
+
298
+ /**
299
299
  * 避免使用过时的方法
300
300
  *
301
301
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
302
302
  */
303
- 'react/no-deprecated': 'warn',
304
-
305
- /**
303
+ 'react/no-deprecated': 'warn',
304
+
305
+ /**
306
306
  * 关闭不允许 componentDidMount 中使用 setState
307
307
  *
308
308
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
309
309
  */
310
- 'react/no-did-mount-set-state': 'off',
311
-
312
- /**
310
+ 'react/no-did-mount-set-state': 'off',
311
+
312
+ /**
313
313
  * 关闭不允许 componentDidUpdate 中使用 setState
314
314
  *
315
315
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
316
316
  */
317
- 'react/no-did-update-set-state': 'off',
318
-
319
- /**
317
+ 'react/no-did-update-set-state': 'off',
318
+
319
+ /**
320
320
  * 避免在 componentWillUpdate 使用 setState
321
321
  *
322
322
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
323
323
  */
324
- 'react/no-will-update-set-state': 'error',
325
-
326
- /**
324
+ 'react/no-will-update-set-state': 'error',
325
+
326
+ /**
327
327
  * 避免直接对 this.state 赋值
328
328
  *
329
329
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
330
330
  */
331
- 'react/no-direct-mutation-state': 'error',
332
-
333
- /**
331
+ 'react/no-direct-mutation-state': 'error',
332
+
333
+ /**
334
334
  * 警告使用 findDOMNode
335
335
  *
336
336
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
337
337
  */
338
- 'react/no-find-dom-node': 'warn',
339
-
340
- /**
338
+ 'react/no-find-dom-node': 'warn',
339
+
340
+ /**
341
341
  * 避免使用 isMounted
342
342
  *
343
343
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
344
344
  */
345
- 'react/no-is-mounted': 'error',
346
-
347
- /**
345
+ 'react/no-is-mounted': 'error',
346
+
347
+ /**
348
348
  * 限制一个文件里面定义一个class组件
349
349
  *
350
350
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
351
351
  */
352
- 'react/no-multi-comp': [
353
- 'error',
354
- {
355
- ignoreStateless: true
356
- }
357
- ],
358
-
359
- /**
352
+ 'react/no-multi-comp': [
353
+ 'error',
354
+ {
355
+ ignoreStateless: true
356
+ }
357
+ ],
358
+
359
+ /**
360
360
  * 避免使用 ReactDOM.render 返回值
361
361
  *
362
362
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
363
363
  */
364
- 'react/no-render-return-value': 'error',
365
-
366
- /**
364
+ 'react/no-render-return-value': 'error',
365
+
366
+ /**
367
367
  * 关闭使用不必要的 setState
368
368
  *
369
369
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
370
370
  */
371
- 'react/no-set-state': 'off',
372
-
373
- /**
371
+ 'react/no-set-state': 'off',
372
+
373
+ /**
374
374
  * 避免 ref 绑定一个字符串
375
375
  *
376
376
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
377
377
  */
378
- 'react/no-string-refs': 'error',
379
-
380
- /**
378
+ 'react/no-string-refs': 'error',
379
+
380
+ /**
381
381
  * 避免标签中出现没有转义的符号
382
382
  *
383
383
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
384
384
  */
385
- 'react/no-unescaped-entities': 'error',
386
-
387
- /**
385
+ 'react/no-unescaped-entities': 'error',
386
+
387
+ /**
388
388
  * 避免DOM标签出现未知属性
389
389
  *
390
390
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
391
391
  */
392
- 'react/no-unknown-property': 'error',
393
-
394
- /**
392
+ 'react/no-unknown-property': 'error',
393
+
394
+ /**
395
395
  * 关闭检查proptypes定义
396
396
  *
397
397
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
398
398
  */
399
- 'react/no-unused-prop-types': 'off',
400
-
401
- /**
399
+ 'react/no-unused-prop-types': 'off',
400
+
401
+ /**
402
402
  * 限制使用 class 语法定义类组件
403
403
  *
404
404
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
405
405
  */
406
- 'react/prefer-es6-class': ['error', 'always'],
407
-
408
- /**
406
+ 'react/prefer-es6-class': ['error', 'always'],
407
+
408
+ /**
409
409
  * 限制没有state的情况下使用函数组件代替类组件
410
410
  *
411
411
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
412
412
  */
413
- 'react/prefer-stateless-function': 'error',
414
- /**
413
+ 'react/prefer-stateless-function': 'error',
414
+ /**
415
415
  * 关闭声明 propTypes
416
416
  *
417
417
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
418
418
  */
419
- 'react/prop-types': 'off',
420
-
421
- /**
419
+ 'react/prop-types': 'off',
420
+
421
+ /**
422
422
  * 关闭使用jsx语法时需要导入React
423
423
  *
424
424
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
425
425
  */
426
- 'react/react-in-jsx-scope': 'off',
427
-
428
- /**
426
+ 'react/react-in-jsx-scope': 'off',
427
+
428
+ /**
429
429
  * 关闭强制定义defaultProps
430
430
  *
431
431
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
432
432
  */
433
- 'react/require-default-props': 'off',
434
-
435
- /**
433
+ 'react/require-default-props': 'off',
434
+
435
+ /**
436
436
  * 关闭强制类组件需要有 shouldComponentUpdate 方法
437
437
  *
438
438
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
439
439
  */
440
- 'react/require-optimization': 'off',
441
-
442
- /**
440
+ 'react/require-optimization': 'off',
441
+
442
+ /**
443
443
  * 限制 render 方法中需要返回值
444
444
  *
445
445
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
446
446
  */
447
- 'react/require-render-return': 'error',
448
-
449
- /**
447
+ 'react/require-render-return': 'error',
448
+
449
+ /**
450
450
  * 限制没有 children 的组件存在关闭标签
451
451
  *
452
452
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
453
453
  */
454
- 'react/self-closing-comp': [
455
- 'error',
456
- {
457
- component: true,
458
- html: false
459
- }
460
- ],
461
-
462
- /**
454
+ 'react/self-closing-comp': [
455
+ 'error',
456
+ {
457
+ component: true,
458
+ html: false
459
+ }
460
+ ],
461
+
462
+ /**
463
463
  * 关闭 propTypes 排序
464
464
  *
465
465
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
466
466
  */
467
- 'react/sort-prop-types': 'off',
468
-
469
- /**
467
+ 'react/sort-prop-types': 'off',
468
+
469
+ /**
470
470
  * 限制 style 属性绑定一个对象
471
471
  *
472
472
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
473
473
  */
474
- 'react/style-prop-object': 'error',
475
-
476
- /**
474
+ 'react/style-prop-object': 'error',
475
+
476
+ /**
477
477
  * 避免部分DOM节点包含 children
478
478
  */
479
- 'react/void-dom-elements-no-children': 'error',
480
-
481
- /**
479
+ 'react/void-dom-elements-no-children': 'error',
480
+
481
+ /**
482
482
  * 关闭组件方法排序
483
483
  *
484
484
  * https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
485
485
  */
486
- 'react/sort-comp': [
487
- 'off',
488
- {
489
- order: [
490
- 'static-properties',
491
- 'static-methods',
492
- 'state',
493
- 'properties',
494
- 'lifecycle',
495
- 'everything-else',
496
- 'render'
497
- ],
498
- groups: {
499
- 'static-properties': [
500
- 'displayName',
501
- 'propTypes',
502
- 'contextTypes',
503
- 'childContextTypes',
504
- 'mixins',
505
- 'statics'
506
- ],
507
- lifecycle: [
508
- 'getDefaultProps',
509
- 'getInitialState',
510
- 'constructor',
511
- 'getChildContext',
512
- 'componentWillMount',
513
- 'componentDidMount',
514
- 'componentWillReceiveProps',
515
- 'shouldComponentUpdate',
516
- 'componentWillUpdate',
517
- 'componentDidUpdate',
518
- 'componentDidCatch',
519
- 'componentWillUnmount'
520
- ]
521
- }
522
- }
523
- ]
524
- }
525
- };
526
-
486
+ 'react/sort-comp': [
487
+ 'off',
488
+ {
489
+ order: [
490
+ 'static-properties',
491
+ 'static-methods',
492
+ 'state',
493
+ 'properties',
494
+ 'lifecycle',
495
+ 'everything-else',
496
+ 'render'
497
+ ],
498
+ groups: {
499
+ 'static-properties': [
500
+ 'displayName',
501
+ 'propTypes',
502
+ 'contextTypes',
503
+ 'childContextTypes',
504
+ 'mixins',
505
+ 'statics'
506
+ ],
507
+ lifecycle: [
508
+ 'getDefaultProps',
509
+ 'getInitialState',
510
+ 'constructor',
511
+ 'getChildContext',
512
+ 'componentWillMount',
513
+ 'componentDidMount',
514
+ 'componentWillReceiveProps',
515
+ 'shouldComponentUpdate',
516
+ 'componentWillUpdate',
517
+ 'componentDidUpdate',
518
+ 'componentDidCatch',
519
+ 'componentWillUnmount'
520
+ ]
521
+ }
522
+ }
523
+ ]
524
+ }
525
+ };