@biscuittin/eslint-config 0.4.4 → 0.4.6
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/dist/{index.d.ts → index.d.mts} +233 -145
- package/dist/{index.js → index.mjs} +1 -0
- package/package.json +24 -24
- package/typegen.d.ts +233 -145
|
@@ -145,6 +145,11 @@ interface RuleOptions {
|
|
|
145
145
|
* @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect
|
|
146
146
|
*/
|
|
147
147
|
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Prevents dollar signs from being inserted as text nodes before expressions.
|
|
150
|
+
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
151
|
+
*/
|
|
152
|
+
'@eslint-react/jsx-dollar'?: Linter.RuleEntry<[]>;
|
|
148
153
|
/**
|
|
149
154
|
* Enforces that the 'key' prop is placed before the spread prop in JSX elements.
|
|
150
155
|
* @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread
|
|
@@ -308,6 +313,7 @@ interface RuleOptions {
|
|
|
308
313
|
/**
|
|
309
314
|
* Disallow certain props on components.
|
|
310
315
|
* @see https://eslint-react.xyz/docs/rules/no-forbidden-props
|
|
316
|
+
* @deprecated
|
|
311
317
|
*/
|
|
312
318
|
'@eslint-react/no-forbidden-props'?: Linter.RuleEntry<EslintReactNoForbiddenProps>;
|
|
313
319
|
/**
|
|
@@ -429,7 +435,7 @@ interface RuleOptions {
|
|
|
429
435
|
* Prevents using referential-type values as default props in object destructuring.
|
|
430
436
|
* @see https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
431
437
|
*/
|
|
432
|
-
'@eslint-react/no-unstable-default-props'?: Linter.RuleEntry<
|
|
438
|
+
'@eslint-react/no-unstable-default-props'?: Linter.RuleEntry<EslintReactNoUnstableDefaultProps>;
|
|
433
439
|
/**
|
|
434
440
|
* Warns unused class component methods and properties.
|
|
435
441
|
* @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
@@ -674,6 +680,11 @@ interface RuleOptions {
|
|
|
674
680
|
* @see https://eslint.style/rules/eol-last
|
|
675
681
|
*/
|
|
676
682
|
'@stylistic/eol-last'?: Linter.RuleEntry<StylisticEolLast>;
|
|
683
|
+
/**
|
|
684
|
+
* Enforce consistent spacing and line break styles inside brackets.
|
|
685
|
+
* @see https://eslint.style/rules/list-style
|
|
686
|
+
*/
|
|
687
|
+
'@stylistic/exp-list-style'?: Linter.RuleEntry<StylisticExpListStyle>;
|
|
677
688
|
/**
|
|
678
689
|
* Enforce line breaks between arguments of a function call
|
|
679
690
|
* @see https://eslint.style/rules/function-call-argument-newline
|
|
@@ -1524,6 +1535,11 @@ interface RuleOptions {
|
|
|
1524
1535
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
1525
1536
|
*/
|
|
1526
1537
|
'@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
|
|
1538
|
+
/**
|
|
1539
|
+
* Disallow unused private class members
|
|
1540
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
1541
|
+
*/
|
|
1542
|
+
'@typescript-eslint/no-unused-private-class-members'?: Linter.RuleEntry<[]>;
|
|
1527
1543
|
/**
|
|
1528
1544
|
* Disallow unused variables
|
|
1529
1545
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -4906,7 +4922,7 @@ interface RuleOptions {
|
|
|
4906
4922
|
*/
|
|
4907
4923
|
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
|
|
4908
4924
|
/**
|
|
4909
|
-
* Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
4925
|
+
* Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
4910
4926
|
*/
|
|
4911
4927
|
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
|
|
4912
4928
|
'react-refresh/only-export-components'?: Linter.RuleEntry<ReactRefreshOnlyExportComponents>;
|
|
@@ -5450,710 +5466,725 @@ interface RuleOptions {
|
|
|
5450
5466
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5451
5467
|
/**
|
|
5452
5468
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
5453
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5469
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/better-regex.md
|
|
5454
5470
|
*/
|
|
5455
5471
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
5456
5472
|
/**
|
|
5457
5473
|
* Enforce a specific parameter name in catch clauses.
|
|
5458
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5474
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/catch-error-name.md
|
|
5459
5475
|
*/
|
|
5460
5476
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5461
5477
|
/**
|
|
5462
5478
|
* Enforce consistent assertion style with `node:assert`.
|
|
5463
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5479
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-assert.md
|
|
5464
5480
|
*/
|
|
5465
5481
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5466
5482
|
/**
|
|
5467
5483
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5468
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5484
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-date-clone.md
|
|
5469
5485
|
*/
|
|
5470
5486
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5471
5487
|
/**
|
|
5472
5488
|
* Use destructured variables over properties.
|
|
5473
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5489
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-destructuring.md
|
|
5474
5490
|
*/
|
|
5475
5491
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5476
5492
|
/**
|
|
5477
5493
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5478
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5494
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5479
5495
|
*/
|
|
5480
5496
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5481
5497
|
/**
|
|
5482
5498
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5483
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5499
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-existence-index-check.md
|
|
5484
5500
|
*/
|
|
5485
5501
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5486
5502
|
/**
|
|
5487
5503
|
* Move function definitions to the highest possible scope.
|
|
5488
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5504
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-function-scoping.md
|
|
5489
5505
|
*/
|
|
5490
5506
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5491
5507
|
/**
|
|
5492
5508
|
* Enforce correct `Error` subclassing.
|
|
5493
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5509
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/custom-error-definition.md
|
|
5494
5510
|
*/
|
|
5495
5511
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5496
5512
|
/**
|
|
5497
5513
|
* Enforce no spaces between braces.
|
|
5498
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5514
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/empty-brace-spaces.md
|
|
5499
5515
|
*/
|
|
5500
5516
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5501
5517
|
/**
|
|
5502
5518
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5503
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5519
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/error-message.md
|
|
5504
5520
|
*/
|
|
5505
5521
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5506
5522
|
/**
|
|
5507
5523
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5508
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5524
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/escape-case.md
|
|
5509
5525
|
*/
|
|
5510
5526
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5511
5527
|
/**
|
|
5512
5528
|
* Add expiration conditions to TODO comments.
|
|
5513
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5529
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/expiring-todo-comments.md
|
|
5514
5530
|
*/
|
|
5515
5531
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5516
5532
|
/**
|
|
5517
5533
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5518
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5534
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/explicit-length-check.md
|
|
5519
5535
|
*/
|
|
5520
5536
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5521
5537
|
/**
|
|
5522
5538
|
* Enforce a case style for filenames.
|
|
5523
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5539
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/filename-case.md
|
|
5524
5540
|
*/
|
|
5525
5541
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5526
5542
|
/**
|
|
5527
5543
|
* Enforce specific import styles per module.
|
|
5528
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5544
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/import-style.md
|
|
5529
5545
|
*/
|
|
5530
5546
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5531
5547
|
/**
|
|
5532
5548
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
5533
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5549
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/new-for-builtins.md
|
|
5534
5550
|
*/
|
|
5535
5551
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5536
5552
|
/**
|
|
5537
5553
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5538
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5554
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5539
5555
|
*/
|
|
5540
5556
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5541
5557
|
/**
|
|
5542
5558
|
* Disallow recursive access to `this` within getters and setters.
|
|
5543
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5559
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-accessor-recursion.md
|
|
5544
5560
|
*/
|
|
5545
5561
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5546
5562
|
/**
|
|
5547
5563
|
* Disallow anonymous functions and classes as the default export.
|
|
5548
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5564
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-anonymous-default-export.md
|
|
5549
5565
|
*/
|
|
5550
5566
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5551
5567
|
/**
|
|
5552
5568
|
* Prevent passing a function reference directly to iterator methods.
|
|
5553
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5569
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-callback-reference.md
|
|
5554
5570
|
*/
|
|
5555
5571
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
5556
5572
|
/**
|
|
5557
5573
|
* Prefer `for…of` over the `forEach` method.
|
|
5558
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5574
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-for-each.md
|
|
5559
5575
|
*/
|
|
5560
5576
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
5561
5577
|
/**
|
|
5562
5578
|
* Disallow using the `this` argument in array methods.
|
|
5563
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5579
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-method-this-argument.md
|
|
5564
5580
|
*/
|
|
5565
5581
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5566
5582
|
/**
|
|
5567
5583
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5568
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5584
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
5569
5585
|
* @deprecated
|
|
5570
5586
|
*/
|
|
5571
5587
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5572
5588
|
/**
|
|
5573
5589
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5590
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reduce.md
|
|
5575
5591
|
*/
|
|
5576
5592
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5577
5593
|
/**
|
|
5578
5594
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5595
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reverse.md
|
|
5580
5596
|
*/
|
|
5581
5597
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5582
5598
|
/**
|
|
5583
5599
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
5584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5600
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-sort.md
|
|
5585
5601
|
*/
|
|
5586
5602
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
5587
5603
|
/**
|
|
5588
5604
|
* Disallow member access from await expression.
|
|
5589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5605
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-expression-member.md
|
|
5590
5606
|
*/
|
|
5591
5607
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5592
5608
|
/**
|
|
5593
5609
|
* Disallow using `await` in `Promise` method parameters.
|
|
5594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5610
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5595
5611
|
*/
|
|
5596
5612
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5597
5613
|
/**
|
|
5598
5614
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5615
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-console-spaces.md
|
|
5600
5616
|
*/
|
|
5601
5617
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
5602
5618
|
/**
|
|
5603
5619
|
* Do not use `document.cookie` directly.
|
|
5604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5620
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-document-cookie.md
|
|
5605
5621
|
*/
|
|
5606
5622
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
5607
5623
|
/**
|
|
5608
5624
|
* Disallow empty files.
|
|
5609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5625
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-empty-file.md
|
|
5610
5626
|
*/
|
|
5611
5627
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
5612
5628
|
/**
|
|
5613
5629
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5630
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-for-loop.md
|
|
5615
5631
|
*/
|
|
5616
5632
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5617
5633
|
/**
|
|
5618
5634
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
5619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5635
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-hex-escape.md
|
|
5620
5636
|
*/
|
|
5621
5637
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5638
|
+
/**
|
|
5639
|
+
* Disallow immediate mutation after variable assignment.
|
|
5640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-immediate-mutation.md
|
|
5641
|
+
*/
|
|
5642
|
+
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
5622
5643
|
/**
|
|
5623
5644
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
5625
5646
|
* @deprecated
|
|
5626
5647
|
*/
|
|
5627
5648
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5628
5649
|
/**
|
|
5629
5650
|
* Disallow `instanceof` with built-in objects
|
|
5630
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-instanceof-builtins.md
|
|
5631
5652
|
*/
|
|
5632
5653
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
5633
5654
|
/**
|
|
5634
5655
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5635
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5636
5657
|
*/
|
|
5637
5658
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
5638
5659
|
/**
|
|
5639
5660
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5640
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5641
5662
|
*/
|
|
5642
5663
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
5643
5664
|
/**
|
|
5644
5665
|
* Disallow identifiers starting with `new` or `class`.
|
|
5645
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-keyword-prefix.md
|
|
5646
5667
|
*/
|
|
5647
5668
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
5648
5669
|
/**
|
|
5649
5670
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
5650
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
5651
5672
|
* @deprecated
|
|
5652
5673
|
*/
|
|
5653
5674
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
5654
5675
|
/**
|
|
5655
5676
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5656
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5677
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-lonely-if.md
|
|
5657
5678
|
*/
|
|
5658
5679
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
5659
5680
|
/**
|
|
5660
5681
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5661
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5682
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5662
5683
|
*/
|
|
5663
5684
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5664
5685
|
/**
|
|
5665
5686
|
* Disallow named usage of default import and export.
|
|
5666
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5687
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-named-default.md
|
|
5667
5688
|
*/
|
|
5668
5689
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
5669
5690
|
/**
|
|
5670
5691
|
* Disallow negated conditions.
|
|
5671
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5692
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negated-condition.md
|
|
5672
5693
|
*/
|
|
5673
5694
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
5674
5695
|
/**
|
|
5675
5696
|
* Disallow negated expression in equality check.
|
|
5676
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5697
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negation-in-equality-check.md
|
|
5677
5698
|
*/
|
|
5678
5699
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
5679
5700
|
/**
|
|
5680
5701
|
* Disallow nested ternary expressions.
|
|
5681
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5702
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-nested-ternary.md
|
|
5682
5703
|
*/
|
|
5683
5704
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5684
5705
|
/**
|
|
5685
5706
|
* Disallow `new Array()`.
|
|
5686
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5707
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-array.md
|
|
5687
5708
|
*/
|
|
5688
5709
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
5689
5710
|
/**
|
|
5690
5711
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5691
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5712
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-buffer.md
|
|
5692
5713
|
*/
|
|
5693
5714
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
5694
5715
|
/**
|
|
5695
5716
|
* Disallow the use of the `null` literal.
|
|
5696
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5717
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-null.md
|
|
5697
5718
|
*/
|
|
5698
5719
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
5699
5720
|
/**
|
|
5700
5721
|
* Disallow the use of objects as default parameters.
|
|
5701
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5722
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5702
5723
|
*/
|
|
5703
5724
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
5704
5725
|
/**
|
|
5705
5726
|
* Disallow `process.exit()`.
|
|
5706
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5727
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-process-exit.md
|
|
5707
5728
|
*/
|
|
5708
5729
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
5709
5730
|
/**
|
|
5710
5731
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5711
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5732
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5712
5733
|
*/
|
|
5713
5734
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5714
5735
|
/**
|
|
5715
5736
|
* Disallow classes that only have static members.
|
|
5716
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5737
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-static-only-class.md
|
|
5717
5738
|
*/
|
|
5718
5739
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
5719
5740
|
/**
|
|
5720
5741
|
* Disallow `then` property.
|
|
5721
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5742
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-thenable.md
|
|
5722
5743
|
*/
|
|
5723
5744
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
5724
5745
|
/**
|
|
5725
5746
|
* Disallow assigning `this` to a variable.
|
|
5726
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5747
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-this-assignment.md
|
|
5727
5748
|
*/
|
|
5728
5749
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
5729
5750
|
/**
|
|
5730
5751
|
* Disallow comparing `undefined` using `typeof`.
|
|
5731
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5752
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-typeof-undefined.md
|
|
5732
5753
|
*/
|
|
5733
5754
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
5734
5755
|
/**
|
|
5735
5756
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
5736
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5757
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
5737
5758
|
*/
|
|
5738
5759
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5739
5760
|
/**
|
|
5740
5761
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
5741
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5762
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
5742
5763
|
*/
|
|
5743
5764
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
5744
5765
|
/**
|
|
5745
5766
|
* Disallow awaiting non-promise values.
|
|
5746
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5767
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-await.md
|
|
5747
5768
|
*/
|
|
5748
5769
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
5749
5770
|
/**
|
|
5750
5771
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5751
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5772
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5752
5773
|
*/
|
|
5753
5774
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
5754
5775
|
/**
|
|
5755
5776
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
5756
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5777
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
5757
5778
|
*/
|
|
5758
5779
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
5759
5780
|
/**
|
|
5760
5781
|
* Disallow unreadable array destructuring.
|
|
5761
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5782
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
5762
5783
|
*/
|
|
5763
5784
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
5764
5785
|
/**
|
|
5765
5786
|
* Disallow unreadable IIFEs.
|
|
5766
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5787
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-iife.md
|
|
5767
5788
|
*/
|
|
5768
5789
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
5769
5790
|
/**
|
|
5770
5791
|
* Disallow unused object properties.
|
|
5771
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5792
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unused-properties.md
|
|
5772
5793
|
*/
|
|
5773
5794
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
5795
|
+
/**
|
|
5796
|
+
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
5797
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-collection-argument.md
|
|
5798
|
+
*/
|
|
5799
|
+
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
5774
5800
|
/**
|
|
5775
5801
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
5776
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5802
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
5777
5803
|
*/
|
|
5778
5804
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
5779
5805
|
/**
|
|
5780
5806
|
* Disallow useless fallback when spreading in object literals.
|
|
5781
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5807
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5782
5808
|
*/
|
|
5783
5809
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
5784
5810
|
/**
|
|
5785
5811
|
* Disallow useless array length check.
|
|
5786
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5812
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-length-check.md
|
|
5787
5813
|
*/
|
|
5788
5814
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
5789
5815
|
/**
|
|
5790
5816
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5791
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5817
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5792
5818
|
*/
|
|
5793
5819
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
5794
5820
|
/**
|
|
5795
5821
|
* Disallow unnecessary spread.
|
|
5796
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5822
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-spread.md
|
|
5797
5823
|
*/
|
|
5798
5824
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
5799
5825
|
/**
|
|
5800
5826
|
* Disallow useless case in switch statements.
|
|
5801
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5827
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-switch-case.md
|
|
5802
5828
|
*/
|
|
5803
5829
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
5804
5830
|
/**
|
|
5805
5831
|
* Disallow useless `undefined`.
|
|
5806
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5832
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-undefined.md
|
|
5807
5833
|
*/
|
|
5808
5834
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
5809
5835
|
/**
|
|
5810
5836
|
* Disallow number literals with zero fractions or dangling dots.
|
|
5811
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-zero-fractions.md
|
|
5812
5838
|
*/
|
|
5813
5839
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
5814
5840
|
/**
|
|
5815
5841
|
* Enforce proper case for numeric literals.
|
|
5816
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/number-literal-case.md
|
|
5817
5843
|
*/
|
|
5818
5844
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
5819
5845
|
/**
|
|
5820
5846
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
5821
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/numeric-separators-style.md
|
|
5822
5848
|
*/
|
|
5823
5849
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
5824
5850
|
/**
|
|
5825
5851
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
5826
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-add-event-listener.md
|
|
5827
5853
|
*/
|
|
5828
5854
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
5829
5855
|
/**
|
|
5830
5856
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
5831
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-find.md
|
|
5832
5858
|
*/
|
|
5833
5859
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
5834
5860
|
/**
|
|
5835
5861
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
5836
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5862
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat.md
|
|
5837
5863
|
*/
|
|
5838
5864
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
5839
5865
|
/**
|
|
5840
5866
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
5841
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5867
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat-map.md
|
|
5842
5868
|
*/
|
|
5843
5869
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
5844
5870
|
/**
|
|
5845
5871
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
5846
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5872
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-index-of.md
|
|
5847
5873
|
*/
|
|
5848
5874
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
5849
5875
|
/**
|
|
5850
5876
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
5851
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5877
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-some.md
|
|
5852
5878
|
*/
|
|
5853
5879
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
5854
5880
|
/**
|
|
5855
5881
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
5856
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5882
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-at.md
|
|
5857
5883
|
*/
|
|
5858
5884
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
5859
5885
|
/**
|
|
5860
5886
|
* Prefer `BigInt` literals over the constructor.
|
|
5861
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5887
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-bigint-literals.md
|
|
5862
5888
|
*/
|
|
5863
5889
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
5864
5890
|
/**
|
|
5865
5891
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
5866
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5892
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
5867
5893
|
*/
|
|
5868
5894
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
5869
5895
|
/**
|
|
5870
5896
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
5871
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5897
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-class-fields.md
|
|
5872
5898
|
*/
|
|
5873
5899
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
5874
5900
|
/**
|
|
5875
5901
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
5876
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5902
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-classlist-toggle.md
|
|
5877
5903
|
*/
|
|
5878
5904
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
5879
5905
|
/**
|
|
5880
5906
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
5881
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5907
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-code-point.md
|
|
5882
5908
|
*/
|
|
5883
5909
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
5884
5910
|
/**
|
|
5885
5911
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
5886
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5912
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-date-now.md
|
|
5887
5913
|
*/
|
|
5888
5914
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
5889
5915
|
/**
|
|
5890
5916
|
* Prefer default parameters over reassignment.
|
|
5891
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5917
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-default-parameters.md
|
|
5892
5918
|
*/
|
|
5893
5919
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
5894
5920
|
/**
|
|
5895
5921
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
5896
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5922
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-append.md
|
|
5897
5923
|
*/
|
|
5898
5924
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
5899
5925
|
/**
|
|
5900
5926
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
5901
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5927
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
5902
5928
|
*/
|
|
5903
5929
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
5904
5930
|
/**
|
|
5905
5931
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
5906
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5932
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-remove.md
|
|
5907
5933
|
*/
|
|
5908
5934
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
5909
5935
|
/**
|
|
5910
5936
|
* Prefer `.textContent` over `.innerText`.
|
|
5911
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5937
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
5912
5938
|
*/
|
|
5913
5939
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
5914
5940
|
/**
|
|
5915
5941
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
5916
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5942
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-event-target.md
|
|
5917
5943
|
*/
|
|
5918
5944
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
5919
5945
|
/**
|
|
5920
5946
|
* Prefer `export…from` when re-exporting.
|
|
5921
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5947
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-export-from.md
|
|
5922
5948
|
*/
|
|
5923
5949
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
5924
5950
|
/**
|
|
5925
5951
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
5926
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5952
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-global-this.md
|
|
5927
5953
|
*/
|
|
5928
5954
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
5929
5955
|
/**
|
|
5930
5956
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
5931
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5957
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-import-meta-properties.md
|
|
5932
5958
|
*/
|
|
5933
5959
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
5934
5960
|
/**
|
|
5935
5961
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
5936
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5962
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-includes.md
|
|
5937
5963
|
*/
|
|
5938
5964
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
5939
5965
|
/**
|
|
5940
5966
|
* Prefer reading a JSON file as a buffer.
|
|
5941
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5967
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
5942
5968
|
*/
|
|
5943
5969
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
5944
5970
|
/**
|
|
5945
5971
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
5946
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5972
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
5947
5973
|
*/
|
|
5948
5974
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
5949
5975
|
/**
|
|
5950
5976
|
* Prefer using a logical operator over a ternary.
|
|
5951
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5977
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
5952
5978
|
*/
|
|
5953
5979
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
5954
5980
|
/**
|
|
5955
5981
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
5956
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5982
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-min-max.md
|
|
5957
5983
|
*/
|
|
5958
5984
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5959
5985
|
/**
|
|
5960
5986
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
5961
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5987
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-trunc.md
|
|
5962
5988
|
*/
|
|
5963
5989
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
5964
5990
|
/**
|
|
5965
5991
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
5966
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5992
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
5967
5993
|
*/
|
|
5968
5994
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
5969
5995
|
/**
|
|
5970
5996
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
5971
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5997
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-math-apis.md
|
|
5972
5998
|
*/
|
|
5973
5999
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
5974
6000
|
/**
|
|
5975
6001
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
5976
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6002
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-module.md
|
|
5977
6003
|
*/
|
|
5978
6004
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
5979
6005
|
/**
|
|
5980
6006
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
5981
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6007
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
5982
6008
|
*/
|
|
5983
6009
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
5984
6010
|
/**
|
|
5985
6011
|
* Prefer negative index over `.length - index` when possible.
|
|
5986
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6012
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-negative-index.md
|
|
5987
6013
|
*/
|
|
5988
6014
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
5989
6015
|
/**
|
|
5990
6016
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
5991
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6017
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-node-protocol.md
|
|
5992
6018
|
*/
|
|
5993
6019
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
5994
6020
|
/**
|
|
5995
6021
|
* Prefer `Number` static properties over global ones.
|
|
5996
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6022
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-number-properties.md
|
|
5997
6023
|
*/
|
|
5998
6024
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
5999
6025
|
/**
|
|
6000
6026
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6001
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6027
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-object-from-entries.md
|
|
6002
6028
|
*/
|
|
6003
6029
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6004
6030
|
/**
|
|
6005
6031
|
* Prefer omitting the `catch` binding parameter.
|
|
6006
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6032
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
6007
6033
|
*/
|
|
6008
6034
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6009
6035
|
/**
|
|
6010
6036
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6011
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6037
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-prototype-methods.md
|
|
6012
6038
|
*/
|
|
6013
6039
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6014
6040
|
/**
|
|
6015
6041
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
6016
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6042
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-query-selector.md
|
|
6017
6043
|
*/
|
|
6018
6044
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
6019
6045
|
/**
|
|
6020
6046
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6021
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6047
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-reflect-apply.md
|
|
6022
6048
|
*/
|
|
6023
6049
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6024
6050
|
/**
|
|
6025
6051
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6026
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6052
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-regexp-test.md
|
|
6027
6053
|
*/
|
|
6028
6054
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6055
|
+
/**
|
|
6056
|
+
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6057
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-response-static-json.md
|
|
6058
|
+
*/
|
|
6059
|
+
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
6029
6060
|
/**
|
|
6030
6061
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6031
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6062
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-has.md
|
|
6032
6063
|
*/
|
|
6033
6064
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
6034
6065
|
/**
|
|
6035
6066
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6036
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6067
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-size.md
|
|
6037
6068
|
*/
|
|
6038
6069
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6039
6070
|
/**
|
|
6040
6071
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6041
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6072
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-single-call.md
|
|
6042
6073
|
*/
|
|
6043
6074
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6044
6075
|
/**
|
|
6045
6076
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6046
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6077
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-spread.md
|
|
6047
6078
|
*/
|
|
6048
6079
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6049
6080
|
/**
|
|
6050
6081
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6051
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6082
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-raw.md
|
|
6052
6083
|
*/
|
|
6053
6084
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6054
6085
|
/**
|
|
6055
6086
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
6056
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6087
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-replace-all.md
|
|
6057
6088
|
*/
|
|
6058
6089
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6059
6090
|
/**
|
|
6060
6091
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6061
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6092
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-slice.md
|
|
6062
6093
|
*/
|
|
6063
6094
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6064
6095
|
/**
|
|
6065
6096
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6066
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6097
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
6067
6098
|
*/
|
|
6068
6099
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6069
6100
|
/**
|
|
6070
6101
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6071
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6102
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
6072
6103
|
*/
|
|
6073
6104
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6074
6105
|
/**
|
|
6075
6106
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6076
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6107
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-structured-clone.md
|
|
6077
6108
|
*/
|
|
6078
6109
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6079
6110
|
/**
|
|
6080
6111
|
* Prefer `switch` over multiple `else-if`.
|
|
6081
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6112
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-switch.md
|
|
6082
6113
|
*/
|
|
6083
6114
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6084
6115
|
/**
|
|
6085
6116
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6086
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6117
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-ternary.md
|
|
6087
6118
|
*/
|
|
6088
6119
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6089
6120
|
/**
|
|
6090
6121
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6091
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6122
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-top-level-await.md
|
|
6092
6123
|
*/
|
|
6093
6124
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6094
6125
|
/**
|
|
6095
6126
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6096
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6127
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-type-error.md
|
|
6097
6128
|
*/
|
|
6098
6129
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6099
6130
|
/**
|
|
6100
6131
|
* Prevent abbreviations.
|
|
6101
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6132
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prevent-abbreviations.md
|
|
6102
6133
|
*/
|
|
6103
6134
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
6104
6135
|
/**
|
|
6105
6136
|
* Enforce consistent relative URL style.
|
|
6106
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6137
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/relative-url-style.md
|
|
6107
6138
|
*/
|
|
6108
6139
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6109
6140
|
/**
|
|
6110
6141
|
* Enforce using the separator argument with `Array#join()`.
|
|
6111
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6142
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-array-join-separator.md
|
|
6112
6143
|
*/
|
|
6113
6144
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6114
6145
|
/**
|
|
6115
6146
|
* Require non-empty module attributes for imports and exports
|
|
6116
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6147
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-attributes.md
|
|
6117
6148
|
*/
|
|
6118
6149
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6119
6150
|
/**
|
|
6120
6151
|
* Require non-empty specifier list in import and export statements.
|
|
6121
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6152
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-specifiers.md
|
|
6122
6153
|
*/
|
|
6123
6154
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6124
6155
|
/**
|
|
6125
6156
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6126
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6157
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6127
6158
|
*/
|
|
6128
6159
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6129
6160
|
/**
|
|
6130
6161
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6131
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6162
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-post-message-target-origin.md
|
|
6132
6163
|
*/
|
|
6133
6164
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6134
6165
|
/**
|
|
6135
6166
|
* Enforce better string content.
|
|
6136
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6167
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/string-content.md
|
|
6137
6168
|
*/
|
|
6138
6169
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6139
6170
|
/**
|
|
6140
6171
|
* Enforce consistent brace style for `case` clauses.
|
|
6141
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6172
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/switch-case-braces.md
|
|
6142
6173
|
*/
|
|
6143
6174
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6144
6175
|
/**
|
|
6145
6176
|
* Fix whitespace-insensitive template indentation.
|
|
6146
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6177
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/template-indent.md
|
|
6147
6178
|
*/
|
|
6148
6179
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6149
6180
|
/**
|
|
6150
6181
|
* Enforce consistent case for text encoding identifiers.
|
|
6151
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6182
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/text-encoding-identifier-case.md
|
|
6152
6183
|
*/
|
|
6153
|
-
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<
|
|
6184
|
+
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
6154
6185
|
/**
|
|
6155
6186
|
* Require `new` when creating an error.
|
|
6156
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6187
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/throw-new-error.md
|
|
6157
6188
|
*/
|
|
6158
6189
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6159
6190
|
/**
|
|
@@ -6257,6 +6288,10 @@ type EslintReactNoForbiddenProps = [] | [{
|
|
|
6257
6288
|
prop: string;
|
|
6258
6289
|
})[];
|
|
6259
6290
|
}];
|
|
6291
|
+
// ----- @eslint-react/no-unstable-default-props -----
|
|
6292
|
+
type EslintReactNoUnstableDefaultProps = [] | [{
|
|
6293
|
+
safeDefaultProps?: string[];
|
|
6294
|
+
}];
|
|
6260
6295
|
// ----- @eslint-react/no-useless-fragment -----
|
|
6261
6296
|
type EslintReactNoUselessFragment = [] | [{
|
|
6262
6297
|
allowExpressions?: boolean;
|
|
@@ -6444,6 +6479,50 @@ type StylisticCurlyNewline = [] | [(("always" | "never") | {
|
|
|
6444
6479
|
type StylisticDotLocation = [] | [("object" | "property")];
|
|
6445
6480
|
// ----- @stylistic/eol-last -----
|
|
6446
6481
|
type StylisticEolLast = [] | [("always" | "never" | "unix" | "windows")];
|
|
6482
|
+
// ----- @stylistic/exp-list-style -----
|
|
6483
|
+
type StylisticExpListStyle = [] | [{
|
|
6484
|
+
singleLine?: _StylisticExpListStyle_SingleLineConfig;
|
|
6485
|
+
multiLine?: _StylisticExpListStyle_MultiLineConfig;
|
|
6486
|
+
overrides?: {
|
|
6487
|
+
"[]"?: _StylisticExpListStyle_BaseConfig;
|
|
6488
|
+
"{}"?: _StylisticExpListStyle_BaseConfig;
|
|
6489
|
+
"<>"?: _StylisticExpListStyle_BaseConfig;
|
|
6490
|
+
"()"?: _StylisticExpListStyle_BaseConfig;
|
|
6491
|
+
ArrayExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6492
|
+
ArrayPattern?: _StylisticExpListStyle_BaseConfig;
|
|
6493
|
+
ArrowFunctionExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6494
|
+
CallExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6495
|
+
ExportNamedDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
6496
|
+
FunctionDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
6497
|
+
FunctionExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6498
|
+
ImportDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
6499
|
+
ImportAttributes?: _StylisticExpListStyle_BaseConfig;
|
|
6500
|
+
NewExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6501
|
+
ObjectExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6502
|
+
ObjectPattern?: _StylisticExpListStyle_BaseConfig;
|
|
6503
|
+
TSDeclareFunction?: _StylisticExpListStyle_BaseConfig;
|
|
6504
|
+
TSFunctionType?: _StylisticExpListStyle_BaseConfig;
|
|
6505
|
+
TSInterfaceBody?: _StylisticExpListStyle_BaseConfig;
|
|
6506
|
+
TSEnumBody?: _StylisticExpListStyle_BaseConfig;
|
|
6507
|
+
TSTupleType?: _StylisticExpListStyle_BaseConfig;
|
|
6508
|
+
TSTypeLiteral?: _StylisticExpListStyle_BaseConfig;
|
|
6509
|
+
TSTypeParameterDeclaration?: _StylisticExpListStyle_BaseConfig;
|
|
6510
|
+
TSTypeParameterInstantiation?: _StylisticExpListStyle_BaseConfig;
|
|
6511
|
+
JSONArrayExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6512
|
+
JSONObjectExpression?: _StylisticExpListStyle_BaseConfig;
|
|
6513
|
+
};
|
|
6514
|
+
}];
|
|
6515
|
+
interface _StylisticExpListStyle_SingleLineConfig {
|
|
6516
|
+
spacing?: ("always" | "never");
|
|
6517
|
+
maxItems?: number;
|
|
6518
|
+
}
|
|
6519
|
+
interface _StylisticExpListStyle_MultiLineConfig {
|
|
6520
|
+
minItems?: number;
|
|
6521
|
+
}
|
|
6522
|
+
interface _StylisticExpListStyle_BaseConfig {
|
|
6523
|
+
singleLine?: _StylisticExpListStyle_SingleLineConfig;
|
|
6524
|
+
multiline?: _StylisticExpListStyle_MultiLineConfig;
|
|
6525
|
+
}
|
|
6447
6526
|
// ----- @stylistic/function-call-argument-newline -----
|
|
6448
6527
|
type StylisticFunctionCallArgumentNewline = [] | [("always" | "never" | "consistent")];
|
|
6449
6528
|
// ----- @stylistic/function-call-spacing -----
|
|
@@ -6513,7 +6592,11 @@ type StylisticIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
6513
6592
|
ObjectExpression?: (number | ("first" | "off"));
|
|
6514
6593
|
ImportDeclaration?: (number | ("first" | "off"));
|
|
6515
6594
|
flatTernaryExpressions?: boolean;
|
|
6516
|
-
offsetTernaryExpressions?: boolean
|
|
6595
|
+
offsetTernaryExpressions?: (boolean | {
|
|
6596
|
+
CallExpression?: boolean;
|
|
6597
|
+
AwaitExpression?: boolean;
|
|
6598
|
+
NewExpression?: boolean;
|
|
6599
|
+
});
|
|
6517
6600
|
offsetTernaryExpressionsOffsetCallExpressions?: boolean;
|
|
6518
6601
|
ignoredNodes?: string[];
|
|
6519
6602
|
ignoreComments?: boolean;
|
|
@@ -7314,6 +7397,7 @@ type StylisticObjectCurlySpacing = [] | [("always" | "never")] | [("always" | "n
|
|
|
7314
7397
|
TSInterfaceBody?: ("always" | "never");
|
|
7315
7398
|
TSEnumBody?: ("always" | "never");
|
|
7316
7399
|
};
|
|
7400
|
+
emptyObjects?: ("ignore" | "always" | "never");
|
|
7317
7401
|
}];
|
|
7318
7402
|
// ----- @stylistic/object-property-newline -----
|
|
7319
7403
|
type StylisticObjectPropertyNewline = [] | [{
|
|
@@ -14403,6 +14487,10 @@ type UnicornTemplateIndent = [] | [{
|
|
|
14403
14487
|
selectors?: string[];
|
|
14404
14488
|
comments?: string[];
|
|
14405
14489
|
}];
|
|
14490
|
+
// ----- unicorn/text-encoding-identifier-case -----
|
|
14491
|
+
type UnicornTextEncodingIdentifierCase = [] | [{
|
|
14492
|
+
withDash?: boolean;
|
|
14493
|
+
}];
|
|
14406
14494
|
// ----- unused-imports/no-unused-imports -----
|
|
14407
14495
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|
|
14408
14496
|
args?: ("all" | "after-used" | "none");
|