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