-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
676 lines (654 loc) · 52.8 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"root": true,
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:unicorn/recommended",
"plugin:ava/recommended",
"plugin:promise/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jsdoc/recommended",
"prettier" // Always have prettier last!
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"extensions": ".ts",
"projects": ["tsconfig.json", "tsconfig.test.json"]
},
"plugins": [
"@typescript-eslint", //https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
"prettier", //https://github.com/prettier/eslint-plugin-prettier
"unicorn", // https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main/docs/rules
"ava", // https://github.com/avajs/eslint-plugin-ava/tree/main/docs/rules
"promise", //https://github.com/xjamundx/eslint-plugin-promise/tree/development/docs/rules
"jsdoc" //https://github.com/gajus/eslint-plugin-jsdoc/tree/master/.README/rules
],
//eslint rules: https://github.com/eslint/eslint/tree/master/docs/rules
"rules": {
//#region ESLint
// eslint best practice
//"no-case-declarations":"off", //✅ disallow lexical declarations in case clauses
//"no-empty-pattern":"off", //✅ disallow empty destructuring patterns
//"no-fallthrough":"off", //✅ disallow fallthrough of `case` statements
//"no-global-assign":"off", //✅ disallow assignments to native objects or read-only global variables
//"no-octal":"off", //✅ disallow octal literals
//"no-redeclare":"off", //✅ disallow variable redeclaration
//"no-self-assign":"off", //✅ disallow assignments where both sides are exactly the same
//"no-unused-labels":"off", //✅🔧 disallow unused labels
//"no-useless-catch":"off", //✅ disallow unnecessary `catch` clauses
//"no-useless-escape":"off", //✅ disallow unnecessary escape characters
// "no-with":"off", //✅ disallow `with` statements
//"accessor-pairs":"off", // enforce getter and setter pairs in objects and classes
//"array-callback-return":"off", // enforce `return` statements in callbacks of array methods
//"block-scoped-var":"off", // enforce the use of variables within the scope they are defined
//"class-methods-use-this":"off", // enforce that class methods utilize `this`
//"complexity":"off", // enforce a maximum cyclomatic complexity allowed in a program
//"consistent-return":"off", // require `return` statements to either always or never specify values
//"curly":"off", //🔧 enforce consistent brace style for all control statements
"default-case": "error", // require `default` cases in `switch` statements
"default-case-last": "warn", // enforce default clauses in switch statements to be last
//"default-param-last":"off", // enforce default parameters to be last
//"dot-location":"off", //🔧 enforce consistent newlines before and after dots
"dot-notation": "off", //🔧 enforce dot notation whenever possible
"eqeqeq": "warn", //🔧 require the use of `===` and `!==`
//"grouped-accessor-pairs":"off", // require grouped accessor pairs in object literals and classes
//"guard-for-in":"off", // require `for-in` loops to include an `if` statement
//"max-classes-per-file":"off", // enforce a maximum number of classes per file
"no-alert": "warn", // disallow the use of `alert`, `confirm`, and `prompt`
"no-caller": "error", // disallow the use of `arguments.caller` or `arguments.callee`
"no-constructor-return": "error", // disallow returning value from constructor
//"no-div-regex":"off", //🔧 disallow division operators explicitly at the beginning of regular expressions
//"no-else-return":"off", //🔧 disallow `else` blocks after `return` statements in `if` statements
//"no-empty-function":"off", // disallow empty functions
//"no-eq-null":"off", // disallow `null` comparisons without type-checking operators
// "no-eval": "warn", // disallow the use of `eval()`
"no-extend-native": "warn", // disallow extending native types
//"no-extra-bind":"off", //🔧 disallow unnecessary calls to `.bind()`
//"no-extra-label":"off", //🔧 disallow unnecessary labels
//"no-floating-decimal":"off", //🔧 disallow leading or trailing decimal points in numeric literals
//"no-implicit-coercion":"off", //🔧 disallow shorthand type conversions
//"no-implicit-globals":"off", // disallow declarations in the global scope
//"no-implied-eval":"off", // disallow the use of `eval()`-like methods
// "no-invalid-this": "warn", // disallow `this` keywords outside of classes or class-like objects
//"no-iterator":"off", // disallow the use of the `__iterator__` property
//"no-labels":"off", // disallow labeled statements
//"no-lone-blocks":"off", // disallow unnecessary nested blocks
//"no-loop-func":"off", // disallow function declarations that contain unsafe references inside loop statements
"no-magic-numbers": "off", // disallow magic numbers
//"no-multi-spaces":"off", //🔧 disallow multiple spaces
//"no-multi-str":"off", // disallow multiline strings
//"no-new":"off", // disallow `new` operators outside of assignments or comparisons
//"no-new-func":"off", // disallow `new` operators with the `Function` object
//"no-new-wrappers":"off", // disallow `new` operators with the `String`, `Number`, and `Boolean` objects
//"no-nonoctal-decimal-escape":"off", // disallow `\8` and `\9` escape sequences in string literals
//"no-octal-escape":"off", // disallow octal escape sequences in string literals
//"no-param-reassign":"off", // disallow reassigning `function` parameters
//"no-proto":"off", // disallow the use of the `__proto__` property
//"no-restricted-properties":"off", // disallow certain properties on certain objects
//"no-return-assign":"off", // disallow assignment operators in `return` statements
//"no-return-await":"off", // disallow unnecessary `return await`
//"no-script-url":"off", // disallow `javascript:` urls
//"no-self-compare":"off", // disallow comparisons where both sides are exactly the same
//"no-sequences":"off", // disallow comma operators
//"no-throw-literal":"off", // disallow throwing literals as exceptions
"no-unmodified-loop-condition": "warn", // disallow unmodified loop conditions
//"no-unused-expressions":"off", // disallow unused expressions
//"no-useless-call":"off", // disallow unnecessary calls to `.call()` and `.apply()`
//"no-useless-concat":"off", // disallow unnecessary concatenation of literals or template literals
//"no-useless-return":"off", //🔧 disallow redundant return statements
//"no-void":"off", // disallow `void` operators
//"no-warning-comments":"off", // disallow specified warning terms in comments
//"prefer-named-capture-group":"off", // enforce using named capture group in regular expression
//"prefer-promise-reject-errors":"off", // require using Error objects as Promise rejection reasons
"prefer-regex-literals": "warn", // disallow use of the `RegExp` constructor in favor of regular expression literals
"radix": "warn", // enforce the consistent use of the radix argument when using `parseInt()`
//"require-await":"off", // disallow async functions which have no `await` expression
//"require-unicode-regexp":"off", // enforce the use of `u` flag on RegExp
//"vars-on-top":"off", // require `var` declarations be placed at the top of their containing scope
//"wrap-iife":"off", //🔧 require parentheses around immediate `function` invocations
//"yoda":"off", //🔧 require or disallow "Yoda" conditions
// eslint es6
//"constructor-super":"off", //✅ require `super()` calls in constructors
//"no-class-assign":"off", //✅ disallow reassigning class members
//"no-const-assign":"off", //✅ disallow reassigning `const` variables
"no-dupe-class-members": "off", //✅ disallow duplicate class members
//"no-new-symbol":"off", //✅ disallow `new` operators with the `Symbol` object
//"no-this-before-super":"off", //✅ disallow `this`/`super` before calling `super()` in constructors
//"require-yield":"off", //✅ require generator functions to contain `yield`
//"arrow-body-style":"off", //🔧 require braces around arrow function bodies
//"arrow-parens":"off", //🔧 require parentheses around arrow function arguments
//"arrow-spacing":"off", //🔧 enforce consistent spacing before and after the arrow in arrow functions
//"generator-star-spacing":"off", //🔧 enforce consistent spacing around `*` operators in generator functions
//"no-confusing-arrow":"off", //🔧 disallow arrow functions where they could be confused with comparisons
//"no-duplicate-imports":"off", // disallow duplicate module imports
//"no-restricted-exports":"off", // disallow specified names in exports
//"no-restricted-imports":"off", // disallow specified modules when loaded by `import`
//"no-useless-computed-key":"off", //🔧 disallow unnecessary computed property keys in objects and classes
//"no-useless-constructor":"off", // disallow unnecessary constructors
"no-useless-rename": "warn", //🔧 disallow renaming import, export, and destructured assignments to the same name
"no-var": "off", //🔧 require `let` or `const` instead of `var`
//"object-shorthand":"off", //🔧 require or disallow method and property shorthand syntax for object literals
//"prefer-arrow-callback":"off", //🔧 require using arrow functions for callbacks
//"prefer-const":"off", //🔧 require `const` declarations for variables that are never reassigned after declared
//"prefer-destructuring":"off", //🔧 require destructuring from arrays and/or objects
//"prefer-numeric-literals":"off", //🔧 disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
//"prefer-rest-params":"off", // require rest parameters instead of `arguments`
//"prefer-spread":"off", // require spread operators instead of `.apply()`
"prefer-template": "error", //🔧 require template literals instead of string concatenation
//"rest-spread-spacing":"off", //🔧 enforce spacing between rest and spread operators and their expressions
// "sort-imports": [
// "error",
// {
// "memberSyntaxSortOrder": [
// "none",
// "all",
// "single",
// "multiple"
// ]
// }
// ], //🔧 enforce sorted import declarations within modules
//"symbol-description":"off", // require symbol descriptions
//"template-curly-spacing":"off", //🔧 require or disallow spacing around embedded expressions of template strings
//"yield-star-spacing":"off", //🔧 require or disallow spacing around the `*` in `yield*` expressions
// eslint strict
//"strict":"off", //🔧 require or disallow strict mode directives
// eslint style
//"no-mixed-spaces-and-tabs":"off", //✅ disallow mixed spaces and tabs for indentation
//"array-bracket-newline":"off", //🔧 enforce linebreaks after opening and before closing array brackets
//"array-bracket-spacing":"off", //🔧 enforce consistent spacing inside array brackets
//"array-element-newline":"off", //🔧 enforce line breaks after each array element
//"block-spacing":"off", //🔧 disallow or enforce spaces inside of blocks after opening block and before closing block
//"brace-style":"off", //🔧 enforce consistent brace style for blocks
//"camelcase":"off", // enforce camelcase naming convention
//"capitalized-comments":"off", //🔧 enforce or disallow capitalization of the first letter of a comment
//"comma-dangle":"off", //🔧 require or disallow trailing commas
//"comma-spacing":"off", //🔧 enforce consistent spacing before and after commas
//"comma-style":"off", //🔧 enforce consistent comma style
//"computed-property-spacing":"off", //🔧 enforce consistent spacing inside computed property brackets
//"consistent-this":"off", // enforce consistent naming when capturing the current execution context
//"eol-last":"off", //🔧 require or disallow newline at the end of files
//"func-call-spacing":"off", //🔧 require or disallow spacing between function identifiers and their invocations
//"func-name-matching":"off", // require function names to match the name of the variable or property to which they are assigned
//"func-names":"off", // require or disallow named `function` expressions
//"func-style":"off", // enforce the consistent use of either `function` declarations or expressions
//"function-call-argument-newline":"off", //🔧 enforce line breaks between arguments of a function call
//"function-paren-newline":"off", //🔧 enforce consistent line breaks inside function parentheses
//"id-denylist":"off", // disallow specified identifiers
//"id-length":"off", // enforce minimum and maximum identifier lengths
//"id-match":"off", // require identifiers to match a specified regular expression
//"implicit-arrow-linebreak":"off", //🔧 enforce the location of arrow function bodies
//"indent":"off", //🔧 enforce consistent indentation
//"jsx-quotes":"off", //🔧 enforce the consistent use of either double or single quotes in JSX attributes
//"key-spacing":"off", //🔧 enforce consistent spacing between keys and values in object literal properties
//"keyword-spacing":"off", //🔧 enforce consistent spacing before and after keywords
//"line-comment-position":"off", // enforce position of line comments
//"linebreak-style":"off", //🔧 enforce consistent linebreak style
//"lines-around-comment":"off", //🔧 require empty lines around comments
"lines-between-class-members": "off", //🔧 require or disallow an empty line between class members
//"max-depth":"off", // enforce a maximum depth that blocks can be nested
//"max-len":"off", // enforce a maximum line length
//"max-lines":"off", // enforce a maximum number of lines per file
//"max-lines-per-function":"off", // enforce a maximum number of lines of code in a function
//"max-nested-callbacks":"off", // enforce a maximum depth that callbacks can be nested
//"max-params":"off", // enforce a maximum number of parameters in function definitions
//"max-statements":"off", // enforce a maximum number of statements allowed in function blocks
//"max-statements-per-line":"off", // enforce a maximum number of statements allowed per line
//"multiline-comment-style":"off", //🔧 enforce a particular style for multiline comments
// "multiline-ternary": "warn", //🔧 enforce newlines between operands of ternary expressions
"new-cap": "error", // require constructor names to begin with a capital letter
"new-parens": "error", //🔧 enforce or disallow parentheses when invoking a constructor with no arguments
// "newline-per-chained-call": "off", //🔧 require a newline after each call in a method chain
//"no-array-constructor":"off", // disallow `Array` constructors
//"no-bitwise":"off", // disallow bitwise operators
//"no-continue":"off", // disallow `continue` statements
//"no-inline-comments":"off", // disallow inline comments after code
//"no-lonely-if":"off", //🔧 disallow `if` statements as the only statement in `else` blocks
//"no-mixed-operators":"off", // disallow mixed binary operators
//"no-multi-assign":"off", // disallow use of chained assignment expressions
//"no-multiple-empty-lines":"off", //🔧 disallow multiple empty lines
"no-negated-condition": "warn", // disallow negated conditions
//"no-nested-ternary":"off", // disallow nested ternary expressions
//"no-new-object":"off", // disallow `Object` constructors
//"no-plusplus":"off", // disallow the unary operators `++` and `--`
//"no-restricted-syntax":"off", // disallow specified syntax
//"no-tabs":"off", // disallow all tabs
//"no-ternary":"off", // disallow ternary operators
//"no-trailing-spaces":"off", //🔧 disallow trailing whitespace at the end of lines
//"no-underscore-dangle":"off", // disallow dangling underscores in identifiers
//"no-unneeded-ternary":"off", //🔧 disallow ternary operators when simpler alternatives exist
//"no-whitespace-before-property":"off", //🔧 disallow whitespace before properties
//"nonblock-statement-body-position":"off", //🔧 enforce the location of single-line statements
//"object-curly-newline":"off", //🔧 enforce consistent line breaks after opening and before closing braces
//"object-curly-spacing":"off", //🔧 enforce consistent spacing inside braces
//"object-property-newline":"off", //🔧 enforce placing object properties on separate lines
//"one-var":"off", //🔧 enforce variables to be declared either together or separately in functions
//"one-var-declaration-per-line":"off", //🔧 require or disallow newlines around variable declarations
//"operator-assignment":"off", //🔧 require or disallow assignment operator shorthand where possible
//"operator-linebreak":"off", //🔧 enforce consistent linebreak style for operators
//"padded-blocks":"off", //🔧 require or disallow padding within blocks
//"padding-line-between-statements":"off", //🔧 require or disallow padding lines between statements
"prefer-exponentiation-operator": "error", //🔧 disallow the use of `Math.pow` in favor of the `**` operator
"prefer-object-spread": "error", //🔧 disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead.
//"quote-props":"off", //🔧 require quotes around object literal property names
//"quotes":"off", //🔧 enforce the consistent use of either backticks, double, or single quotes
//"semi":"off", //🔧 require or disallow semicolons instead of ASI
//"semi-spacing":"off", //🔧 enforce consistent spacing before and after semicolons
//"semi-style":"off", //🔧 enforce location of semicolons
//"sort-keys":"off", // require object keys to be sorted
//"sort-vars":"off", //🔧 require variables within the same declaration block to be sorted
//"space-before-blocks":"off", //🔧 enforce consistent spacing before blocks
//"space-before-function-paren":"off", //🔧 enforce consistent spacing before `function` definition opening parenthesis
//"space-in-parens":"off", //🔧 enforce consistent spacing inside parentheses
// "space-infix-ops": "error", //🔧 require spacing around infix operators
"space-unary-ops": "error", //🔧 enforce consistent spacing before or after unary operators
"spaced-comment": "off", //🔧 enforce consistent spacing after the `//` or `/*` in a comment
//"switch-colon-spacing":"off", //🔧 enforce spacing around colons of switch statements
//"template-tag-spacing":"off", //🔧 require or disallow spacing between template tags and their literals
//"unicode-bom":"off", //🔧 require or disallow Unicode byte order mark (BOM)
//"wrap-regex":"off", //🔧 require parenthesis around regex literals
// eslint syntax and logic
//"for-direction":"off", //✅ enforce "for" loop update clause moving the counter in the right direction.
//"getter-return":"off", //✅ enforce `return` statements in getters
//"no-async-promise-executor":"off", //✅ disallow using an async function as a Promise executor
//"no-compare-neg-zero":"off", //✅ disallow comparing against -0
//"no-cond-assign":"off", //✅ disallow assignment operators in conditional expressions
//"no-constant-condition":"off", //✅ disallow constant expressions in conditions
//"no-control-regex":"off", //✅ disallow control characters in regular expressions
//"no-debugger":"off", //✅ disallow the use of `debugger`
//"no-dupe-args":"off", //✅ disallow duplicate arguments in `function` definitions
//"no-dupe-else-if":"off", //✅ disallow duplicate conditions in if-else-if chains
//"no-dupe-keys":"off", //✅ disallow duplicate keys in object literals
//"no-duplicate-case":"off", //✅ disallow duplicate case labels
//"no-empty":"off", //✅ disallow empty block statements
//"no-empty-character-class":"off", //✅ disallow empty character classes in regular expressions
//"no-ex-assign":"off", //✅ disallow reassigning exceptions in `catch` clauses
//"no-extra-boolean-cast":"off", //✅🔧 disallow unnecessary boolean casts
//"no-extra-semi":"off", //✅🔧 disallow unnecessary semicolons
//"no-func-assign":"off", //✅ disallow reassigning `function` declarations
//"no-import-assign":"off", //✅ disallow assigning to imported bindings
//"no-inner-declarations":"off", //✅ disallow variable or `function` declarations in nested blocks
//"no-invalid-regexp":"off", //✅ disallow invalid regular expression strings in `RegExp` constructors
//"no-irregular-whitespace":"off", //✅ disallow irregular whitespace
//"no-misleading-character-class":"off", //✅ disallow characters which are made with multiple code points in character class syntax
//"no-obj-calls":"off", //✅ disallow calling global object properties as functions
//"no-prototype-builtins":"off", //✅ disallow calling some `Object.prototype` methods directly on objects
//"no-regex-spaces":"off", //✅🔧 disallow multiple spaces in regular expressions
//"no-setter-return":"off", //✅ disallow returning values from setters
//"no-sparse-arrays":"off", //✅ disallow sparse arrays
//"no-unexpected-multiline":"off", //✅ disallow confusing multiline expressions
//"no-unreachable":"off", //✅ disallow unreachable code after `return`, `throw`, `continue`, and `break` statements
//"no-unsafe-finally":"off", //✅ disallow control flow statements in `finally` blocks
//"no-unsafe-negation":"off", //✅ disallow negating the left operand of relational operators
//"use-isnan":"off", //✅ require calls to `isNaN()` when checking for `NaN`
//"valid-typeof":"off", //✅ enforce comparing `typeof` expressions against valid strings
//"no-await-in-loop":"off", // disallow `await` inside of loops
//"no-console":"off", // disallow the use of `console`
//"no-extra-parens":"off", //🔧 disallow unnecessary parentheses
//"no-loss-of-precision":"off", // disallow literal numbers that lose precision
//"no-promise-executor-return":"off", // disallow returning values from Promise executor functions
//"no-template-curly-in-string":"off", // disallow template literal placeholder syntax in regular strings
"no-unreachable-loop": "warn", // disallow loops with a body that allows only one iteration
//"no-unsafe-optional-chaining":"off", // disallow use of optional chaining in contexts where the `undefined` value is not allowed
//"no-useless-backreference":"off", // disallow useless backreferences in regular expressions
// "require-atomic-updates":"off", // disallow assignments that can lead to race conditions due to usage of `await` or `yield`
// eslint variable
//"no-delete-var":"off", //✅ disallow deleting variables
//"no-shadow-restricted-names":"off", //✅ disallow identifiers from shadowing restricted names
//"no-undef":"off", //✅ disallow the use of undeclared variables unless mentioned in `/*global */` comments
"no-unused-vars": "off", //✅ disallow unused variables
//"init-declarations":"off", // require or disallow initialization in variable declarations
"no-label-var": "error", // disallow labels that share a name with a variable
//"no-restricted-globals":"off", // disallow specified global variables
//"no-shadow":"off", // disallow variable declarations from shadowing variables declared in the outer scope
"no-undef-init": "error", //🔧 disallow initializing variables to `undefined`
//"no-undefined":"off", // disallow the use of `undefined` as an identifier
//"no-use-before-define":"off", // disallow the use of variables before they are defined
//#endregion
//#region @typescript-eslint
// @typescript-eslint supported
//"@typescript-eslint/adjacent-overload-signatures":"off", //✅ Require that member overloads be consecutive
//"@typescript-eslint/await-thenable": "off", //✅🤖 Disallows awaiting a value that is not a Thenable
//"@typescript-eslint/ban-ts-comment":"off", //✅ Bans @ts-<directive> comments from being used or requires descriptions after directive
//"@typescript-eslint/ban-types":"off", //✅🔧 Bans specific types from being used
//"@typescript-eslint/explicit-module-boundary-types":"off", //✅ Require explicit return and argument types on exported functions' and classes' public class methods
//"@typescript-eslint/no-empty-interface":"off", //✅🔧 Disallow the declaration of empty interfaces
//"@typescript-eslint/no-explicit-any":"off", //✅🔧 Disallow usage of the any type
//"@typescript-eslint/no-extra-non-null-assertion":"off", //✅🔧 Disallow extra non-null assertion
//"@typescript-eslint/no-floating-promises":"off", //✅🤖 Requires Promise-like values to be handled appropriately
//"@typescript-eslint/no-for-in-array":"off", //✅🤖 Disallow iterating over an array with a for-in loop
//"@typescript-eslint/no-inferrable-types":"off", //✅🔧 Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean
//"@typescript-eslint/no-misused-new":"off", //✅ Enforce valid definition of new and constructor
//"@typescript-eslint/no-misused-promises":"off", //✅🤖 Avoid using promises in places not designed to handle them
//"@typescript-eslint/no-namespace":"off", //✅ Disallow the use of custom TypeScript modules and namespaces
//"@typescript-eslint/no-non-null-asserted-optional-chain":"off", //✅ Disallows using a non-null assertion after an optional chain expression
//"@typescript-eslint/no-non-null-assertion":"off", //✅ Disallows non-null assertions using the ! postfix operator
//"@typescript-eslint/no-this-alias":"off", //✅ Disallow aliasing this
//"@typescript-eslint/no-unnecessary-type-assertion":"off", //✅🔧🤖 Warns if a type assertion does not change the type of an expression
//"@typescript-eslint/no-unsafe-assignment":"off", //✅🤖 Disallows assigning any to variables and properties
//"@typescript-eslint/no-unsafe-call":"off", //✅🤖 Disallows calling an any type value
//"@typescript-eslint/no-unsafe-member-access":"off", //✅🤖 Disallows member access on any typed variables
//"@typescript-eslint/no-unsafe-return":"off", //✅🤖 Disallows returning any from a function
//"@typescript-eslint/no-var-requires":"off", //✅ Disallows the use of require statements except in import statements
//"@typescript-eslint/prefer-as-const":"off", //✅🔧 Prefer usage of as const over literal type
//"@typescript-eslint/prefer-namespace-keyword":"off", //✅🔧 Require the use of the namespace keyword instead of the module keyword to declare custom TypeScript modules
"@typescript-eslint/prefer-regexp-exec": "off", //✅🔧🤖 Enforce that RegExp#exec is used instead of String#match if no global flag is provided
//"@typescript-eslint/restrict-plus-operands":"off", //✅🤖 When adding two variables, operands must both be of type number or of type string
//"@typescript-eslint/restrict-template-expressions":"off", //✅🤖 Enforce template literal expressions to be of string type
//"@typescript-eslint/triple-slash-reference":"off", //✅ Sets preference level for triple slash directives versus ES6-style import declarations
"@typescript-eslint/unbound-method": "off", //✅🤖 Enforces unbound methods are called with their expected scope
"@typescript-eslint/array-type": "error", //🔧 Requires using either T[] or Array<T> for arrays
//"@typescript-eslint/ban-tslint-comment":"off", //🔧 Bans // tslint:<rule-flag> comments from being used
"@typescript-eslint/class-literal-property-style": "warn", //🔧 Ensures that literals on classes are exposed in a consistent style
//"@typescript-eslint/consistent-indexed-object-style":"off", //🔧 Enforce or disallow the use of the record type
//"@typescript-eslint/consistent-type-assertions":"off", // Enforces consistent usage of type assertions
//"@typescript-eslint/consistent-type-definitions":"off", //🔧 Consistent with type definition either interface or type
"@typescript-eslint/consistent-type-imports": "warn", //🔧 Enforces consistent usage of type imports
"@typescript-eslint/explicit-function-return-type": "off", // Require explicit return types on functions and class methods
//"@typescript-eslint/explicit-member-accessibility":"off", //🔧 Require explicit accessibility modifiers on class properties and methods
//"@typescript-eslint/member-delimiter-style":"off", //🔧 Require a specific member delimiter style for interfaces and type literals
"@typescript-eslint/member-ordering": "warn", // Require a consistent member declaration order
//"@typescript-eslint/method-signature-style":"off", //🔧 Enforces using a particular method signature syntax.
//"@typescript-eslint/naming-convention":"off", //🤖 Enforces naming conventions for everything across a codebase
//"@typescript-eslint/no-base-to-string":"off", //🤖 Requires that .toString() is only called on objects which provide useful information when stringified
//"@typescript-eslint/no-confusing-non-null-assertion":"off", //🔧 Disallow non-null assertion in locations that may be confusing
//"@typescript-eslint/no-confusing-void-expression":"off", //🔧🤖 Requires expressions of type void to appear in statement position
//"@typescript-eslint/no-dynamic-delete":"off", //🔧 Disallow the delete operator with computed key expressions
//"@typescript-eslint/no-extraneous-class":"off", // Forbids the use of classes as namespaces
//"@typescript-eslint/no-implicit-any-catch":"off", //🔧 Disallow usage of the implicit any type in catch clauses
//"@typescript-eslint/no-invalid-void-type":"off", // Disallows usage of void type outside of generic or return types
//"@typescript-eslint/no-parameter-properties":"off", // Disallow the use of parameter properties in class constructors
//"@typescript-eslint/no-require-imports":"off", // Disallows invocation of require()
//"@typescript-eslint/no-type-alias":"off", // Disallow the use of type aliases
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn", //🔧🤖 Flags unnecessary equality comparisons against boolean literals
"@typescript-eslint/no-unnecessary-condition": "warn", //🔧🤖 Prevents conditionals where the type is always truthy or always falsy
//"@typescript-eslint/no-unnecessary-qualifier":"off", //🔧🤖 Warns when a namespace qualifier is unnecessary
//"@typescript-eslint/no-unnecessary-type-arguments":"off", //🔧🤖 Enforces that type arguments will not be used if not required
//"@typescript-eslint/no-unnecessary-type-constraint":"off", //🔧 Disallows unnecessary constraints on generic types
//"@typescript-eslint/no-unsafe-argument":"off", //🤖 Disallows calling an function with an any type value
//"@typescript-eslint/non-nullable-type-assertion-style":"off", //🔧🤖 Prefers a non-null assertion over explicit type cast when possible
//"@typescript-eslint/prefer-enum-initializers":"off", // Prefer initializing each enums member value
//"@typescript-eslint/prefer-for-of":"off", // Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated
//"@typescript-eslint/prefer-function-type":"off", //🔧 Use function types instead of interfaces with call signatures
"@typescript-eslint/prefer-includes": "error", //🔧🤖 Enforce includes method over indexOf method
//"@typescript-eslint/prefer-literal-enum-member":"off", // Require that all enum members be literal values to prevent unintended enum member name shadow issues
"@typescript-eslint/prefer-nullish-coalescing": "warn", //🤖 Enforce the usage of the nullish coalescing operator instead of logical chaining
//"@typescript-eslint/prefer-optional-chain":"off", // Prefer using concise optional chain expressions instead of chained logical ands
"@typescript-eslint/prefer-readonly": "warn", //🔧🤖 Requires that private members are marked as readonly if they're never modified outside of the constructor
"@typescript-eslint/prefer-readonly-parameter-types": "off", //🤖 Requires that function parameters are typed as readonly to prevent accidental mutation of inputs
//"@typescript-eslint/prefer-reduce-type-parameter":"off", //🔧🤖 Prefer using type parameter when calling Array#reduce instead of casting
"@typescript-eslint/prefer-string-starts-ends-with": "warn", //🔧🤖 Enforce the use of String#startsWith and String#endsWith instead of other equivalent methods of checking substrings
"@typescript-eslint/prefer-ts-expect-error": "error", //🔧 Recommends using @ts-expect-error over @ts-ignore
"@typescript-eslint/promise-function-async": "error", //🔧🤖 Requires any function or method that returns a Promise to be marked async
//"@typescript-eslint/require-array-sort-compare":"off", //🤖 Requires Array#sort calls to always provide a compareFunction
"@typescript-eslint/sort-type-union-intersection-members": "error", //🔧 Enforces that members of a type union/intersection are sorted alphabetically
//"@typescript-eslint/strict-boolean-expressions":"off", //🔧🤖 Restricts the types allowed in boolean expressions
//"@typescript-eslint/switch-exhaustiveness-check":"off", //🤖 Exhaustiveness checking in switch with union type
"@typescript-eslint/type-annotation-spacing": "error", //🔧 Require consistent spacing around type annotations
//"@typescript-eslint/typedef":"off", // Requires type annotations to exist
"@typescript-eslint/unified-signatures": "warn", // Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter
// @typescript-eslint extended
//"@typescript-eslint/no-array-constructor":"off", //✅🔧 Disallow generic Array constructors
//"@typescript-eslint/no-empty-function":"off", //✅ Disallow empty functions
//"@typescript-eslint/no-extra-semi":"off", //✅🔧 Disallow unnecessary semicolons
//"@typescript-eslint/no-implied-eval":"off", //✅🤖 Disallow the use of eval()-like methods
"@typescript-eslint/no-unused-vars": [
"warn",
{ "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }
], //✅ Disallow unused variables
//"@typescript-eslint/require-await":"off", //✅🤖 Disallow async functions which have no await expression
//"@typescript-eslint/brace-style":"off", //🔧 Enforce consistent brace style for blocks
//"@typescript-eslint/comma-dangle":"off", //🔧 Require or disallow trailing comma
//"@typescript-eslint/comma-spacing":"off", //🔧 Enforces consistent spacing before and after commas
//"@typescript-eslint/default-param-last":"off", // Enforce default parameters to be last
"@typescript-eslint/dot-notation": "error", //🔧🤖 enforce dot notation whenever possible
//"@typescript-eslint/func-call-spacing":"off", //🔧 Require or disallow spacing between function identifiers and their invocations
//"@typescript-eslint/indent":"off", //🔧 Enforce consistent indentation
//"@typescript-eslint/init-declarations":"off", // require or disallow initialization in variable declarations
//"@typescript-eslint/keyword-spacing":"off", //🔧 Enforce consistent spacing before and after keywords
"@typescript-eslint/lines-between-class-members": "error", //🔧 Require or disallow an empty line between class members
"@typescript-eslint/no-dupe-class-members": "error", // Disallow duplicate class members
//"@typescript-eslint/no-duplicate-imports":"off", // Disallow duplicate imports
//"@typescript-eslint/no-extra-parens":"off", //🔧 Disallow unnecessary parentheses
"@typescript-eslint/no-invalid-this": "warn", // Disallow this keywords outside of classes or class-like objects
//"@typescript-eslint/no-loop-func":"off", // Disallow function declarations that contain unsafe references inside loop statements
//"@typescript-eslint/no-loss-of-precision":"off", // Disallow literal numbers that lose precision
// "@typescript-eslint/no-magic-numbers": [
// "warn",
// { "ignoreDefaultValues": true, "ignore": [0, 1] }
// ], // Disallow magic numbers
//"@typescript-eslint/no-redeclare":"off", // Disallow variable redeclaration
"@typescript-eslint/no-shadow": "warn", // Disallow variable declarations from shadowing variables declared in the outer scope
//"@typescript-eslint/no-throw-literal":"off", //🤖 Disallow throwing literals as exceptions
"@typescript-eslint/no-unused-expressions": "off", // Disallow unused expressions
//"@typescript-eslint/no-use-before-define":"off", // Disallow the use of variables before they are defined
//"@typescript-eslint/no-useless-constructor":"off", // Disallow unnecessary constructors
//"@typescript-eslint/object-curly-spacing":"off", //🔧 Enforce consistent spacing inside braces
"@typescript-eslint/quotes": "off", //🔧 Enforce the consistent use of either backticks, double, or single quotes
"@typescript-eslint/return-await": "error", //🔧🤖 Enforces consistent returning of awaited values
//"@typescript-eslint/semi":"off", //🔧 Require or disallow semicolons instead of ASI
//"@typescript-eslint/space-before-function-paren":"off", //🔧 Enforces consistent spacing before function parenthesis
"@typescript-eslint/space-infix-ops": "error", //🔧 This rule is aimed at ensuring there are spaces around infix operators.
//#endregion
//#region Unicorn
// unicorn
// "unicorn/better-regex": "error", //✅🔧 Improve regexes by making them shorter, consistent, and safer.
// "unicorn/catch-error-name": "error", //✅🔧 Enforce a specific parameter name in catch clauses.
//"unicorn/consistent-destructuring": "error", //✅🔧 Use destructured variables over properties.
"unicorn/consistent-function-scoping": "off", //✅ Move function definitions to the highest possible scope.
//"unicorn/empty-brace-spaces": "error", //✅🔧 Enforce no spaces between braces.
//"unicorn/error-message": "error", //✅ Enforce passing a message value when creating a built-in error.
//"unicorn/escape-case": "error", //✅🔧 Require escape sequences to use uppercase values.
"unicorn/expiring-todo-comments": "off", //✅ Add expiration conditions to TODO comments.
//"unicorn/explicit-length-check": "error", //✅🔧 Enforce explicitly comparing the length or size property of a value.
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true
}
}
], //✅ Enforce a case style for filenames.
//"unicorn/import-style": "error", //✅ Enforce specific import styles per module.
//"unicorn/new-for-builtins": "error", //✅🔧 Enforce the use of new for all builtins, except String, Number, Boolean, Symbol and BigInt.
//"unicorn/no-abusive-eslint-disable": "error", //✅ Enforce specifying rules to disable in eslint-disable comments.
"unicorn/no-array-callback-reference": "warn", //✅ Prevent passing a function reference directly to iterator methods.
// "unicorn/no-array-for-each": "warn", //✅🔧 Prefer for…of over Array#forEach(…).
//"unicorn/no-array-method-this-argument": "error", //✅🔧 Disallow using the this argument in array methods.
//"unicorn/no-array-push-push": "error", //✅🔧 Enforce combining multiple Array#push() into one call.
"unicorn/no-array-reduce": ["error", { "allowSimpleOperations": true }], //✅ Disallow Array#reduce() and Array#reduceRight().
//"unicorn/no-console-spaces": "error", //✅🔧 Do not use leading/trailing space between console.log parameters.
//"unicorn/no-document-cookie": "error", //✅ Do not use document.cookie directly.
//"unicorn/no-for-loop": "error", //✅🔧 Do not use a for loop that can be replaced with a for-of loop.
//"unicorn/no-hex-escape": "error", //✅🔧 Enforce the use of Unicode escapes instead of hexadecimal escapes.
//"unicorn/no-instanceof-array": "error", //✅🔧 Require Array.isArray() instead of instanceof Array.
//"unicorn/no-lonely-if": "error", //✅🔧 Disallow if statements as the only statement in if blocks without else.
//"unicorn/no-nested-ternary": "error", //✅🔧 Disallow nested ternary expressions.
//"unicorn/no-new-array": "error", //✅🔧 Disallow new Array().
//"unicorn/no-new-buffer": "error", //✅🔧 Enforce the use of Buffer.from() and Buffer.alloc() instead of the deprecated new Buffer().
//"unicorn/no-null": "error", //✅🔧 Disallow the use of the null literal.
//"unicorn/no-object-as-default-parameter": "error", //✅ Disallow the use of objects as default parameters.
//"unicorn/no-process-exit": "error", //✅ Disallow process.exit().
//"unicorn/no-static-only-class": "error", //✅🔧 Forbid classes that only have static members.
//"unicorn/no-this-assignment": "error", //✅ Disallow assigning this to a variable.
//"unicorn/no-unreadable-array-destructuring": "error", //✅🔧 Disallow unreadable array destructuring.
//"unicorn/no-useless-length-check": "error", //✅🔧 Disallow useless array length check.
//"unicorn/no-useless-spread": "error", //✅🔧 Disallow unnecessary spread.
//"unicorn/no-useless-undefined": "error", //✅🔧 Disallow useless undefined.
//"unicorn/no-zero-fractions": "error", //✅🔧 Disallow number literals with zero fractions or dangling dots.
//"unicorn/number-literal-case": "error", //✅🔧 Enforce proper case for numeric literals.
//"unicorn/numeric-separators-style": "error", //✅🔧 Enforce the style of numeric separators by correctly grouping digits.
//"unicorn/prefer-add-event-listener": "error", //✅🔧 Prefer .addEventListener() and .removeEventListener() over on-functions.
//"unicorn/prefer-array-find": "error", //✅🔧 Prefer .find(…) over the first element from .filter(…).
//"unicorn/prefer-array-flat": "error", //✅🔧 Prefer Array#flat() over legacy techniques to flatten arrays.
//"unicorn/prefer-array-flat-map": "error", //✅🔧 Prefer .flatMap(…) over .map(…).flat().
//"unicorn/prefer-array-index-of": "error", //✅🔧 Prefer Array#indexOf() over Array#findIndex() when looking for the index of an item.
//"unicorn/prefer-array-some": "error", //✅🔧 Prefer .some(…) over .filter(…).length check and .find(…).
//"unicorn/prefer-date-now": "error", //✅🔧 Prefer Date.now() to get the number of milliseconds since the Unix Epoch.
//"unicorn/prefer-default-parameters": "error", //✅🔧 Prefer default parameters over reassignment.
//"unicorn/prefer-dom-node-append": "error", //✅🔧 Prefer Node#append() over Node#appendChild().
//"unicorn/prefer-dom-node-dataset": "error", //✅🔧 Prefer using .dataset on DOM elements over .setAttribute(…).
//"unicorn/prefer-dom-node-remove": "error", //✅🔧 Prefer childNode.remove() over parentNode.removeChild(childNode).
//"unicorn/prefer-dom-node-text-content": "error", //✅ Prefer .textContent over .innerText.
//"unicorn/prefer-includes": "error", //✅🔧 Prefer .includes() over .indexOf() and Array#some() when checking for existence or non-existence.
//"unicorn/prefer-keyboard-event-key": "error", //✅🔧 Prefer KeyboardEvent#key over KeyboardEvent#keyCode.
//"unicorn/prefer-math-trunc": "error", //✅🔧 Enforce the use of Math.trunc instead of bitwise operators.
//"unicorn/prefer-modern-dom-apis": "error", //✅🔧 Prefer .before() over .insertBefore(), .replaceWith() over .replaceChild(), prefer one of .before(), .after(), .append() or .prepend() over insertAdjacentText() and insertAdjacentElement().
//"unicorn/prefer-module": "error", //✅🔧 Prefer JavaScript modules (ESM) over CommonJS.
//"unicorn/prefer-negative-index": "error", //✅🔧 Prefer negative index over .length - index for {String,Array,TypedArray}#slice(), Array#splice() and Array#at().
//"unicorn/prefer-node-protocol": "error", //✅🔧 Prefer using the node: protocol when importing Node.js builtin modules.
//"unicorn/prefer-number-properties": "error", //✅🔧 Prefer Number static properties over global ones.
//"unicorn/prefer-optional-catch-binding": "error", //✅🔧 Prefer omitting the catch binding parameter.
//"unicorn/prefer-prototype-methods": "error", //✅🔧 Prefer borrowing methods from the prototype instead of the instance.
//"unicorn/prefer-query-selector": "error", //✅🔧 Prefer .querySelector() over .getElementById(), .querySelectorAll() over .getElementsByClassname() and .getElementsByTagname().
//"unicorn/prefer-reflect-apply": "error", //✅🔧 Prefer Reflect.apply() over Function#apply().
//"unicorn/prefer-regexp-test": "error", //✅🔧 Prefer RegExp#test() over String#match() and RegExp#exec().
//"unicorn/prefer-set-has": "error", //✅🔧 Prefer Set#has() over Array#includes() when checking for existence or non-existence.
//"unicorn/prefer-spread": "error", //✅🔧 Prefer the spread operator over Array.from(…), Array#concat(…) and Array#slice().
//"unicorn/prefer-string-slice": "error", //✅🔧 Prefer String#slice() over String#substr() and String#substring().
//"unicorn/prefer-string-starts-ends-with": "error", //✅🔧 Prefer String#startsWith() & String#endsWith() over RegExp#test().
//"unicorn/prefer-string-trim-start-end": "error", //✅🔧 Prefer String#trimStart() / String#trimEnd() over String#trimLeft() / String#trimRight().
//"unicorn/prefer-switch": "error", //✅🔧 Prefer switch over multiple else-if.
//"unicorn/prefer-ternary": "error", //✅🔧 Prefer ternary expressions over simple if-else statements.
//"unicorn/prefer-type-error": "error", //✅🔧 Enforce throwing TypeError in type checking conditions.
//"unicorn/prevent-abbreviations": "error", //✅🔧 Prevent abbreviations.
//"unicorn/require-array-join-separator": "error", //✅🔧 Enforce using the separator argument with Array#join().
//"unicorn/require-number-to-fixed-digits-argument": "error", //✅🔧 Enforce using the digits argument with Number#toFixed().
//"unicorn/require-post-message-target-origin": "error", //✅ Enforce using the targetOrigin argument with window.postMessage().
//"unicorn/throw-new-error": "error", //✅🔧 Require new when throwing an error.
"unicorn/custom-error-definition": "off", //🔧 Enforce correct Error subclassing.
//"unicorn/import-index": "off", //🔧 Enforce importing index files with ..
//"unicorn/no-keyword-prefix": "off", // Disallow identifiers starting with new or class.
//"unicorn/no-unsafe-regex": "off", // Disallow unsafe regular expressions.
//"unicorn/no-unused-properties": "off", // Disallow unused object properties.
//"unicorn/prefer-at": "off", //🔧 Prefer .at() method for index access and String#charAt().
//"unicorn/prefer-object-has-own": "off", //🔧 Prefer Object.hasOwn(…) over Object.prototype.hasOwnProperty.call(…).
"unicorn/prefer-string-replace-all": "warn", //🔧 Prefer String#replaceAll() over regex searches with the global flag.
//"unicorn/prefer-top-level-await": "off", // Prefer top-level await over top-level promises and async function calls.
//"unicorn/string-content": "off", //🔧 Enforce better string content.
//#endregion
//#region ava
// ava
"ava/assertion-arguments": "error", //✅ Enforce passing correct arguments to assertions
//"ava/hooks-order": "error", //✅🔧 Enforce test hook ordering
"ava/max-asserts": ["warn", 5], //✅ Limit the number of assertions in a test
"ava/no-async-fn-without-await": "error", //✅ Ensure that async tests use await
//"ava/no-duplicate-modifiers": "error", //✅ Ensure tests do not have duplicate modifiers
//"ava/no-identical-title": "error", //✅ Ensure no tests have the same title
//"ava/no-ignored-test-files": "error", //✅ Ensure no tests are written in ignored files
//"ava/no-import-test-files": "error", //✅ Ensure no test files are imported anywhere
//"ava/no-incorrect-deep-equal": "error", //✅🔧 Avoid using deepEqual with primitives
//"ava/no-inline-assertions": "error", //✅🔧 Ensure assertions are not called from inline arrow functions
//"ava/no-invalid-end": "error", //✅ Ensure t.end() is only called inside test.cb()
//"ava/no-nested-tests": "error", //✅ Ensure no tests are nested
//"ava/no-only-test": "error", //✅ Ensure no test.only() are present
//"ava/no-skip-assert": "error", //✅ Ensure no assertions are skipped
//"ava/no-skip-test": "error", //✅ Ensure no tests are skipped
//"ava/no-statement-after-end": "error", //✅ Ensure t.end() is the last statement executed
//"ava/no-todo-implementation": "error", //✅ Ensure test.todo() is not given an implementation function
//"ava/no-todo-test": "warn", //✅ Ensure no test.todo() is used
//"ava/no-unknown-modifiers": "error", //✅ Prevent the use of unknown test modifiers
//"ava/prefer-async-await": "error", //✅ Prefer using async/await instead of returning a Promise
//"ava/prefer-t-regex": "error", //✅🔧 Prefer using t.regex() to test regular expressions
"ava/test-ended": "error", //✅ Ensure callback tests are explicitly ended
"ava/test-title": "error", //✅ Ensure tests have a title
"ava/use-t": "error", //✅ Ensure test functions use t as their parameter
"ava/use-t-throws-async-well": "error", //✅🔧 Ensure that t.throwsAsync() and t.notThrowsAsync() are awaited
"ava/use-t-well": "error", //✅🔧 Prevent the incorrect use of t
//"ava/use-test": "error", //✅ Ensure that AVA is imported with test as the variable name
//"ava/use-true-false": "error", //✅ Ensure that t.true()/t.false() are used instead of t.truthy()/t.falsy()
//"ava/no-cb-test": "off", // Ensure no test.cb() is used
//"ava/prefer-power-assert": "off", // Allow only use of the asserts that have no power-assert alternative
//"ava/test-title-format": "off", // Ensure test titles have a certain format
//#endregion
//#region promise
// promise
//"promise/always-return": "error", //✅ Return inside each then() to create readable and reusable Promise chains.
//"promise/catch-or-return": "error", //✅ Enforces the use of catch() on un-returned promises.
//"promise/no-callback-in-promise": "warn", //✅ Avoid calling cb() inside of a then() (use nodeify instead)
//"promise/no-nesting": "warn", //✅ Avoid nested then() or catch() statements
//"promise/no-new-statics": "error", //✅🔧 Avoid calling new on a Promise static method
//"promise/no-promise-in-callback": "warn", //✅ Avoid using promises inside of callbacks
//"promise/no-return-in-finally": "warn", //✅ Disallow return statements in finally()
//"promise/no-return-wrap": "error", //✅ Avoid wrapping values in Promise.resolve or Promise.reject when not needed.
//"promise/param-names": "error", //✅ Enforce consistent param names and ordering when creating new promises.
//"promise/valid-params": "warn", //✅ Ensures the proper number of arguments are passed to Promise functions
//"promise/avoid-new": "warn", // Avoid creating new promises outside of utility libs (use pify instead)
//"promise/no-native": "off", // In an ES5 environment, make sure to create a Promise constructor before using.
"promise/prefer-await-to-callbacks": "error", // Prefer async/await to the callback pattern
"promise/prefer-await-to-then": "error", // Prefer await to then()/catch()/finally() for reading Promise values
//#endregion
//prettier
"prettier/prettier": "error",
//#region jsdoc
"jsdoc/check-access": "error", // ✅
"jsdoc/check-alignment": "warn", // ✅
"jsdoc/check-examples": "off",
"jsdoc/check-indentation": "off",
"jsdoc/check-line-alignment": "off",
"jsdoc/check-param-names": ["error", { "enableFixer": true }], // ✅
"jsdoc/check-property-names": ["error", { "enableFixer": true }], // ✅
"jsdoc/check-syntax": "off",
"jsdoc/check-tag-names": 1, // ✅
"jsdoc/check-types": "off", // ✅
"jsdoc/check-values": "off", // ✅
"jsdoc/empty-tags": 1, // ✅
"jsdoc/implements-on-classes": 1, // ✅
"jsdoc/match-description": [
"error",
{
"mainDescription": {
"message": "Capitalize first word of JSDoc block descriptions",
"match": "[A-Z].*"
},
"tags": {
"param": {
"message": "Description must be at least 5 characters long",
"match": "....."
}
}
}
],
"jsdoc/multiline-blocks": 1, // ✅
"jsdoc/newline-after-description": 1, // ✅
// "jsdoc/no-bad-blocks": 1,
// "jsdoc/no-defaults": 1,
// "jsdoc/no-missing-syntax": 1,
"jsdoc/no-multi-asterisks": 1, // ✅
// "jsdoc/no-restricted-syntax": 1,
"jsdoc/no-types": "error",
"jsdoc/no-undefined-types": 1, // ✅
"jsdoc/require-asterisk-prefix": "error",
"jsdoc/require-description": "error",
"jsdoc/require-description-complete-sentence": "off",
// "jsdoc/require-example": 1,
"jsdoc/require-file-overview": "off",
"jsdoc/require-hyphen-before-param-description": "error",
"jsdoc/require-jsdoc": "error", // ✅
"jsdoc/require-param": "error", // ✅
"jsdoc/require-param-description": "error", // ✅
"jsdoc/require-param-name": "error", // ✅
"jsdoc/require-param-type": "off", // ✅
"jsdoc/require-property": 1, // ✅
"jsdoc/require-property-description": 1, // ✅
"jsdoc/require-property-name": 1, // ✅
"jsdoc/require-property-type": 1, // ✅
"jsdoc/require-returns": 1, // ✅
"jsdoc/require-returns-check": 1, // ✅
"jsdoc/require-returns-description": "error", // ✅
"jsdoc/require-returns-type": "off", // ✅
"jsdoc/require-throws": 1,
"jsdoc/require-yields": 1, // ✅
"jsdoc/require-yields-check": 1, // ✅
"jsdoc/tag-lines": 1, // ✅
"jsdoc/valid-types": 1 // ✅
//#endregion
}
}