zeno-config 0.1.0
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/README.md +271 -0
- package/package.json +89 -0
- package/src/eslint/index.d.ts +124 -0
- package/src/eslint/index.js +373 -0
- package/src/eslint/rules/baseRules.js +753 -0
- package/src/eslint/rules/importPluginRules.js +200 -0
- package/src/eslint/rules/jsxA11yPluginRules.js +195 -0
- package/src/eslint/rules/nodePluginRules.js +128 -0
- package/src/eslint/rules/reactHooksPluginRules.js +27 -0
- package/src/eslint/rules/reactPluginRules.js +476 -0
- package/src/eslint/rules/reactYouMightNotNeedAnEffectPluginRules.js +21 -0
- package/src/eslint/rules/stylisticPluginRules.js +330 -0
- package/src/eslint/rules/typescriptPluginRules.js +533 -0
- package/src/eslint/rules/unicornPluginRules.js +441 -0
- package/src/extensions.d.ts +51 -0
- package/src/extensions.js +49 -0
- package/src/prettier.d.ts +4 -0
- package/src/prettier.js +16 -0
- package/src/tsconfig.base.json +31 -0
- package/src/tsconfig.react.json +13 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { reactExtensions } from '../../extensions.js';
|
|
2
|
+
|
|
3
|
+
const getReactPluginRules = (options = {}) => {
|
|
4
|
+
return {
|
|
5
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
|
|
6
|
+
'react/boolean-prop-naming': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'],
|
|
10
|
+
rule: '^(is|has|show|can)[A-Z]([A-Za-z0-9]?)+',
|
|
11
|
+
validateNested: true,
|
|
12
|
+
message:
|
|
13
|
+
'Boolean prop ({{ propName }}) should start with "is", "has", "show", or "can"',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
|
|
17
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
|
|
18
|
+
'react/button-has-type': [
|
|
19
|
+
'error',
|
|
20
|
+
{
|
|
21
|
+
button: true,
|
|
22
|
+
submit: true,
|
|
23
|
+
reset: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/checked-requires-onchange-or-readonly.md
|
|
28
|
+
'react/checked-requires-onchange-or-readonly': [
|
|
29
|
+
'error',
|
|
30
|
+
{
|
|
31
|
+
ignoreMissingProperties: false,
|
|
32
|
+
ignoreExclusiveCheckedAttribute: false,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
// TODO: can be disabled in TS
|
|
37
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md
|
|
38
|
+
'react/default-props-match-prop-types': [
|
|
39
|
+
'error',
|
|
40
|
+
{ allowRequiredDefaults: false },
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
|
|
44
|
+
'react/destructuring-assignment': [
|
|
45
|
+
'error',
|
|
46
|
+
'always',
|
|
47
|
+
{ destructureInSignature: 'always' },
|
|
48
|
+
],
|
|
49
|
+
|
|
50
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
|
51
|
+
'react/display-name': 'off',
|
|
52
|
+
|
|
53
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
|
|
54
|
+
'react/forbid-component-props': 'off',
|
|
55
|
+
|
|
56
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md
|
|
57
|
+
'react/forbid-dom-props': 'off',
|
|
58
|
+
|
|
59
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md
|
|
60
|
+
'react/forbid-elements': 'off',
|
|
61
|
+
|
|
62
|
+
// TODO: can be disabled in TS
|
|
63
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
|
|
64
|
+
'react/forbid-foreign-prop-types': 'error',
|
|
65
|
+
|
|
66
|
+
// TODO: can be disabled in TS
|
|
67
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
|
|
68
|
+
'react/forbid-prop-types': [
|
|
69
|
+
'error',
|
|
70
|
+
{
|
|
71
|
+
forbid: ['any', 'array', 'object'],
|
|
72
|
+
checkContextTypes: true,
|
|
73
|
+
checkChildContextTypes: true,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
|
|
77
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/forward-ref-uses-ref.md
|
|
78
|
+
'react/forward-ref-uses-ref': 'error',
|
|
79
|
+
|
|
80
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
|
|
81
|
+
'react/function-component-definition': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
namedComponents: 'function-declaration',
|
|
85
|
+
unnamedComponents: 'arrow-function',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
|
|
89
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md
|
|
90
|
+
'react/hook-use-state': ['error', { allowDestructuredState: false }],
|
|
91
|
+
|
|
92
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/iframe-missing-sandbox.md
|
|
93
|
+
'react/iframe-missing-sandbox': 'off',
|
|
94
|
+
|
|
95
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
|
|
96
|
+
'react/jsx-boolean-value': ['error', 'never'],
|
|
97
|
+
|
|
98
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
|
|
99
|
+
'react/jsx-child-element-spacing': 'error',
|
|
100
|
+
|
|
101
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
|
|
102
|
+
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
103
|
+
|
|
104
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
|
|
105
|
+
'react/jsx-closing-tag-location': ['error', 'line-aligned'],
|
|
106
|
+
|
|
107
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
|
|
108
|
+
'react/jsx-curly-brace-presence': [
|
|
109
|
+
'error',
|
|
110
|
+
{
|
|
111
|
+
props: 'never',
|
|
112
|
+
children: 'never',
|
|
113
|
+
propElementValues: 'always',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
|
|
117
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
|
|
118
|
+
'react/jsx-curly-newline': [
|
|
119
|
+
'error',
|
|
120
|
+
{
|
|
121
|
+
multiline: 'consistent',
|
|
122
|
+
singleline: 'consistent',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
|
|
126
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
|
|
127
|
+
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
|
128
|
+
|
|
129
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
|
|
130
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
|
131
|
+
|
|
132
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
|
|
133
|
+
'react/jsx-filename-extension': [
|
|
134
|
+
'error',
|
|
135
|
+
{
|
|
136
|
+
extensions: options.extensions || reactExtensions,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
|
|
140
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
|
|
141
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
|
|
142
|
+
|
|
143
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
|
|
144
|
+
'react/jsx-fragments': ['error', 'syntax'],
|
|
145
|
+
|
|
146
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
|
|
147
|
+
'react/jsx-handler-names': [
|
|
148
|
+
'warn',
|
|
149
|
+
{
|
|
150
|
+
eventHandlerPrefix: 'handle',
|
|
151
|
+
eventHandlerPropPrefix: 'on',
|
|
152
|
+
checkLocalVariables: false,
|
|
153
|
+
checkInlineFunction: false,
|
|
154
|
+
ignoreComponentNames: [],
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
|
|
158
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
|
|
159
|
+
'react/jsx-indent': [
|
|
160
|
+
'error',
|
|
161
|
+
'tab',
|
|
162
|
+
{ checkAttributes: false, indentLogicalExpressions: false },
|
|
163
|
+
],
|
|
164
|
+
|
|
165
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
|
|
166
|
+
'react/jsx-indent-props': ['error', 'tab'],
|
|
167
|
+
|
|
168
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
|
|
169
|
+
'react/jsx-key': [
|
|
170
|
+
'error',
|
|
171
|
+
{
|
|
172
|
+
checkFragmentShorthand: true,
|
|
173
|
+
checkKeyMustBeforeSpread: false,
|
|
174
|
+
warnOnDuplicates: true,
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
|
|
178
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-depth.md
|
|
179
|
+
'react/jsx-max-depth': 'off',
|
|
180
|
+
|
|
181
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
|
|
182
|
+
'react/jsx-max-props-per-line': [
|
|
183
|
+
'error',
|
|
184
|
+
{ maximum: 1, when: 'multiline' },
|
|
185
|
+
],
|
|
186
|
+
|
|
187
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
|
|
188
|
+
'react/jsx-newline': [
|
|
189
|
+
'off',
|
|
190
|
+
{ prevent: false, allowMultilines: false },
|
|
191
|
+
],
|
|
192
|
+
|
|
193
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
|
|
194
|
+
'react/jsx-no-bind': [
|
|
195
|
+
'error',
|
|
196
|
+
{
|
|
197
|
+
ignoreRefs: true,
|
|
198
|
+
allowArrowFunctions: true,
|
|
199
|
+
allowFunctions: false,
|
|
200
|
+
allowBind: false,
|
|
201
|
+
ignoreDOMComponents: true,
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
|
|
205
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
|
|
206
|
+
'react/jsx-no-comment-textnodes': 'error',
|
|
207
|
+
|
|
208
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
|
|
209
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
210
|
+
|
|
211
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
|
|
212
|
+
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
|
|
213
|
+
|
|
214
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-leaked-render.md
|
|
215
|
+
'react/jsx-no-leaked-render': [
|
|
216
|
+
'error',
|
|
217
|
+
{ validStrategies: ['ternary', 'coerce'] },
|
|
218
|
+
],
|
|
219
|
+
|
|
220
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
|
|
221
|
+
'react/jsx-no-literals': 'off',
|
|
222
|
+
|
|
223
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md
|
|
224
|
+
'react/jsx-no-script-url': ['error', { includeFromSettings: true }],
|
|
225
|
+
|
|
226
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
|
|
227
|
+
// not needed unless you support old browsers
|
|
228
|
+
'react/jsx-no-target-blank': 'off',
|
|
229
|
+
|
|
230
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
|
|
231
|
+
'react/jsx-no-undef': 'error',
|
|
232
|
+
|
|
233
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
|
|
234
|
+
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
|
|
235
|
+
|
|
236
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
|
|
237
|
+
'react/jsx-one-expression-per-line': [
|
|
238
|
+
'error',
|
|
239
|
+
{ allow: 'single-child' },
|
|
240
|
+
],
|
|
241
|
+
|
|
242
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
243
|
+
'react/jsx-pascal-case': [
|
|
244
|
+
'error',
|
|
245
|
+
{
|
|
246
|
+
allowAllCaps: false,
|
|
247
|
+
allowLeadingUnderscore: false,
|
|
248
|
+
allowNamespace: true,
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
|
|
252
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md
|
|
253
|
+
'react/jsx-props-no-multi-spaces': 'off', // conflicts with prettier
|
|
254
|
+
|
|
255
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spread-multi.md
|
|
256
|
+
'react/jsx-props-no-spread-multi': 'error',
|
|
257
|
+
|
|
258
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
|
|
259
|
+
'react/jsx-props-no-spreading': [
|
|
260
|
+
'error',
|
|
261
|
+
{
|
|
262
|
+
html: 'enforce',
|
|
263
|
+
custom: 'ignore',
|
|
264
|
+
explicitSpread: 'ignore',
|
|
265
|
+
exceptions: [],
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
|
|
269
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
|
|
270
|
+
'react/jsx-sort-props': 'off',
|
|
271
|
+
|
|
272
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
|
|
273
|
+
'react/jsx-tag-spacing': [
|
|
274
|
+
'error',
|
|
275
|
+
{
|
|
276
|
+
closingSlash: 'never',
|
|
277
|
+
beforeSelfClosing: 'always',
|
|
278
|
+
afterOpening: 'never',
|
|
279
|
+
beforeClosing: 'never',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
|
|
283
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
|
|
284
|
+
'react/jsx-uses-react': 'off',
|
|
285
|
+
|
|
286
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
|
|
287
|
+
'react/jsx-uses-vars': 'error',
|
|
288
|
+
|
|
289
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
|
|
290
|
+
'react/jsx-wrap-multilines': [
|
|
291
|
+
'error',
|
|
292
|
+
{
|
|
293
|
+
declaration: 'parens-new-line',
|
|
294
|
+
assignment: 'parens-new-line',
|
|
295
|
+
return: 'parens-new-line',
|
|
296
|
+
arrow: 'parens-new-line',
|
|
297
|
+
condition: 'parens-new-line',
|
|
298
|
+
logical: 'parens-new-line',
|
|
299
|
+
prop: 'parens-new-line',
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
|
|
303
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
|
|
304
|
+
'react/no-access-state-in-setstate': 'error',
|
|
305
|
+
|
|
306
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md
|
|
307
|
+
'react/no-adjacent-inline-elements': 'off',
|
|
308
|
+
|
|
309
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
|
|
310
|
+
'react/no-array-index-key': 'error',
|
|
311
|
+
|
|
312
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-arrow-function-lifecycle.md
|
|
313
|
+
'react/no-arrow-function-lifecycle': 'error',
|
|
314
|
+
|
|
315
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
|
|
316
|
+
'react/no-children-prop': 'error',
|
|
317
|
+
|
|
318
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger.md
|
|
319
|
+
'react/no-danger': 'warn',
|
|
320
|
+
|
|
321
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
|
|
322
|
+
'react/no-danger-with-children': 'error',
|
|
323
|
+
|
|
324
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
|
|
325
|
+
'react/no-deprecated': 'error',
|
|
326
|
+
|
|
327
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
|
|
328
|
+
'react/no-did-mount-set-state': 'off',
|
|
329
|
+
|
|
330
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
|
|
331
|
+
'react/no-did-update-set-state': 'error',
|
|
332
|
+
|
|
333
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
|
|
334
|
+
'react/no-direct-mutation-state': 'error',
|
|
335
|
+
|
|
336
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
|
|
337
|
+
'react/no-find-dom-node': 'error',
|
|
338
|
+
|
|
339
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-invalid-html-attribute.md
|
|
340
|
+
'react/no-invalid-html-attribute': 'error',
|
|
341
|
+
|
|
342
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
|
|
343
|
+
'react/no-is-mounted': 'error',
|
|
344
|
+
|
|
345
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
|
346
|
+
'react/no-multi-comp': 'off',
|
|
347
|
+
|
|
348
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-namespace.md
|
|
349
|
+
'react/no-namespace': 'error',
|
|
350
|
+
|
|
351
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md
|
|
352
|
+
'react/no-object-type-as-default-prop': 'error',
|
|
353
|
+
|
|
354
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
|
|
355
|
+
'react/no-redundant-should-component-update': 'error',
|
|
356
|
+
|
|
357
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
|
|
358
|
+
'react/no-render-return-value': 'error',
|
|
359
|
+
|
|
360
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
|
|
361
|
+
'react/no-set-state': 'off',
|
|
362
|
+
|
|
363
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
|
|
364
|
+
'react/no-string-refs': ['error', { noTemplateLiterals: true }],
|
|
365
|
+
|
|
366
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
|
|
367
|
+
'react/no-this-in-sfc': 'error',
|
|
368
|
+
|
|
369
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-typos.md
|
|
370
|
+
'react/no-typos': 'error',
|
|
371
|
+
|
|
372
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
|
|
373
|
+
'react/no-unescaped-entities': 'error',
|
|
374
|
+
|
|
375
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
|
|
376
|
+
'react/no-unknown-property': 'error',
|
|
377
|
+
|
|
378
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unsafe.md
|
|
379
|
+
'react/no-unsafe': 'off',
|
|
380
|
+
|
|
381
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
|
|
382
|
+
'react/no-unstable-nested-components': 'error',
|
|
383
|
+
|
|
384
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-class-component-methods.md
|
|
385
|
+
'react/no-unused-class-component-methods': 'error',
|
|
386
|
+
|
|
387
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
|
|
388
|
+
'react/no-unused-prop-types': 'error',
|
|
389
|
+
|
|
390
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
|
|
391
|
+
'react/no-unused-state': 'error',
|
|
392
|
+
|
|
393
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
|
|
394
|
+
'react/no-will-update-set-state': 'error',
|
|
395
|
+
|
|
396
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
|
|
397
|
+
'react/prefer-es6-class': ['error', 'always'],
|
|
398
|
+
|
|
399
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-exact-props.md
|
|
400
|
+
'react/prefer-exact-props': 'error',
|
|
401
|
+
|
|
402
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
|
|
403
|
+
'react/prefer-read-only-props': 'off',
|
|
404
|
+
|
|
405
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
|
|
406
|
+
'react/prefer-stateless-function': [
|
|
407
|
+
'error',
|
|
408
|
+
{ ignorePureComponents: true },
|
|
409
|
+
],
|
|
410
|
+
|
|
411
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/prop-types.md
|
|
412
|
+
'react/prop-types': [
|
|
413
|
+
'error',
|
|
414
|
+
{
|
|
415
|
+
ignore: [],
|
|
416
|
+
customValidators: [],
|
|
417
|
+
skipUndeclared: false,
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
|
|
421
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
|
|
422
|
+
'react/react-in-jsx-scope': 'off',
|
|
423
|
+
|
|
424
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
|
|
425
|
+
'react/require-default-props': [
|
|
426
|
+
'error',
|
|
427
|
+
{
|
|
428
|
+
forbidDefaultForRequired: true,
|
|
429
|
+
classes: 'defaultProps',
|
|
430
|
+
functions: 'defaultArguments',
|
|
431
|
+
},
|
|
432
|
+
],
|
|
433
|
+
|
|
434
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
|
|
435
|
+
'react/require-optimization': 'off',
|
|
436
|
+
|
|
437
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
|
|
438
|
+
'react/require-render-return': 'error',
|
|
439
|
+
|
|
440
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
|
441
|
+
'react/self-closing-comp': 'error',
|
|
442
|
+
|
|
443
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
|
|
444
|
+
'react/sort-comp': 'error',
|
|
445
|
+
|
|
446
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
|
|
447
|
+
'react/sort-default-props': 'off',
|
|
448
|
+
|
|
449
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
|
|
450
|
+
'react/sort-prop-types': [
|
|
451
|
+
'off',
|
|
452
|
+
{
|
|
453
|
+
callbacksLast: false,
|
|
454
|
+
ignoreCase: false,
|
|
455
|
+
requiredFirst: false,
|
|
456
|
+
sortShapeProp: false,
|
|
457
|
+
noSortAlphabetically: false,
|
|
458
|
+
checkTypes: true,
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
|
|
462
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
|
|
463
|
+
'react/state-in-constructor': ['error', 'always'],
|
|
464
|
+
|
|
465
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
|
|
466
|
+
'react/static-property-placement': 'off',
|
|
467
|
+
|
|
468
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
|
|
469
|
+
'react/style-prop-object': 'error',
|
|
470
|
+
|
|
471
|
+
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
|
472
|
+
'react/void-dom-elements-no-children': 'error',
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
export default getReactPluginRules;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const getReactYouMightNotNeedAnEffectPluginRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://github.com/NickvanDyke/eslint-plugin-react-you-might-not-need-an-effect
|
|
4
|
+
'react-you-might-not-need-an-effect/no-empty-effect': 'warn',
|
|
5
|
+
'react-you-might-not-need-an-effect/no-adjust-state-on-prop-change':
|
|
6
|
+
'warn',
|
|
7
|
+
'react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change':
|
|
8
|
+
'warn',
|
|
9
|
+
'react-you-might-not-need-an-effect/no-event-handler': 'warn',
|
|
10
|
+
'react-you-might-not-need-an-effect/no-pass-live-state-to-parent':
|
|
11
|
+
'warn',
|
|
12
|
+
'react-you-might-not-need-an-effect/no-pass-data-to-parent': 'warn',
|
|
13
|
+
'react-you-might-not-need-an-effect/no-manage-parent': 'warn',
|
|
14
|
+
'react-you-might-not-need-an-effect/no-pass-ref-to-parent': 'warn',
|
|
15
|
+
'react-you-might-not-need-an-effect/no-initialize-state': 'warn',
|
|
16
|
+
'react-you-might-not-need-an-effect/no-chain-state-updates': 'warn',
|
|
17
|
+
'react-you-might-not-need-an-effect/no-derived-state': 'warn',
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default getReactYouMightNotNeedAnEffectPluginRules;
|