@ethang/eslint-config 17.6.0 → 17.6.2
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 +4 -1
- package/eslint.config.js +0 -222
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
8
8
|
* 104 rules from [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint)
|
|
9
9
|
* 75 rules from [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
|
|
10
|
-
* 51 rules from [eslint-plugin-astro](https://www.npmjs.com/package/eslint-plugin-astro)
|
|
11
10
|
* 35 rules from [jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
|
|
12
11
|
* 32 rules from [eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)
|
|
13
12
|
* 20 rules from [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n/tree/67bbfdf3c6862dcbfe455a4afbd83fa60f9d1ea4)
|
|
@@ -16,6 +15,10 @@
|
|
|
16
15
|
* 2 rules from [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
|
|
17
16
|
* Includes Prettier built in (do NOT use this with a separate Prettier config.)
|
|
18
17
|
|
|
18
|
+
# Add Even More!
|
|
19
|
+
* 51 rules for Astro files: [eslint-config-astro](https://github.com/eglove/eslint-config-ethang-astro)
|
|
20
|
+
* install @ethang/eslint-config-astro
|
|
21
|
+
|
|
19
22
|
# Install
|
|
20
23
|
|
|
21
24
|
`pnpm i -D eslint prettier typescript-eslint @ethang/eslint-config`
|
package/eslint.config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import parser from "@typescript-eslint/parser";
|
|
3
|
-
import astro from "eslint-plugin-astro";
|
|
4
3
|
import a11y from "eslint-plugin-jsx-a11y/lib/index.js";
|
|
5
4
|
import n from "eslint-plugin-n";
|
|
6
5
|
import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
|
|
@@ -24,66 +23,6 @@ const ignores = ["eslint.config.js", "node_modules", "dist"];
|
|
|
24
23
|
|
|
25
24
|
export default tseslint.config(
|
|
26
25
|
eslintPluginPrettier,
|
|
27
|
-
{
|
|
28
|
-
files: ["**/*.{astro}"],
|
|
29
|
-
ignores,
|
|
30
|
-
languageOptions,
|
|
31
|
-
plugins: { astro },
|
|
32
|
-
rules: {
|
|
33
|
-
"astro/missing-client-only-directive-value": "error",
|
|
34
|
-
"astro/no-conflict-set-directives": "error",
|
|
35
|
-
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
36
|
-
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
37
|
-
"astro/no-deprecated-astro-resolve": "error",
|
|
38
|
-
"astro/no-deprecated-getentrybyslug": "error",
|
|
39
|
-
"astro/no-exports-from-components": "error",
|
|
40
|
-
"astro/no-set-html-directive": "off",
|
|
41
|
-
"astro/no-set-text-directive": "error",
|
|
42
|
-
"astro/no-unused-css-selector": "error",
|
|
43
|
-
"astro/no-unused-define-vars-in-style": "error",
|
|
44
|
-
"astro/prefer-class-list-directive": "error",
|
|
45
|
-
"astro/prefer-object-class-list": "error",
|
|
46
|
-
"astro/prefer-split-class-list": "error",
|
|
47
|
-
"astro/semi": "error",
|
|
48
|
-
"astro/valid-compile": "error",
|
|
49
|
-
"astro/jsx-a11y/alt-text": "error",
|
|
50
|
-
"astro/jsx-a11y/anchor-ambiguous-text": "error",
|
|
51
|
-
"astro/jsx-a11y/anchor-has-content": "error",
|
|
52
|
-
"astro/jsx-a11y/anchor-is-valid": "error",
|
|
53
|
-
"astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
54
|
-
"astro/jsx-a11y/aria-props": "error",
|
|
55
|
-
"astro/jsx-a11y/aria-proptypes": "error",
|
|
56
|
-
"astro/jsx-a11y/aria-role": "error",
|
|
57
|
-
"astro/jsx-a11y/aria-unsupported-elements": "error",
|
|
58
|
-
"astro/jsx-a11y/autocomplete-valid": "error",
|
|
59
|
-
"astro/jsx-a11y/click-events-have-key-events": "error",
|
|
60
|
-
"astro/jsx-a11y/control-has-associated-label": "error",
|
|
61
|
-
"astro/jsx-a11y/heading-has-content": "error",
|
|
62
|
-
"astro/jsx-a11y/html-has-lang": "error",
|
|
63
|
-
"astro/jsx-a11y/iframe-has-title": "error",
|
|
64
|
-
"astro/jsx-a11y/img-redundant-alt": "error",
|
|
65
|
-
"astro/jsx-a11y/interactive-supports-focus": "error",
|
|
66
|
-
"astro/jsx-a11y/label-has-associated-control": "error",
|
|
67
|
-
"astro/jsx-a11y/lang": "error",
|
|
68
|
-
"astro/jsx-a11y/media-has-caption": "error",
|
|
69
|
-
"astro/jsx-a11y/mouse-events-have-key-events": "error",
|
|
70
|
-
"astro/jsx-a11y/no-access-key": "error",
|
|
71
|
-
"astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
72
|
-
"astro/jsx-a11y/no-autofocus": "error",
|
|
73
|
-
"astro/jsx-a11y/no-distracting-elements": "error",
|
|
74
|
-
"astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
|
75
|
-
"astro/jsx-a11y/no-noninteractive-element-interactions": "error",
|
|
76
|
-
"astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
77
|
-
"astro/jsx-a11y/no-noninteractive-tabindex": "error",
|
|
78
|
-
"astro/jsx-a11y/no-redundant-roles": "error",
|
|
79
|
-
"astro/jsx-a11y/no-static-element-interactions": "error",
|
|
80
|
-
"astro/jsx-a11y/prefer-tag-over-role": "error",
|
|
81
|
-
"astro/jsx-a11y/role-has-required-aria-props": "error",
|
|
82
|
-
"astro/jsx-a11y/role-supports-aria-props": "error",
|
|
83
|
-
"astro/jsx-a11y/scope": "error",
|
|
84
|
-
"astro/jsx-a11y/tabindex-no-positive": "error",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
26
|
{
|
|
88
27
|
files: ["**/*.{jsx,tsx}"],
|
|
89
28
|
ignores,
|
|
@@ -100,10 +39,6 @@ export default tseslint.config(
|
|
|
100
39
|
"react/destructuring-assignment": "error",
|
|
101
40
|
"react/display-name": "error",
|
|
102
41
|
"react/forbid-component-props": "error",
|
|
103
|
-
"react/forbid-dom-props": "off",
|
|
104
|
-
"react/forbid-elements": "off",
|
|
105
|
-
"react/forbid-foreign-prop-types": "off",
|
|
106
|
-
"react/forbid-prop-types": "off",
|
|
107
42
|
"react/function-component-definition": "error",
|
|
108
43
|
"react/hook-use-state": "error",
|
|
109
44
|
"react/iframe-missing-sandbox": "error",
|
|
@@ -122,16 +57,12 @@ export default tseslint.config(
|
|
|
122
57
|
"react/jsx-no-constructed-context-values": "error",
|
|
123
58
|
"react/jsx-no-duplicate-props": "error",
|
|
124
59
|
"react/jsx-no-leaked-render": "error",
|
|
125
|
-
"react/jsx-no-literals": "off",
|
|
126
60
|
"react/jsx-no-script-url": "error",
|
|
127
61
|
"react/jsx-no-target-blank": "error",
|
|
128
62
|
"react/jsx-no-undef": "error",
|
|
129
63
|
"react/jsx-no-useless-fragment": "error",
|
|
130
64
|
"react/jsx-pascal-case": "error",
|
|
131
65
|
"react/jsx-props-no-spread-multi": "error",
|
|
132
|
-
"react/jsx-props-no-spreading": "off",
|
|
133
|
-
"react/jsx-sort-default-props": "off",
|
|
134
|
-
"react/jsx-sort-props": "off", // Conflicts with perfectionist/sort-jsx-props
|
|
135
66
|
"react/jsx-uses-react": "error",
|
|
136
67
|
"react/jsx-uses-vars": "error",
|
|
137
68
|
"react/no-access-state-in-setstate": "error",
|
|
@@ -139,7 +70,6 @@ export default tseslint.config(
|
|
|
139
70
|
"react/no-array-index-key": "error",
|
|
140
71
|
"react/no-arrow-function-lifecycle": "error",
|
|
141
72
|
"react/no-children-prop": "error",
|
|
142
|
-
"react/no-danger": "off",
|
|
143
73
|
"react/no-danger-with-children": "error",
|
|
144
74
|
"react/no-deprecated": "error",
|
|
145
75
|
"react/no-did-mount-set-state": "error",
|
|
@@ -170,8 +100,6 @@ export default tseslint.config(
|
|
|
170
100
|
"react/prefer-read-only-props": "error",
|
|
171
101
|
"react/prefer-stateless-function": "error",
|
|
172
102
|
"react/prop-types": "error",
|
|
173
|
-
"react/react-in-jsx-scope": "off",
|
|
174
|
-
"react/require-default-props": "off",
|
|
175
103
|
"react/require-optimization": "error",
|
|
176
104
|
"react/require-render-return": "error",
|
|
177
105
|
"react/self-closing-comp": "error",
|
|
@@ -205,21 +133,9 @@ export default tseslint.config(
|
|
|
205
133
|
"array-callback-return": "error",
|
|
206
134
|
"arrow-body-style": ["error", "always"],
|
|
207
135
|
"block-scoped-var": "error",
|
|
208
|
-
"callback-return": "off", // deprecated
|
|
209
|
-
camelcase: "off", // not useful
|
|
210
|
-
complexity: "off", // Handled by Sonar
|
|
211
|
-
"consistent-this": "off",
|
|
212
|
-
"consistent-return": "off",
|
|
213
136
|
"constructor-super": "error",
|
|
214
|
-
"capitalized-comments": "off", // conflicts with commenting/uncommenting shortcuts
|
|
215
|
-
"class-methods-use-this": "off", // not needed
|
|
216
|
-
"default-case": "off",
|
|
217
|
-
"default-case-last": "off",
|
|
218
|
-
"default-param-last": "off", // Handled by tseslint
|
|
219
|
-
"dot-notation": "off", // Handled by tseslint
|
|
220
137
|
eqeqeq: "error",
|
|
221
138
|
"for-direction": "error",
|
|
222
|
-
"func-names": "off",
|
|
223
139
|
"func-name-matching": "error",
|
|
224
140
|
"func-style": [
|
|
225
141
|
"error",
|
|
@@ -229,40 +145,21 @@ export default tseslint.config(
|
|
|
229
145
|
},
|
|
230
146
|
],
|
|
231
147
|
"getter-return": "error",
|
|
232
|
-
"global-require": "off", // Deprecated
|
|
233
148
|
"grouped-accessor-pairs": "error",
|
|
234
149
|
"guard-for-in": "error",
|
|
235
|
-
"handle-callback-err": "off", // Deprecated
|
|
236
|
-
"id-blacklist": "off", // Deprecated
|
|
237
|
-
"id-denylist": "off",
|
|
238
|
-
"id-length": "off",
|
|
239
|
-
"id-match": "off",
|
|
240
|
-
"init-declarations": "off",
|
|
241
|
-
"line-comment-position": "off",
|
|
242
|
-
"lines-around-directive": "off",
|
|
243
|
-
"lines-between-class-members": "off",
|
|
244
150
|
"logical-assignment-operators": "error",
|
|
245
151
|
"max-classes-per-file": "error",
|
|
246
152
|
"max-depth": "error",
|
|
247
153
|
"max-lines": "error",
|
|
248
154
|
"max-lines-per-function": "error",
|
|
249
155
|
"max-nested-callbacks": "error",
|
|
250
|
-
"max-params": "off", // Handled by tseslint
|
|
251
156
|
"max-statements": "error",
|
|
252
|
-
"multiline-comment-style": "off",
|
|
253
|
-
"new-cap": "off",
|
|
254
|
-
"newline-after-var": "off",
|
|
255
|
-
"newline-before-return": "off",
|
|
256
157
|
"no-alert": "error",
|
|
257
|
-
"no-array-constructor": "off", // Handled by tseslint
|
|
258
158
|
"no-async-promise-executor": "error",
|
|
259
159
|
"no-await-in-loop": "error",
|
|
260
160
|
"no-bitwise": "error",
|
|
261
|
-
"no-buffer-constructor": "off",
|
|
262
161
|
"no-caller": "error",
|
|
263
162
|
"no-case-declarations": "error",
|
|
264
|
-
"no-continue": "off",
|
|
265
|
-
"no-catch-shadow": "off",
|
|
266
163
|
"no-class-assign": "error",
|
|
267
164
|
"no-compare-neg-zero": "error",
|
|
268
165
|
"no-cond-assign": "error",
|
|
@@ -276,15 +173,12 @@ export default tseslint.config(
|
|
|
276
173
|
"no-delete-var": "error",
|
|
277
174
|
"no-div-regex": "error",
|
|
278
175
|
"no-dupe-args": "error",
|
|
279
|
-
"no-dupe-class-members": "off", // Checked by ts compiler
|
|
280
176
|
"no-dupe-else-if": "error",
|
|
281
177
|
"no-dupe-keys": "error",
|
|
282
178
|
"no-duplicate-case": "error",
|
|
283
|
-
"no-duplicate-imports": "off", // Conflicts with seperate type imports
|
|
284
179
|
"no-else-return": "error",
|
|
285
180
|
"no-empty": "error",
|
|
286
181
|
"no-empty-character-class": "error",
|
|
287
|
-
"no-empty-function": "off", // Handled by tseslint
|
|
288
182
|
"no-empty-pattern": "error",
|
|
289
183
|
"no-empty-static-block": "error",
|
|
290
184
|
"no-eq-null": "error",
|
|
@@ -298,36 +192,24 @@ export default tseslint.config(
|
|
|
298
192
|
"no-func-assign": "error",
|
|
299
193
|
"no-global-assign": "error",
|
|
300
194
|
"no-implicit-coercion": "error",
|
|
301
|
-
"no-implicit-globals": "off",
|
|
302
|
-
"no-implied-eval": "off", // Handled by tseslint
|
|
303
195
|
"no-import-assign": "error",
|
|
304
|
-
"no-inline-comments": "off",
|
|
305
196
|
"no-inner-declarations": "error",
|
|
306
197
|
"no-invalid-regexp": "error",
|
|
307
|
-
"no-invalid-this": "off", // Checked by ts compiler
|
|
308
198
|
"no-irregular-whitespace": "error",
|
|
309
199
|
"no-iterator": "error",
|
|
310
200
|
"no-label-var": "error",
|
|
311
201
|
"no-labels": "error",
|
|
312
202
|
"no-lone-blocks": "error",
|
|
313
203
|
"no-lonely-if": "error",
|
|
314
|
-
"no-loop-func": "off", // Handled by tseslint
|
|
315
204
|
"no-loss-of-precision": "error",
|
|
316
|
-
"no-magic-numbers": "off",
|
|
317
205
|
"no-misleading-character-class": "error",
|
|
318
|
-
"no-mixed-requires": "off",
|
|
319
206
|
"no-multi-assign": "error",
|
|
320
207
|
"no-multi-str": "error",
|
|
321
|
-
"no-native-reassign": "off",
|
|
322
208
|
"no-negated-condition": "error",
|
|
323
|
-
"no-negated-in-lhs": "off",
|
|
324
209
|
"no-nested-ternary": "error",
|
|
325
210
|
"no-new": "error",
|
|
326
211
|
"no-new-func": "error",
|
|
327
212
|
"no-new-native-nonconstructor": "error",
|
|
328
|
-
"no-new-require": "off",
|
|
329
|
-
"no-new-object": "off",
|
|
330
|
-
"no-new-symbol": "off",
|
|
331
213
|
"no-new-wrappers": "error",
|
|
332
214
|
"no-nonoctal-decimal-escape": "error",
|
|
333
215
|
"no-obj-calls": "error",
|
|
@@ -335,40 +217,21 @@ export default tseslint.config(
|
|
|
335
217
|
"no-octal": "error",
|
|
336
218
|
"no-octal-escape": "error",
|
|
337
219
|
"no-param-reassign": "error",
|
|
338
|
-
"no-path-concat": "off",
|
|
339
220
|
"no-plusplus": "error",
|
|
340
|
-
"no-process-env": "off",
|
|
341
|
-
"no-process-exit": "off",
|
|
342
221
|
"no-promise-executor-return": "error",
|
|
343
222
|
"no-proto": "error",
|
|
344
223
|
"no-prototype-builtins": "error",
|
|
345
|
-
"no-redeclare": "off", // Checked by ts compiler
|
|
346
224
|
"no-regex-spaces": "error",
|
|
347
|
-
"no-restricted-exports": "off",
|
|
348
|
-
"no-restricted-globals": "off",
|
|
349
|
-
"no-restricted-imports": "off", // Handled by tseslint
|
|
350
|
-
"no-restricted-modules": "off",
|
|
351
|
-
"no-restricted-properties": "off",
|
|
352
|
-
"no-restricted-syntax": "off",
|
|
353
225
|
"no-return-assign": "error",
|
|
354
|
-
"no-return-await": "off", // Handled by tseslint
|
|
355
226
|
"no-script-url": "error",
|
|
356
227
|
"no-self-assign": "error",
|
|
357
228
|
"no-self-compare": "error",
|
|
358
229
|
"no-sequences": "error",
|
|
359
230
|
"no-setter-return": "error",
|
|
360
|
-
"no-shadow": "off", // Handled by tseslint
|
|
361
231
|
"no-shadow-restricted-names": "error",
|
|
362
232
|
"no-sparse-arrays": "error",
|
|
363
|
-
"no-sync": "off",
|
|
364
|
-
"no-template-curly-in-string": "off",
|
|
365
|
-
"no-ternary": "off",
|
|
366
233
|
"no-this-before-super": "error",
|
|
367
|
-
"no-throw-literal": "off", // Handled by tseslint
|
|
368
|
-
"no-undef": "off",
|
|
369
234
|
"no-undef-init": "error",
|
|
370
|
-
"no-undefined": "off",
|
|
371
|
-
"no-underscore-dangle": "off",
|
|
372
235
|
"no-unmodified-loop-condition": "error",
|
|
373
236
|
"no-unneeded-ternary": "error",
|
|
374
237
|
"no-unreachable": "error",
|
|
@@ -376,51 +239,36 @@ export default tseslint.config(
|
|
|
376
239
|
"no-unsafe-finally": "error",
|
|
377
240
|
"no-unsafe-negation": "error",
|
|
378
241
|
"no-unsafe-optional-chaining": "error",
|
|
379
|
-
"no-unused-expressions": "off", // Handled by tseslint
|
|
380
242
|
"no-unused-labels": "error",
|
|
381
243
|
"no-unused-private-class-members": "error",
|
|
382
|
-
"no-unused-vars": "off", // Handled by tseslint
|
|
383
|
-
"no-use-before-define": "off",
|
|
384
|
-
"no-useless-assignment": "off", // Currently causing version errors
|
|
385
244
|
"no-useless-backreference": "error",
|
|
386
245
|
"no-useless-call": "error",
|
|
387
246
|
"no-useless-catch": "error",
|
|
388
247
|
"no-useless-computed-key": "error",
|
|
389
248
|
"no-useless-concat": "error",
|
|
390
|
-
"no-useless-constructor": "off", // Handled by tseslint
|
|
391
249
|
"no-useless-escape": "error",
|
|
392
250
|
"no-useless-rename": "error",
|
|
393
251
|
"no-useless-return": "error",
|
|
394
252
|
"no-var": "error",
|
|
395
253
|
"no-void": "error",
|
|
396
|
-
"no-warning-comments": "off",
|
|
397
254
|
"no-with": "error",
|
|
398
255
|
"object-shorthand": "error",
|
|
399
|
-
"one-var": "off",
|
|
400
256
|
"operator-assignment": "error",
|
|
401
|
-
"padding-line-between-statements": "off",
|
|
402
257
|
"prefer-arrow-callback": "error",
|
|
403
258
|
"prefer-const": "error",
|
|
404
|
-
"prefer-destructuring": "off", // Handled by tseslint
|
|
405
259
|
"prefer-exponentiation-operator": "error",
|
|
406
260
|
"prefer-named-capture-group": "error",
|
|
407
261
|
"prefer-numeric-literals": "error",
|
|
408
262
|
"prefer-object-has-own": "error",
|
|
409
263
|
"prefer-object-spread": "error",
|
|
410
|
-
"prefer-promise-reject-errors": "off", // Handled by tseslint
|
|
411
|
-
"prefer-reflect": "off",
|
|
412
264
|
"prefer-regex-literals": "error",
|
|
413
265
|
"prefer-rest-params": "error",
|
|
414
266
|
"prefer-spread": "error",
|
|
415
267
|
"prefer-template": "error",
|
|
416
268
|
radix: "error",
|
|
417
269
|
"require-atomic-updates": "error",
|
|
418
|
-
"require-await": "off", // Handled by tseslint
|
|
419
270
|
"require-unicode-regexp": "error",
|
|
420
271
|
"require-yield": "error",
|
|
421
|
-
"spaced-comment": "off",
|
|
422
|
-
"sort-imports": "off",
|
|
423
|
-
"sort-keys": "off", // Handled by perfectionist
|
|
424
272
|
"sort-vars": "error",
|
|
425
273
|
strict: "error",
|
|
426
274
|
"symbol-description": "error",
|
|
@@ -430,31 +278,15 @@ export default tseslint.config(
|
|
|
430
278
|
"vars-on-top": "error",
|
|
431
279
|
yoda: ["error", "always"],
|
|
432
280
|
|
|
433
|
-
"n/callback-return": "off",
|
|
434
281
|
"n/exports-style": ["error", "exports"],
|
|
435
|
-
"n/file-extension-in-import": "off", // buggy with .ts
|
|
436
|
-
"n/global-require": "off",
|
|
437
282
|
"n/handle-callback-err": "error",
|
|
438
|
-
"n/hashbang": "off",
|
|
439
|
-
"n/no-hide-core-modules": "off",
|
|
440
|
-
"n/no-callback-literal": "off",
|
|
441
283
|
"n/no-deprecated-api": "error",
|
|
442
284
|
"n/no-exports-assign": "error",
|
|
443
285
|
"n/no-extraneous-import": "error",
|
|
444
286
|
"n/no-extraneous-require": "error",
|
|
445
|
-
"n/no-missing-import": "off",
|
|
446
287
|
"n/no-missing-require": "error",
|
|
447
|
-
"n/no-mixed-requires": "off",
|
|
448
|
-
"n/no-new-require": "off",
|
|
449
288
|
"n/no-path-concat": "error",
|
|
450
|
-
"n/no-process-env": "off",
|
|
451
|
-
"n/no-process-exit": "off",
|
|
452
|
-
"n/no-restricted-import": "off",
|
|
453
|
-
"n/no-restricted-require": "off",
|
|
454
|
-
"n/no-sync": "off",
|
|
455
289
|
"n/no-unpublished-bin": "error",
|
|
456
|
-
"n/no-unpublished-require": "off",
|
|
457
|
-
"n/no-unpublished-import": "off",
|
|
458
290
|
"n/no-unsupported-features/es-builtins": "error",
|
|
459
291
|
"n/no-unsupported-features/es-syntax": "error",
|
|
460
292
|
"n/no-unsupported-features/node-builtins": "error",
|
|
@@ -465,48 +297,33 @@ export default tseslint.config(
|
|
|
465
297
|
"n/prefer-global/text-encoder": "error",
|
|
466
298
|
"n/prefer-global/url-search-params": "error",
|
|
467
299
|
"n/prefer-global/url": "error",
|
|
468
|
-
"n/prefer-promises/dns": "off",
|
|
469
|
-
"n/prefer-promises/fs": "off",
|
|
470
300
|
"n/prefer-node-protocol": "error",
|
|
471
|
-
"n/process-exit-as-throw": "off",
|
|
472
|
-
"n/shebang": "off",
|
|
473
301
|
|
|
474
|
-
"@typescript-eslint/adjacent-overload-signatures": "off", // Conflicts with perfectionist
|
|
475
302
|
"@typescript-eslint/array-type": "error",
|
|
476
303
|
"@typescript-eslint/await-thenable": "error",
|
|
477
304
|
"@typescript-eslint/ban-ts-comment": "error",
|
|
478
305
|
"@typescript-eslint/ban-tslint-comment": "error",
|
|
479
306
|
"@typescript-eslint/class-literal-property-style": "error",
|
|
480
|
-
"@typescript-eslint/class-methods-use-this": "off",
|
|
481
307
|
"@typescript-eslint/consistent-generic-constructors": "error",
|
|
482
308
|
"@typescript-eslint/consistent-indexed-object-style": "error",
|
|
483
|
-
"@typescript-eslint/consistent-return": "off",
|
|
484
309
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
485
310
|
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
486
311
|
"@typescript-eslint/consistent-type-exports": "error",
|
|
487
312
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
488
313
|
"@typescript-eslint/default-param-last": "error",
|
|
489
314
|
"@typescript-eslint/dot-notation": "error",
|
|
490
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
491
315
|
"@typescript-eslint/explicit-member-accessibility": "error",
|
|
492
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
493
|
-
"@typescript-eslint/init-declarations": "off",
|
|
494
|
-
"@typescript-eslint/lines-between-class-members": "off",
|
|
495
316
|
"@typescript-eslint/max-params": "error",
|
|
496
|
-
"@typescript-eslint/member-ordering": "off", // Conflicts with perfectionist/sort-classes
|
|
497
317
|
"@typescript-eslint/method-signature-style": "error",
|
|
498
|
-
"@typescript-eslint/naming-convention": "off",
|
|
499
318
|
"@typescript-eslint/no-array-constructor": "error",
|
|
500
319
|
"@typescript-eslint/no-array-delete": "error",
|
|
501
320
|
"@typescript-eslint/no-base-to-string": "error",
|
|
502
321
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
503
322
|
"@typescript-eslint/no-confusing-void-expression": "error",
|
|
504
|
-
"@typescript-eslint/no-dupe-class-members": "off",
|
|
505
323
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
506
324
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
507
325
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
508
326
|
"@typescript-eslint/no-empty-function": "error",
|
|
509
|
-
"@typescript-eslint/no-empty-interface": "off", // Deprecated
|
|
510
327
|
"@typescript-eslint/no-empty-object-type": "error",
|
|
511
328
|
"@typescript-eslint/no-explicit-any": "error",
|
|
512
329
|
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
@@ -516,11 +333,8 @@ export default tseslint.config(
|
|
|
516
333
|
"@typescript-eslint/no-implied-eval": "error",
|
|
517
334
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
518
335
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
519
|
-
"@typescript-eslint/no-invalid-this": "off",
|
|
520
336
|
"@typescript-eslint/no-invalid-void-type": "error",
|
|
521
337
|
"@typescript-eslint/no-loop-func": "error",
|
|
522
|
-
"@typescript-eslint/no-loss-of-precision": "off", // Deprecated
|
|
523
|
-
"@typescript-eslint/no-magic-numbers": "off",
|
|
524
338
|
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
525
339
|
"@typescript-eslint/no-misused-new": "error",
|
|
526
340
|
"@typescript-eslint/no-misused-promises": "error",
|
|
@@ -529,15 +343,12 @@ export default tseslint.config(
|
|
|
529
343
|
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
530
344
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
531
345
|
"@typescript-eslint/no-non-null-assertion": "error",
|
|
532
|
-
"@typescript-eslint/no-redeclare": "off",
|
|
533
346
|
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
534
347
|
"@typescript-eslint/no-require-imports": "error",
|
|
535
348
|
"@typescript-eslint/no-restricted-imports": "error",
|
|
536
349
|
"@typescript-eslint/no-restricted-types": "error",
|
|
537
350
|
"@typescript-eslint/no-shadow": "error",
|
|
538
351
|
"@typescript-eslint/no-this-alias": "error",
|
|
539
|
-
"@typescript-eslint/no-throw-literal": "off",
|
|
540
|
-
"@typescript-eslint/no-type-alias": "off",
|
|
541
352
|
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
542
353
|
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
543
354
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment":
|
|
@@ -569,17 +380,12 @@ export default tseslint.config(
|
|
|
569
380
|
varsIgnorePattern: "^_",
|
|
570
381
|
},
|
|
571
382
|
],
|
|
572
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
573
383
|
"@typescript-eslint/no-useless-constructor": "error",
|
|
574
384
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
575
|
-
"@typescript-eslint/no-useless-template-literals": "off",
|
|
576
385
|
"@typescript-eslint/no-unnecessary-template-expression": "error",
|
|
577
|
-
"@typescript-eslint/no-var-requires": "off", // Deprecated
|
|
578
386
|
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
579
387
|
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
580
388
|
"@typescript-eslint/only-throw-error": "error",
|
|
581
|
-
"@typescript-eslint/padding-line-between-statements": "off",
|
|
582
|
-
"@typescript-eslint/parameter-properties": "off",
|
|
583
389
|
"@typescript-eslint/prefer-as-const": "error",
|
|
584
390
|
"@typescript-eslint/prefer-destructuring": "error",
|
|
585
391
|
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
@@ -593,23 +399,19 @@ export default tseslint.config(
|
|
|
593
399
|
"@typescript-eslint/prefer-optional-chain": "error",
|
|
594
400
|
"@typescript-eslint/prefer-promise-reject-errors": "error",
|
|
595
401
|
"@typescript-eslint/prefer-readonly": "error",
|
|
596
|
-
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
597
402
|
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
598
403
|
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
599
404
|
"@typescript-eslint/prefer-return-this-type": "error",
|
|
600
405
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
601
|
-
"@typescript-eslint/prefer-ts-expect-error": "off",
|
|
602
406
|
"@typescript-eslint/promise-function-async": "error",
|
|
603
407
|
"@typescript-eslint/require-array-sort-compare": "error",
|
|
604
408
|
"@typescript-eslint/require-await": "error",
|
|
605
409
|
"@typescript-eslint/restrict-plus-operands": "error",
|
|
606
410
|
"@typescript-eslint/restrict-template-expressions": "error",
|
|
607
411
|
"@typescript-eslint/return-await": "error",
|
|
608
|
-
"@typescript-eslint/sort-type-constituents": "off",
|
|
609
412
|
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
610
413
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
611
414
|
"@typescript-eslint/triple-slash-reference": "error",
|
|
612
|
-
"@typescript-eslint/typedef": "off",
|
|
613
415
|
"@typescript-eslint/unbound-method": "error",
|
|
614
416
|
"@typescript-eslint/unified-signatures": "error",
|
|
615
417
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
@@ -623,17 +425,14 @@ export default tseslint.config(
|
|
|
623
425
|
"unicorn/no-length-as-slice-end": "error",
|
|
624
426
|
"unicorn/error-message": "error",
|
|
625
427
|
"unicorn/escape-case": "error",
|
|
626
|
-
"unicorn/explicit-length-check": "off",
|
|
627
428
|
"unicorn/expiring-todo-comments": "error",
|
|
628
429
|
"unicorn/filename-case": "error",
|
|
629
|
-
"unicorn/import-index": "off",
|
|
630
430
|
"unicorn/import-style": "error",
|
|
631
431
|
"unicorn/new-for-builtins": "error",
|
|
632
432
|
"unicorn/no-abusive-eslint-disable": "error",
|
|
633
433
|
"unicorn/no-anonymous-default-export": "error",
|
|
634
434
|
"unicorn/no-array-callback-reference": "error",
|
|
635
435
|
"unicorn/no-array-for-each": "error",
|
|
636
|
-
"unicorn/no-array-instanceof": "off",
|
|
637
436
|
"unicorn/no-array-method-this-argument": "error",
|
|
638
437
|
"unicorn/no-array-push-push": "error",
|
|
639
438
|
"unicorn/no-array-reduce": "error",
|
|
@@ -643,34 +442,18 @@ export default tseslint.config(
|
|
|
643
442
|
"unicorn/no-document-cookie": "error",
|
|
644
443
|
"unicorn/no-empty-file": "error",
|
|
645
444
|
"unicorn/no-for-loop": "error",
|
|
646
|
-
"unicorn/no-fn-reference-in-iterator": "off",
|
|
647
445
|
"unicorn/no-hex-escape": "error",
|
|
648
446
|
"unicorn/no-instanceof-array": "error",
|
|
649
447
|
"unicorn/no-invalid-fetch-options": "error",
|
|
650
448
|
"unicorn/no-invalid-remove-event-listener": "error",
|
|
651
|
-
"unicorn/no-keyword-prefix": "off",
|
|
652
449
|
"unicorn/no-lonely-if": "error",
|
|
653
450
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
654
451
|
"unicorn/no-negated-condition": "error",
|
|
655
452
|
"unicorn/no-negation-in-equality-check": "error",
|
|
656
453
|
"unicorn/no-new-array": "error",
|
|
657
454
|
"unicorn/no-new-buffer": "error",
|
|
658
|
-
"unicorn/prefer-dataset": "off",
|
|
659
|
-
"unicorn/prefer-event-key": "off",
|
|
660
|
-
"unicorn/prefer-exponentiation-operator": "off",
|
|
661
|
-
"unicorn/prefer-flat-map": "off",
|
|
662
|
-
"unicorn/prefer-node-append": "off",
|
|
663
|
-
"unicorn/prefer-node-remove": "off",
|
|
664
|
-
"unicorn/prefer-object-has-own": "off",
|
|
665
|
-
"unicorn/prefer-replace-all": "off",
|
|
666
|
-
"unicorn/prefer-starts-ends-with": "off",
|
|
667
|
-
"unicorn/prefer-text-content": "off",
|
|
668
|
-
"unicorn/prefer-trim-start-end": "off",
|
|
669
|
-
"unicorn/regex-shorthand": "off",
|
|
670
|
-
"unicorn/no-null": "off",
|
|
671
455
|
"unicorn/no-object-as-default-parameter": "error",
|
|
672
456
|
"unicorn/no-process-exit": "error",
|
|
673
|
-
"unicorn/no-reduce": "off",
|
|
674
457
|
"unicorn/no-single-promise-in-promise-methods": "error",
|
|
675
458
|
"unicorn/no-static-only-class": "error",
|
|
676
459
|
"unicorn/no-thenable": "error",
|
|
@@ -680,7 +463,6 @@ export default tseslint.config(
|
|
|
680
463
|
"unicorn/no-unnecessary-polyfills": "error",
|
|
681
464
|
"unicorn/no-unreadable-array-destructuring": "error",
|
|
682
465
|
"unicorn/no-unreadable-iife": "error",
|
|
683
|
-
"unicorn/no-unsafe-regex": "off",
|
|
684
466
|
"unicorn/no-unused-properties": "error",
|
|
685
467
|
"unicorn/no-useless-fallback-in-spread": "error",
|
|
686
468
|
"unicorn/no-useless-length-check": "error",
|
|
@@ -849,7 +631,6 @@ export default tseslint.config(
|
|
|
849
631
|
{ groups: ["shorthand", "multiline"] },
|
|
850
632
|
],
|
|
851
633
|
|
|
852
|
-
"a11y/accessible-emoji": "off",
|
|
853
634
|
"a11y/alt-text": "error",
|
|
854
635
|
"a11y/anchor-ambiguous-text": "error",
|
|
855
636
|
"a11y/anchor-has-content": "error",
|
|
@@ -868,9 +649,7 @@ export default tseslint.config(
|
|
|
868
649
|
"a11y/img-redundant-alt": "error",
|
|
869
650
|
"a11y/interactive-supports-focus": "error",
|
|
870
651
|
"a11y/label-has-associated-control": "error",
|
|
871
|
-
"a11y/label-has-for": "off",
|
|
872
652
|
"a11y/lang": "error",
|
|
873
|
-
"a11y/media-has-caption": "off",
|
|
874
653
|
"a11y/mouse-events-have-key-events": "error",
|
|
875
654
|
"a11y/no-access-key": "error",
|
|
876
655
|
"a11y/no-aria-hidden-on-focusable": "error",
|
|
@@ -880,7 +659,6 @@ export default tseslint.config(
|
|
|
880
659
|
"a11y/no-noninteractive-element-interactions": "error",
|
|
881
660
|
"a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
882
661
|
"a11y/no-noninteractive-tabindex": "error",
|
|
883
|
-
"a11y/no-onchange": "off",
|
|
884
662
|
"a11y/no-redundant-roles": "error",
|
|
885
663
|
"a11y/no-static-element-interactions": "error",
|
|
886
664
|
"a11y/prefer-tag-over-role": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethang/eslint-config",
|
|
3
|
-
"version": "17.6.
|
|
3
|
+
"version": "17.6.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -21,10 +21,9 @@
|
|
|
21
21
|
"@typescript-eslint/parser": "^8.0.0",
|
|
22
22
|
"eslint": "^9.8.0",
|
|
23
23
|
"eslint-config-prettier": "^9.1.0",
|
|
24
|
-
"eslint-plugin-astro": "^1.2.3",
|
|
25
24
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
26
25
|
"eslint-plugin-n": "^17.10.1",
|
|
27
|
-
"eslint-plugin-perfectionist": "^3.
|
|
26
|
+
"eslint-plugin-perfectionist": "^3.1.0",
|
|
28
27
|
"eslint-plugin-prettier": "^5.2.1",
|
|
29
28
|
"eslint-plugin-react": "^7.35.0",
|
|
30
29
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
@@ -40,10 +39,9 @@
|
|
|
40
39
|
"@typescript-eslint/parser": "^8.0.0",
|
|
41
40
|
"eslint": "^9.8.0",
|
|
42
41
|
"eslint-config-prettier": "^9.1.0",
|
|
43
|
-
"eslint-plugin-astro": "^1.2.3",
|
|
44
42
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
45
43
|
"eslint-plugin-n": "^17.10.1",
|
|
46
|
-
"eslint-plugin-perfectionist": "^3.
|
|
44
|
+
"eslint-plugin-perfectionist": "^3.1.0",
|
|
47
45
|
"eslint-plugin-prettier": "^5.2.1",
|
|
48
46
|
"eslint-plugin-react": "^7.35.0",
|
|
49
47
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
@@ -54,7 +52,7 @@
|
|
|
54
52
|
"typescript-eslint": "^8.0.0"
|
|
55
53
|
},
|
|
56
54
|
"devDependencies": {
|
|
57
|
-
"@ethang/project-builder": "^1.1.
|
|
55
|
+
"@ethang/project-builder": "^1.1.52",
|
|
58
56
|
"@tsconfig/node-lts": "^20.1.3",
|
|
59
57
|
"@tsconfig/strictest": "^2.0.5"
|
|
60
58
|
}
|