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