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.
Files changed (2) hide show
  1. package/index.js +495 -493
  2. 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 default [
9
- ignoreRule,
10
- mainRule,
11
- {
12
- files: ['**/*.{js,mjs,cjs,jsx}'],
13
- plugins: {
14
- react,
15
- 'jsx-a11y': jsxA11Y,
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
- languageOptions: {
21
- globals: {
22
- ...globals.browser,
23
- ...globals.node,
24
- },
17
+ languageOptions: {
18
+ globals: {
19
+ ...globals.browser,
20
+ ...globals.node,
21
+ },
25
22
 
26
- ecmaVersion: 'latest',
27
- sourceType: 'module',
23
+ ecmaVersion: 'latest',
24
+ sourceType: 'module',
28
25
 
29
- parserOptions: {
30
- ecmaFeatures: {
31
- generators: false,
32
- objectLiteralDuplicateProperties: false,
33
- jsx: true,
34
- },
26
+ parserOptions: {
27
+ ecmaFeatures: {
28
+ generators: false,
29
+ objectLiteralDuplicateProperties: false,
30
+ jsx: true,
35
31
  },
36
32
  },
33
+ },
37
34
 
38
- settings: {
39
- 'import/resolver': {
40
- node: {
41
- extensions: ['.js', '.mjs', '.cjs', '.jsx', '.json'],
42
- },
35
+ settings: {
36
+ 'import/resolver': {
37
+ node: {
38
+ extensions: ['.js', '.mjs', '.cjs', '.jsx', '.json'],
43
39
  },
40
+ },
44
41
 
45
- 'import/extensions': ['.js', '.mjs', '.cjs', '.jsx', '.json'],
46
- 'import/core-modules': [],
47
- 'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
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
- propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
46
+ react: {
47
+ pragma: 'React',
48
+ version: 'detect',
55
49
  },
56
50
 
57
- rules: {
58
- 'react/jsx-props-no-spreading': ['off', {
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
- depth: 5,
194
- }],
195
-
196
- 'react-hooks/rules-of-hooks': ['error'],
197
- 'jsx-a11y/accessible-emoji': ['off'],
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
- 'jsx-a11y/alt-text': 'off',
200
-
201
- 'jsx-a11y/aria-activedescendant-has-tabindex': ['error'],
202
- 'jsx-a11y/aria-props': ['error'],
203
- 'jsx-a11y/aria-proptypes': ['error'],
204
-
205
- 'jsx-a11y/aria-role': ['error', {
206
- ignoreNonDOM: false,
207
- }],
208
-
209
- 'jsx-a11y/aria-unsupported-elements': ['error'],
210
-
211
- 'jsx-a11y/autocomplete-valid': ['off', {
212
- inputComponents: [],
213
- }],
214
-
215
- 'jsx-a11y/heading-has-content': ['error', {
216
- components: [''],
217
- }],
218
-
219
- 'jsx-a11y/html-has-lang': ['error'],
220
- 'jsx-a11y/iframe-has-title': ['error'],
221
- 'jsx-a11y/img-redundant-alt': ['error'],
222
- 'jsx-a11y/interactive-supports-focus': ['error'],
223
- 'jsx-a11y/lang': ['error'],
224
- 'jsx-a11y/mouse-events-have-key-events': ['error'],
225
- 'jsx-a11y/no-access-key': ['error'],
226
-
227
- 'jsx-a11y/no-autofocus': ['error', {
228
- ignoreNonDOM: true,
229
- }],
230
-
231
- 'jsx-a11y/no-distracting-elements': ['error', {
232
- elements: ['marquee', 'blink'],
233
- }],
234
-
235
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': ['error', {
236
- tr: ['none', 'presentation'],
237
- }],
238
-
239
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': ['error', {
240
- ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
241
- ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
242
- li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
243
- table: ['grid'],
244
- td: ['gridcell'],
245
- }],
246
-
247
- 'jsx-a11y/no-noninteractive-tabindex': ['error', {
248
- tags: [],
249
- roles: ['tabpanel'],
250
- }],
251
-
252
- 'jsx-a11y/no-onchange': ['off'],
253
- 'jsx-a11y/no-redundant-roles': ['error'],
254
- 'jsx-a11y/role-has-required-aria-props': ['error'],
255
- 'jsx-a11y/role-supports-aria-props': ['error'],
256
- 'jsx-a11y/scope': ['error'],
257
- 'jsx-a11y/tabindex-no-positive': ['error'],
258
-
259
- 'react/forbid-dom-props': ['off', {
260
- forbid: [],
261
- }],
262
-
263
- 'react/jsx-boolean-value': ['error', 'never', {
264
- always: [],
265
- }],
266
-
267
- 'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
268
- 'react/jsx-closing-tag-location': ['error'],
269
-
270
- 'react/jsx-curly-spacing': ['error', 'never', {
271
- allowMultiline: true,
272
- }],
273
-
274
- 'react/jsx-handler-names': ['off', {
275
- eventHandlerPrefix: 'handle',
276
- eventHandlerPropPrefix: 'on',
277
- }],
278
-
279
- 'react/jsx-indent-props': ['error', 2],
280
- 'react/jsx-key': ['off'],
281
-
282
- 'react/jsx-no-duplicate-props': ['error', {
283
- ignoreCase: true,
284
- }],
285
-
286
- 'react/jsx-no-literals': ['off', {
287
- noStrings: true,
288
- }],
289
-
290
- 'react/jsx-no-undef': ['error'],
291
-
292
- 'react/jsx-pascal-case': ['error', {
293
- allowAllCaps: true,
294
- ignore: [],
295
- }],
296
-
297
- 'react/sort-prop-types': ['off', {
298
- ignoreCase: true,
299
- callbacksLast: false,
300
- requiredFirst: false,
301
- sortShapeProp: true,
302
- }],
303
-
304
- 'react/jsx-sort-prop-types': ['off'],
305
-
306
- 'react/jsx-sort-props': ['off', {
307
- ignoreCase: true,
308
- callbacksLast: false,
309
- shorthandFirst: false,
310
- shorthandLast: false,
311
- noSortAlphabetically: false,
312
- reservedFirst: true,
313
- }],
314
-
315
- 'react/jsx-sort-default-props': ['off', {
316
- ignoreCase: true,
317
- }],
318
-
319
- 'react/jsx-uses-vars': ['error'],
320
- 'react/no-danger': ['warn'],
321
- 'react/no-deprecated': ['error'],
322
- 'react/no-did-mount-set-state': ['off'],
323
- 'react/no-did-update-set-state': ['error'],
324
- 'react/no-will-update-set-state': ['error'],
325
- 'react/no-direct-mutation-state': ['off'],
326
- 'react/no-is-mounted': ['error'],
327
- 'react/no-multi-comp': ['off'],
328
- 'react/no-set-state': ['off'],
329
- 'react/no-string-refs': ['error'],
330
- 'react/no-unknown-property': ['error'],
331
- 'react/prefer-es6-class': ['error', 'always'],
332
-
333
- 'react/prefer-stateless-function': ['error', {
334
- ignorePureComponents: true,
335
- }],
336
-
337
- 'react/require-render-return': ['error'],
338
- 'react/self-closing-comp': ['error'],
339
-
340
- 'react/sort-comp': ['error', {
341
- order: [
342
- 'static-variables',
343
- 'static-methods',
344
- 'instance-variables',
345
- 'lifecycle',
346
- '/^handle.+$/',
347
- '/^on.+$/',
348
- 'getters',
349
- 'setters',
350
- '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
351
- 'instance-methods',
352
- 'everything-else',
353
- 'rendering',
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
- groups: {
357
- lifecycle: [
358
- 'displayName',
359
- 'propTypes',
360
- 'contextTypes',
361
- 'childContextTypes',
362
- 'mixins',
363
- 'statics',
364
- 'defaultProps',
365
- 'constructor',
366
- 'getDefaultProps',
367
- 'getInitialState',
368
- 'state',
369
- 'getChildContext',
370
- 'getDerivedStateFromProps',
371
- 'componentWillMount',
372
- 'UNSAFE_componentWillMount',
373
- 'componentDidMount',
374
- 'componentWillReceiveProps',
375
- 'UNSAFE_componentWillReceiveProps',
376
- 'shouldComponentUpdate',
377
- 'componentWillUpdate',
378
- 'UNSAFE_componentWillUpdate',
379
- 'getSnapshotBeforeUpdate',
380
- 'componentDidUpdate',
381
- 'componentDidCatch',
382
- 'componentWillUnmount',
383
- ],
384
-
385
- rendering: ['/^render.+$/', 'render'],
386
- },
387
- }],
388
-
389
- 'react/jsx-wrap-multilines': ['error', {
390
- declaration: 'parens-new-line',
391
- assignment: 'parens-new-line',
392
- return: 'parens-new-line',
393
- arrow: 'parens-new-line',
394
- condition: 'parens-new-line',
395
- logical: 'parens-new-line',
396
- prop: 'parens-new-line',
397
- }],
398
-
399
- 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
400
- 'react/jsx-equals-spacing': ['error', 'never'],
401
- 'react/jsx-indent': ['error', 2],
402
-
403
- 'react/jsx-no-target-blank': ['error', {
404
- enforceDynamicLinks: 'always',
405
- links: true,
406
- forms: false,
407
- }],
408
-
409
- 'react/jsx-filename-extension': ['error', {
410
- extensions: ['.jsx'],
411
- }],
412
-
413
- 'react/jsx-no-comment-textnodes': ['error'],
414
- 'react/no-render-return-value': ['error'],
415
-
416
- 'react/require-optimization': ['off', {
417
- allowDecorators: [],
418
- }],
419
-
420
- 'react/no-find-dom-node': ['error'],
421
-
422
- 'react/forbid-component-props': ['off', {
423
- forbid: [],
424
- }],
425
-
426
- 'react/forbid-elements': ['off', {
427
- forbid: [],
428
- }],
429
-
430
- 'react/no-danger-with-children': ['error'],
431
-
432
- 'react/no-unused-prop-types': ['error', {
433
- customValidators: [],
434
- skipShapeProps: true,
435
- }],
436
-
437
- 'react/style-prop-object': ['error'],
438
- 'react/no-unescaped-entities': ['error'],
439
- 'react/no-children-prop': ['error'],
440
-
441
- 'react/jsx-tag-spacing': ['error', {
442
- closingSlash: 'never',
443
- beforeSelfClosing: 'always',
444
- afterOpening: 'never',
445
- beforeClosing: 'never',
446
- }],
447
-
448
- 'react/jsx-space-before-closing': ['off', 'always'],
449
-
450
- 'react/forbid-foreign-prop-types': ['warn', {
451
- allowInPropTypes: true,
452
- }],
453
-
454
- 'react/void-dom-elements-no-children': ['error'],
455
-
456
- 'react/default-props-match-prop-types': ['error', {
457
- allowRequiredDefaults: false,
458
- }],
459
-
460
- 'react/no-redundant-should-component-update': ['error'],
461
- 'react/no-unused-state': ['error'],
462
-
463
- 'react/boolean-prop-naming': ['off', {
464
- propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
465
- rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+',
466
- message: '',
467
- }],
468
-
469
- 'react/no-typos': ['error'],
470
-
471
- 'react/jsx-curly-brace-presence': ['error', {
472
- props: 'never',
473
- children: 'never',
474
- }],
475
-
476
- 'react/destructuring-assignment': ['error', 'always'],
477
- 'react/no-access-state-in-setstate': ['error'],
478
-
479
- 'react/button-has-type': ['error', {
480
- button: true,
481
- submit: true,
482
- reset: false,
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
  ];
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/entva/styleguide"
10
10
  },
11
11
  "bugs": "https://github.com/entva/styleguide/issues",
12
- "version": "2.18.0",
12
+ "version": "2.18.1",
13
13
  "keywords": [
14
14
  "linter",
15
15
  "config",