@morgs32/eslint-config 2.0.4 → 2.0.5
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/.eslintrc.js +208 -208
- package/package.json +1 -1
package/.eslintrc.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
module.exports = {
|
|
3
3
|
extends: [
|
|
4
|
-
|
|
4
|
+
'next/core-web-vitals'
|
|
5
5
|
],
|
|
6
6
|
ignorePatterns: [
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
'**/lib',
|
|
8
|
+
'**/dist',
|
|
9
9
|
],
|
|
10
10
|
settings: {
|
|
11
11
|
react: {
|
|
12
|
-
version:
|
|
12
|
+
version: 'detect'
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
plugins: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
'import',
|
|
17
|
+
'unused-imports',
|
|
18
|
+
'react',
|
|
19
|
+
'react-hooks',
|
|
20
|
+
'jsx-a11y',
|
|
21
|
+
'@typescript-eslint',
|
|
22
|
+
'jest',
|
|
23
|
+
'testing-library',
|
|
24
24
|
],
|
|
25
25
|
|
|
26
26
|
rules: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
quotes: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
'spaced-comment': ['error', 'always', { 'markers': ['/'] }],
|
|
28
|
+
'unused-imports/no-unused-imports': 'error',
|
|
29
|
+
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
|
30
|
+
'react/jsx-indent': ['error', 2],
|
|
31
|
+
'space-infix-ops': ['error'],
|
|
32
|
+
quotes: ['error', 'single'],
|
|
33
|
+
'space-before-blocks': 'error',
|
|
34
|
+
'keyword-spacing': 'error',
|
|
35
|
+
'object-curly-spacing': ['error', 'always'],
|
|
36
|
+
'object-curly-newline': [
|
|
37
|
+
'error',
|
|
38
38
|
{
|
|
39
39
|
ObjectExpression: {
|
|
40
40
|
multiline: true,
|
|
@@ -58,252 +58,252 @@ module.exports = {
|
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
],
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
'react/jsx-indent-props': [2, 2],
|
|
62
|
+
'react/jsx-first-prop-new-line': [2, 'multiline'],
|
|
63
63
|
|
|
64
64
|
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
eqeqeq: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
65
|
+
'array-callback-return': 'warn',
|
|
66
|
+
'default-case': ['warn', { commentPattern: '^no default$' }],
|
|
67
|
+
'dot-location': ['warn', 'property'],
|
|
68
|
+
eqeqeq: ['warn', 'smart'],
|
|
69
|
+
'new-parens': 'warn',
|
|
70
|
+
'no-array-constructor': 'warn',
|
|
71
|
+
'no-caller': 'warn',
|
|
72
|
+
'no-cond-assign': ['warn', 'except-parens'],
|
|
73
|
+
'no-const-assign': 'warn',
|
|
74
|
+
'no-control-regex': 'warn',
|
|
75
|
+
'no-delete-var': 'warn',
|
|
76
|
+
'no-dupe-args': 'warn',
|
|
77
|
+
'no-dupe-class-members': 'warn',
|
|
78
|
+
'no-dupe-keys': 'warn',
|
|
79
|
+
'no-duplicate-case': 'warn',
|
|
80
|
+
'no-empty-character-class': 'warn',
|
|
81
|
+
'no-empty-pattern': 'warn',
|
|
82
|
+
'no-eval': 'warn',
|
|
83
|
+
'no-ex-assign': 'warn',
|
|
84
|
+
'no-extend-native': 'warn',
|
|
85
|
+
'no-extra-bind': 'warn',
|
|
86
|
+
'no-extra-label': 'warn',
|
|
87
|
+
'no-fallthrough': 'warn',
|
|
88
|
+
'no-func-assign': 'warn',
|
|
89
|
+
'no-implied-eval': 'warn',
|
|
90
|
+
'no-invalid-regexp': 'warn',
|
|
91
|
+
'no-iterator': 'warn',
|
|
92
|
+
'no-label-var': 'warn',
|
|
93
|
+
'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
|
|
94
|
+
'no-lone-blocks': 'warn',
|
|
95
|
+
'no-loop-func': 'warn',
|
|
96
|
+
'no-mixed-operators': [
|
|
97
|
+
'warn',
|
|
98
98
|
{
|
|
99
99
|
groups: [
|
|
100
|
-
[
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
100
|
+
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
|
101
|
+
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
|
102
|
+
['&&', '||'],
|
|
103
|
+
['in', 'instanceof'],
|
|
104
104
|
],
|
|
105
105
|
allowSamePrecedence: false,
|
|
106
106
|
},
|
|
107
107
|
],
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
108
|
+
'no-multi-str': 'warn',
|
|
109
|
+
'no-global-assign': 'warn',
|
|
110
|
+
'no-unsafe-negation': 'warn',
|
|
111
|
+
'no-new-func': 'warn',
|
|
112
|
+
'no-new-object': 'warn',
|
|
113
|
+
'no-new-symbol': 'warn',
|
|
114
|
+
'no-new-wrappers': 'warn',
|
|
115
|
+
'no-obj-calls': 'warn',
|
|
116
|
+
'no-octal': 'warn',
|
|
117
|
+
'no-octal-escape': 'warn',
|
|
118
|
+
'no-redeclare': 'warn',
|
|
119
|
+
'no-regex-spaces': 'warn',
|
|
120
|
+
'no-restricted-syntax': ['warn', 'WithStatement'],
|
|
121
|
+
'no-script-url': 'warn',
|
|
122
|
+
'no-self-assign': 'warn',
|
|
123
|
+
'no-self-compare': 'warn',
|
|
124
|
+
'no-sequences': 'warn',
|
|
125
|
+
'no-shadow-restricted-names': 'warn',
|
|
126
|
+
'no-sparse-arrays': 'warn',
|
|
127
|
+
'no-template-curly-in-string': 'warn',
|
|
128
|
+
'no-this-before-super': 'warn',
|
|
129
|
+
'no-throw-literal': 'warn',
|
|
130
|
+
'no-undef': 'error',
|
|
131
131
|
// "no-restricted-globals": ["error"].concat(restrictedGlobals),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
'no-unreachable': 'warn',
|
|
133
|
+
'no-unused-expressions': [
|
|
134
|
+
'error',
|
|
135
135
|
{
|
|
136
136
|
allowShortCircuit: true,
|
|
137
137
|
allowTernary: true,
|
|
138
138
|
allowTaggedTemplates: true,
|
|
139
139
|
},
|
|
140
140
|
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
'no-unused-labels': 'warn',
|
|
142
|
+
'no-unused-vars': [
|
|
143
|
+
'warn',
|
|
144
144
|
{
|
|
145
|
-
args:
|
|
145
|
+
args: 'none',
|
|
146
146
|
ignoreRestSiblings: true,
|
|
147
147
|
},
|
|
148
148
|
],
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
'no-use-before-define': [
|
|
150
|
+
'warn',
|
|
151
151
|
{
|
|
152
152
|
functions: false,
|
|
153
153
|
classes: false,
|
|
154
154
|
variables: false,
|
|
155
155
|
},
|
|
156
156
|
],
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
'no-useless-computed-key': 'warn',
|
|
158
|
+
'no-useless-concat': 'warn',
|
|
159
|
+
'no-useless-constructor': 'warn',
|
|
160
|
+
'no-useless-escape': 'warn',
|
|
161
|
+
'no-useless-rename': [
|
|
162
|
+
'warn',
|
|
163
163
|
{
|
|
164
164
|
ignoreDestructuring: false,
|
|
165
165
|
ignoreImport: false,
|
|
166
166
|
ignoreExport: false,
|
|
167
167
|
},
|
|
168
168
|
],
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
strict: [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
169
|
+
'no-with': 'warn',
|
|
170
|
+
'no-whitespace-before-property': 'warn',
|
|
171
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
172
|
+
'require-yield': 'warn',
|
|
173
|
+
'rest-spread-spacing': ['warn', 'never'],
|
|
174
|
+
strict: ['warn', 'never'],
|
|
175
|
+
'unicode-bom': ['warn', 'never'],
|
|
176
|
+
'use-isnan': 'warn',
|
|
177
|
+
'valid-typeof': 'warn',
|
|
178
|
+
'no-restricted-properties': [
|
|
179
|
+
'error',
|
|
180
180
|
{
|
|
181
|
-
object:
|
|
182
|
-
property:
|
|
181
|
+
object: 'require',
|
|
182
|
+
property: 'ensure',
|
|
183
183
|
message:
|
|
184
|
-
|
|
184
|
+
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
|
-
object:
|
|
188
|
-
property:
|
|
187
|
+
object: 'System',
|
|
188
|
+
property: 'import',
|
|
189
189
|
message:
|
|
190
|
-
|
|
190
|
+
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
|
|
191
191
|
},
|
|
192
192
|
],
|
|
193
|
-
|
|
193
|
+
'getter-return': 'warn',
|
|
194
194
|
|
|
195
195
|
// https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
'import/first': 'error',
|
|
197
|
+
'import/no-amd': 'error',
|
|
198
|
+
'import/no-anonymous-default-export': 'warn',
|
|
199
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
200
200
|
|
|
201
201
|
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
|
|
203
|
+
'react/jsx-no-comment-textnodes': 'warn',
|
|
204
|
+
'react/jsx-no-duplicate-props': 'warn',
|
|
205
|
+
'react/jsx-no-target-blank': 'warn',
|
|
206
|
+
'react/jsx-no-undef': 'error',
|
|
207
|
+
'react/jsx-pascal-case': [
|
|
208
|
+
'warn',
|
|
209
209
|
{
|
|
210
210
|
allowAllCaps: true,
|
|
211
211
|
ignore: [],
|
|
212
212
|
},
|
|
213
213
|
],
|
|
214
|
-
|
|
214
|
+
'react/no-danger-with-children': 'warn',
|
|
215
215
|
// Disabled because of undesirable warnings
|
|
216
216
|
// See https://github.com/facebook/create-react-app/issues/5204 for
|
|
217
217
|
// blockers until its re-enabled
|
|
218
218
|
// 'react/no-deprecated': 'warn',
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
'react/no-direct-mutation-state': 'warn',
|
|
220
|
+
'react/no-is-mounted': 'warn',
|
|
221
|
+
'react/no-typos': 'error',
|
|
222
|
+
'react/require-render-return': 'error',
|
|
223
|
+
'react/style-prop-object': 'warn',
|
|
224
224
|
|
|
225
225
|
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
'jsx-a11y/alt-text': 'warn',
|
|
227
|
+
'jsx-a11y/anchor-has-content': 'warn',
|
|
228
|
+
'jsx-a11y/anchor-is-valid': [
|
|
229
|
+
'warn',
|
|
230
230
|
{
|
|
231
|
-
aspects: [
|
|
231
|
+
aspects: ['noHref', 'invalidHref'],
|
|
232
232
|
},
|
|
233
233
|
],
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
234
|
+
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
|
|
235
|
+
'jsx-a11y/aria-props': 'warn',
|
|
236
|
+
'jsx-a11y/aria-proptypes': 'warn',
|
|
237
|
+
'jsx-a11y/aria-role': ['warn', { ignoreNonDOM: true }],
|
|
238
|
+
'jsx-a11y/aria-unsupported-elements': 'warn',
|
|
239
|
+
'jsx-a11y/heading-has-content': 'warn',
|
|
240
|
+
'jsx-a11y/iframe-has-title': 'warn',
|
|
241
|
+
'jsx-a11y/img-redundant-alt': 'warn',
|
|
242
|
+
'jsx-a11y/no-access-key': 'warn',
|
|
243
|
+
'jsx-a11y/no-distracting-elements': 'warn',
|
|
244
|
+
'jsx-a11y/no-redundant-roles': 'warn',
|
|
245
|
+
'jsx-a11y/role-has-required-aria-props': 'warn',
|
|
246
|
+
'jsx-a11y/role-supports-aria-props': 'warn',
|
|
247
|
+
'jsx-a11y/scope': 'warn',
|
|
248
248
|
|
|
249
249
|
// https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
|
|
250
|
-
|
|
250
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
251
251
|
|
|
252
252
|
},
|
|
253
253
|
overrides: [
|
|
254
254
|
{
|
|
255
|
-
files: [
|
|
255
|
+
files: ['**/*.stories.*'],
|
|
256
256
|
rules: {
|
|
257
|
-
|
|
257
|
+
'import/no-anonymous-default-export': 'off',
|
|
258
258
|
},
|
|
259
259
|
},
|
|
260
260
|
|
|
261
261
|
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/jest.js
|
|
262
262
|
{
|
|
263
|
-
files: [
|
|
263
|
+
files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
|
|
264
264
|
env: {
|
|
265
|
-
|
|
265
|
+
'jest/globals': true,
|
|
266
266
|
},
|
|
267
267
|
// A subset of the recommended rules:
|
|
268
268
|
rules: {
|
|
269
269
|
// https://github.com/jest-community/eslint-plugin-jest
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
'jest/no-conditional-expect': 'error',
|
|
271
|
+
'jest/no-identical-title': 'error',
|
|
272
|
+
'jest/no-interpolation-in-snapshots': 'error',
|
|
273
|
+
'jest/no-jasmine-globals': 'error',
|
|
274
|
+
'jest/no-mocks-import': 'error',
|
|
275
|
+
'jest/valid-describe-callback': 'error',
|
|
276
|
+
'jest/valid-expect': 'error',
|
|
277
|
+
'jest/valid-expect-in-promise': 'error',
|
|
278
|
+
'jest/valid-title': 'warn',
|
|
279
279
|
|
|
280
280
|
// https://github.com/testing-library/eslint-plugin-testing-library
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
281
|
+
'testing-library/await-async-query': 'error',
|
|
282
|
+
'testing-library/await-async-utils': 'error',
|
|
283
|
+
'testing-library/no-await-sync-query': 'error',
|
|
284
|
+
'testing-library/no-container': 'error',
|
|
285
|
+
'testing-library/no-debugging-utils': 'error',
|
|
286
|
+
'testing-library/no-dom-import': ['error', 'react'],
|
|
287
|
+
'testing-library/no-node-access': 'error',
|
|
288
|
+
'testing-library/no-promise-in-fire-event': 'error',
|
|
289
|
+
'testing-library/no-render-in-setup': 'error',
|
|
290
|
+
'testing-library/no-unnecessary-act': 'error',
|
|
291
|
+
'testing-library/no-wait-for-empty-callback': 'error',
|
|
292
|
+
'testing-library/no-wait-for-multiple-assertions': 'error',
|
|
293
|
+
'testing-library/no-wait-for-side-effects': 'error',
|
|
294
|
+
'testing-library/no-wait-for-snapshot': 'error',
|
|
295
|
+
'testing-library/prefer-find-by': 'error',
|
|
296
|
+
'testing-library/prefer-presence-queries': 'error',
|
|
297
|
+
'testing-library/prefer-query-by-disappearance': 'error',
|
|
298
|
+
'testing-library/prefer-screen-queries': 'error',
|
|
299
|
+
'testing-library/render-result-naming-convention': 'error',
|
|
300
300
|
},
|
|
301
301
|
},
|
|
302
302
|
|
|
303
303
|
|
|
304
304
|
// https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/index.js
|
|
305
305
|
{
|
|
306
|
-
files: [
|
|
306
|
+
files: ['**/*.ts?(x)'],
|
|
307
307
|
// parser: "@typescript-eslint/parser",
|
|
308
308
|
// parserOptions: {
|
|
309
309
|
// ecmaVersion: 2018,
|
|
@@ -320,21 +320,21 @@ module.exports = {
|
|
|
320
320
|
// make sure to disable the ESLint rule here.
|
|
321
321
|
rules: {
|
|
322
322
|
// TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
|
|
323
|
-
|
|
323
|
+
'default-case': 'off',
|
|
324
324
|
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
|
|
325
|
-
|
|
325
|
+
'no-dupe-class-members': 'off',
|
|
326
326
|
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
|
|
327
|
-
|
|
327
|
+
'no-undef': 'off',
|
|
328
328
|
|
|
329
329
|
// Add TypeScript specific rules (and turn off ESLint equivalents)
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
330
|
+
'@typescript-eslint/consistent-type-assertions': 'warn',
|
|
331
|
+
'no-array-constructor': 'off',
|
|
332
|
+
'@typescript-eslint/no-array-constructor': 'warn',
|
|
333
|
+
'no-redeclare': 'off',
|
|
334
|
+
'@typescript-eslint/no-redeclare': 'warn',
|
|
335
|
+
'no-use-before-define': 'off',
|
|
336
|
+
'@typescript-eslint/no-use-before-define': [
|
|
337
|
+
'warn',
|
|
338
338
|
{
|
|
339
339
|
functions: false,
|
|
340
340
|
classes: false,
|
|
@@ -342,25 +342,25 @@ module.exports = {
|
|
|
342
342
|
typedefs: false,
|
|
343
343
|
},
|
|
344
344
|
],
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
'no-unused-expressions': 'off',
|
|
346
|
+
'@typescript-eslint/no-unused-expressions': [
|
|
347
|
+
'error',
|
|
348
348
|
{
|
|
349
349
|
allowShortCircuit: true,
|
|
350
350
|
allowTernary: true,
|
|
351
351
|
allowTaggedTemplates: true,
|
|
352
352
|
},
|
|
353
353
|
],
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
354
|
+
'no-unused-vars': 'off',
|
|
355
|
+
'@typescript-eslint/no-unused-vars': [
|
|
356
|
+
'warn',
|
|
357
357
|
{
|
|
358
|
-
args:
|
|
358
|
+
args: 'none',
|
|
359
359
|
ignoreRestSiblings: true,
|
|
360
360
|
},
|
|
361
361
|
],
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
'no-useless-constructor': 'off',
|
|
363
|
+
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
364
364
|
},
|
|
365
365
|
},
|
|
366
366
|
],
|