@cany748/eslint-config 4.0.1 → 4.1.0
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 +208 -146
- package/dist/index.js +3 -2
- package/package.json +24 -24
package/dist/index.d.ts
CHANGED
|
@@ -1874,7 +1874,7 @@ interface RuleOptions {
|
|
|
1874
1874
|
*/
|
|
1875
1875
|
'no-console'?: Linter.RuleEntry<NoConsole>;
|
|
1876
1876
|
/**
|
|
1877
|
-
* Disallow reassigning `const` variables
|
|
1877
|
+
* Disallow reassigning `const`, `using`, and `await using` variables
|
|
1878
1878
|
* @see https://eslint.org/docs/latest/rules/no-const-assign
|
|
1879
1879
|
*/
|
|
1880
1880
|
'no-const-assign'?: Linter.RuleEntry<[]>;
|
|
@@ -3662,670 +3662,690 @@ interface RuleOptions {
|
|
|
3662
3662
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
3663
3663
|
/**
|
|
3664
3664
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
3665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/better-regex.md
|
|
3666
3666
|
*/
|
|
3667
3667
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
3668
3668
|
/**
|
|
3669
3669
|
* Enforce a specific parameter name in catch clauses.
|
|
3670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/catch-error-name.md
|
|
3671
3671
|
*/
|
|
3672
3672
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
3673
3673
|
/**
|
|
3674
3674
|
* Enforce consistent assertion style with `node:assert`.
|
|
3675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-assert.md
|
|
3676
3676
|
*/
|
|
3677
3677
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
3678
3678
|
/**
|
|
3679
3679
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
3680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-date-clone.md
|
|
3681
3681
|
*/
|
|
3682
3682
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
3683
3683
|
/**
|
|
3684
3684
|
* Use destructured variables over properties.
|
|
3685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-destructuring.md
|
|
3686
3686
|
*/
|
|
3687
3687
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
3688
3688
|
/**
|
|
3689
3689
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
3690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-empty-array-spread.md
|
|
3691
3691
|
*/
|
|
3692
3692
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
3693
3693
|
/**
|
|
3694
3694
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
3695
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-existence-index-check.md
|
|
3696
3696
|
*/
|
|
3697
3697
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
3698
3698
|
/**
|
|
3699
3699
|
* Move function definitions to the highest possible scope.
|
|
3700
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-function-scoping.md
|
|
3701
3701
|
*/
|
|
3702
3702
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
3703
3703
|
/**
|
|
3704
3704
|
* Enforce correct `Error` subclassing.
|
|
3705
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/custom-error-definition.md
|
|
3706
3706
|
*/
|
|
3707
3707
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
3708
3708
|
/**
|
|
3709
3709
|
* Enforce no spaces between braces.
|
|
3710
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/empty-brace-spaces.md
|
|
3711
3711
|
*/
|
|
3712
3712
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
3713
3713
|
/**
|
|
3714
3714
|
* Enforce passing a `message` value when creating a built-in error.
|
|
3715
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/error-message.md
|
|
3716
3716
|
*/
|
|
3717
3717
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
3718
3718
|
/**
|
|
3719
3719
|
* Require escape sequences to use uppercase or lowercase values.
|
|
3720
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/escape-case.md
|
|
3721
3721
|
*/
|
|
3722
3722
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
3723
3723
|
/**
|
|
3724
3724
|
* Add expiration conditions to TODO comments.
|
|
3725
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/expiring-todo-comments.md
|
|
3726
3726
|
*/
|
|
3727
3727
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
3728
3728
|
/**
|
|
3729
3729
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
3730
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/explicit-length-check.md
|
|
3731
3731
|
*/
|
|
3732
3732
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
3733
3733
|
/**
|
|
3734
3734
|
* Enforce a case style for filenames.
|
|
3735
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/filename-case.md
|
|
3736
3736
|
*/
|
|
3737
3737
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
3738
3738
|
/**
|
|
3739
3739
|
* Enforce specific import styles per module.
|
|
3740
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/import-style.md
|
|
3741
3741
|
*/
|
|
3742
3742
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
3743
3743
|
/**
|
|
3744
3744
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
3745
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/new-for-builtins.md
|
|
3746
3746
|
*/
|
|
3747
3747
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
3748
3748
|
/**
|
|
3749
3749
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
3750
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
3751
3751
|
*/
|
|
3752
3752
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
3753
3753
|
/**
|
|
3754
3754
|
* Disallow recursive access to `this` within getters and setters.
|
|
3755
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-accessor-recursion.md
|
|
3756
3756
|
*/
|
|
3757
3757
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
3758
3758
|
/**
|
|
3759
3759
|
* Disallow anonymous functions and classes as the default export.
|
|
3760
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-anonymous-default-export.md
|
|
3761
3761
|
*/
|
|
3762
3762
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
3763
3763
|
/**
|
|
3764
3764
|
* Prevent passing a function reference directly to iterator methods.
|
|
3765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-callback-reference.md
|
|
3766
3766
|
*/
|
|
3767
3767
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
3768
3768
|
/**
|
|
3769
3769
|
* Prefer `for…of` over the `forEach` method.
|
|
3770
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-for-each.md
|
|
3771
3771
|
*/
|
|
3772
3772
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
3773
3773
|
/**
|
|
3774
3774
|
* Disallow using the `this` argument in array methods.
|
|
3775
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-method-this-argument.md
|
|
3776
3776
|
*/
|
|
3777
3777
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
3778
3778
|
/**
|
|
3779
3779
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
3780
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
3781
3781
|
* @deprecated
|
|
3782
3782
|
*/
|
|
3783
3783
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
3784
3784
|
/**
|
|
3785
3785
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
3786
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3786
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-reduce.md
|
|
3787
3787
|
*/
|
|
3788
3788
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
3789
|
+
/**
|
|
3790
|
+
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
3791
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-reverse.md
|
|
3792
|
+
*/
|
|
3793
|
+
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
3789
3794
|
/**
|
|
3790
3795
|
* Disallow member access from await expression.
|
|
3791
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3796
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-await-expression-member.md
|
|
3792
3797
|
*/
|
|
3793
3798
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
3794
3799
|
/**
|
|
3795
3800
|
* Disallow using `await` in `Promise` method parameters.
|
|
3796
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3801
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-await-in-promise-methods.md
|
|
3797
3802
|
*/
|
|
3798
3803
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
3799
3804
|
/**
|
|
3800
3805
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
3801
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3806
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-console-spaces.md
|
|
3802
3807
|
*/
|
|
3803
3808
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
3804
3809
|
/**
|
|
3805
3810
|
* Do not use `document.cookie` directly.
|
|
3806
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3811
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-document-cookie.md
|
|
3807
3812
|
*/
|
|
3808
3813
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
3809
3814
|
/**
|
|
3810
3815
|
* Disallow empty files.
|
|
3811
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3816
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-empty-file.md
|
|
3812
3817
|
*/
|
|
3813
3818
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
3814
3819
|
/**
|
|
3815
3820
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
3816
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3821
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-for-loop.md
|
|
3817
3822
|
*/
|
|
3818
3823
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
3819
3824
|
/**
|
|
3820
3825
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
3821
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3826
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-hex-escape.md
|
|
3822
3827
|
*/
|
|
3823
3828
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
3824
3829
|
/**
|
|
3825
3830
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
3826
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3831
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
3827
3832
|
* @deprecated
|
|
3828
3833
|
*/
|
|
3829
3834
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
3830
3835
|
/**
|
|
3831
3836
|
* Disallow `instanceof` with built-in objects
|
|
3832
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3837
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-instanceof-builtins.md
|
|
3833
3838
|
*/
|
|
3834
3839
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
3835
3840
|
/**
|
|
3836
3841
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
3837
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3842
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-invalid-fetch-options.md
|
|
3838
3843
|
*/
|
|
3839
3844
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
3840
3845
|
/**
|
|
3841
3846
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
3842
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3847
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
3843
3848
|
*/
|
|
3844
3849
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
3845
3850
|
/**
|
|
3846
3851
|
* Disallow identifiers starting with `new` or `class`.
|
|
3847
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-keyword-prefix.md
|
|
3848
3853
|
*/
|
|
3849
3854
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
3850
3855
|
/**
|
|
3851
3856
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
3852
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
3853
3858
|
* @deprecated
|
|
3854
3859
|
*/
|
|
3855
3860
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
3856
3861
|
/**
|
|
3857
3862
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
3858
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3863
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-lonely-if.md
|
|
3859
3864
|
*/
|
|
3860
3865
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
3861
3866
|
/**
|
|
3862
3867
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
3863
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3868
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
3864
3869
|
*/
|
|
3865
3870
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
3866
3871
|
/**
|
|
3867
3872
|
* Disallow named usage of default import and export.
|
|
3868
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3873
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-named-default.md
|
|
3869
3874
|
*/
|
|
3870
3875
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
3871
3876
|
/**
|
|
3872
3877
|
* Disallow negated conditions.
|
|
3873
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3878
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-negated-condition.md
|
|
3874
3879
|
*/
|
|
3875
3880
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
3876
3881
|
/**
|
|
3877
3882
|
* Disallow negated expression in equality check.
|
|
3878
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3883
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-negation-in-equality-check.md
|
|
3879
3884
|
*/
|
|
3880
3885
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
3881
3886
|
/**
|
|
3882
3887
|
* Disallow nested ternary expressions.
|
|
3883
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3888
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-nested-ternary.md
|
|
3884
3889
|
*/
|
|
3885
3890
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
3886
3891
|
/**
|
|
3887
3892
|
* Disallow `new Array()`.
|
|
3888
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3893
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-new-array.md
|
|
3889
3894
|
*/
|
|
3890
3895
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
3891
3896
|
/**
|
|
3892
3897
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
3893
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3898
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-new-buffer.md
|
|
3894
3899
|
*/
|
|
3895
3900
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
3896
3901
|
/**
|
|
3897
3902
|
* Disallow the use of the `null` literal.
|
|
3898
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3903
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-null.md
|
|
3899
3904
|
*/
|
|
3900
3905
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
3901
3906
|
/**
|
|
3902
3907
|
* Disallow the use of objects as default parameters.
|
|
3903
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3908
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-object-as-default-parameter.md
|
|
3904
3909
|
*/
|
|
3905
3910
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
3906
3911
|
/**
|
|
3907
3912
|
* Disallow `process.exit()`.
|
|
3908
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3913
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-process-exit.md
|
|
3909
3914
|
*/
|
|
3910
3915
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
3911
3916
|
/**
|
|
3912
3917
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
3913
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3918
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
3914
3919
|
*/
|
|
3915
3920
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
3916
3921
|
/**
|
|
3917
3922
|
* Disallow classes that only have static members.
|
|
3918
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3923
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-static-only-class.md
|
|
3919
3924
|
*/
|
|
3920
3925
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
3921
3926
|
/**
|
|
3922
3927
|
* Disallow `then` property.
|
|
3923
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3928
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-thenable.md
|
|
3924
3929
|
*/
|
|
3925
3930
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
3926
3931
|
/**
|
|
3927
3932
|
* Disallow assigning `this` to a variable.
|
|
3928
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3933
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-this-assignment.md
|
|
3929
3934
|
*/
|
|
3930
3935
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
3931
3936
|
/**
|
|
3932
3937
|
* Disallow comparing `undefined` using `typeof`.
|
|
3933
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3938
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-typeof-undefined.md
|
|
3934
3939
|
*/
|
|
3935
3940
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
3936
3941
|
/**
|
|
3937
3942
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
3938
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3943
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
3939
3944
|
*/
|
|
3940
3945
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
3941
3946
|
/**
|
|
3942
3947
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
3943
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3948
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
3944
3949
|
*/
|
|
3945
3950
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
3946
3951
|
/**
|
|
3947
3952
|
* Disallow awaiting non-promise values.
|
|
3948
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3953
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-await.md
|
|
3949
3954
|
*/
|
|
3950
3955
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
3951
3956
|
/**
|
|
3952
3957
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
3953
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3958
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
3954
3959
|
*/
|
|
3955
3960
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
3956
3961
|
/**
|
|
3957
3962
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
3958
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3963
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
3959
3964
|
*/
|
|
3960
3965
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
3961
3966
|
/**
|
|
3962
3967
|
* Disallow unreadable array destructuring.
|
|
3963
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3968
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
3964
3969
|
*/
|
|
3965
3970
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
3966
3971
|
/**
|
|
3967
3972
|
* Disallow unreadable IIFEs.
|
|
3968
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3973
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unreadable-iife.md
|
|
3969
3974
|
*/
|
|
3970
3975
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
3971
3976
|
/**
|
|
3972
3977
|
* Disallow unused object properties.
|
|
3973
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3978
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unused-properties.md
|
|
3974
3979
|
*/
|
|
3975
3980
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
3981
|
+
/**
|
|
3982
|
+
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
3983
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
3984
|
+
*/
|
|
3985
|
+
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
3976
3986
|
/**
|
|
3977
3987
|
* Disallow useless fallback when spreading in object literals.
|
|
3978
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3988
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
3979
3989
|
*/
|
|
3980
3990
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
3981
3991
|
/**
|
|
3982
3992
|
* Disallow useless array length check.
|
|
3983
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3993
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-length-check.md
|
|
3984
3994
|
*/
|
|
3985
3995
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
3986
3996
|
/**
|
|
3987
3997
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
3988
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
3998
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
3989
3999
|
*/
|
|
3990
4000
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
3991
4001
|
/**
|
|
3992
4002
|
* Disallow unnecessary spread.
|
|
3993
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4003
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-spread.md
|
|
3994
4004
|
*/
|
|
3995
4005
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
3996
4006
|
/**
|
|
3997
4007
|
* Disallow useless case in switch statements.
|
|
3998
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4008
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-switch-case.md
|
|
3999
4009
|
*/
|
|
4000
4010
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
4001
4011
|
/**
|
|
4002
4012
|
* Disallow useless `undefined`.
|
|
4003
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4013
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-undefined.md
|
|
4004
4014
|
*/
|
|
4005
4015
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
4006
4016
|
/**
|
|
4007
4017
|
* Disallow number literals with zero fractions or dangling dots.
|
|
4008
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4018
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-zero-fractions.md
|
|
4009
4019
|
*/
|
|
4010
4020
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
4011
4021
|
/**
|
|
4012
4022
|
* Enforce proper case for numeric literals.
|
|
4013
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4023
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/number-literal-case.md
|
|
4014
4024
|
*/
|
|
4015
4025
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
4016
4026
|
/**
|
|
4017
4027
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
4018
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4028
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/numeric-separators-style.md
|
|
4019
4029
|
*/
|
|
4020
4030
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
4021
4031
|
/**
|
|
4022
4032
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
4023
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4033
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-add-event-listener.md
|
|
4024
4034
|
*/
|
|
4025
4035
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
4026
4036
|
/**
|
|
4027
4037
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
4028
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4038
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-find.md
|
|
4029
4039
|
*/
|
|
4030
4040
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
4031
4041
|
/**
|
|
4032
4042
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
4033
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4043
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-flat.md
|
|
4034
4044
|
*/
|
|
4035
4045
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
4036
4046
|
/**
|
|
4037
4047
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
4038
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4048
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-flat-map.md
|
|
4039
4049
|
*/
|
|
4040
4050
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
4041
4051
|
/**
|
|
4042
4052
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
4043
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4053
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-index-of.md
|
|
4044
4054
|
*/
|
|
4045
4055
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
4046
4056
|
/**
|
|
4047
4057
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
4048
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4058
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-some.md
|
|
4049
4059
|
*/
|
|
4050
4060
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
4051
4061
|
/**
|
|
4052
4062
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
4053
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4063
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-at.md
|
|
4054
4064
|
*/
|
|
4055
4065
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
4056
4066
|
/**
|
|
4057
4067
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
4058
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4068
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
4059
4069
|
*/
|
|
4060
4070
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
4071
|
+
/**
|
|
4072
|
+
* Prefer class field declarations over `this` assignments in constructors.
|
|
4073
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-class-fields.md
|
|
4074
|
+
*/
|
|
4075
|
+
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
4061
4076
|
/**
|
|
4062
4077
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
4063
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4078
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-code-point.md
|
|
4064
4079
|
*/
|
|
4065
4080
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
4066
4081
|
/**
|
|
4067
4082
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
4068
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4083
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-date-now.md
|
|
4069
4084
|
*/
|
|
4070
4085
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
4071
4086
|
/**
|
|
4072
4087
|
* Prefer default parameters over reassignment.
|
|
4073
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4088
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-default-parameters.md
|
|
4074
4089
|
*/
|
|
4075
4090
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
4076
4091
|
/**
|
|
4077
4092
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
4078
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4093
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-append.md
|
|
4079
4094
|
*/
|
|
4080
4095
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
4081
4096
|
/**
|
|
4082
4097
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
4083
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
4084
4099
|
*/
|
|
4085
4100
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
4086
4101
|
/**
|
|
4087
4102
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
4088
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-remove.md
|
|
4089
4104
|
*/
|
|
4090
4105
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
4091
4106
|
/**
|
|
4092
4107
|
* Prefer `.textContent` over `.innerText`.
|
|
4093
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
4094
4109
|
*/
|
|
4095
4110
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
4096
4111
|
/**
|
|
4097
4112
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
4098
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-event-target.md
|
|
4099
4114
|
*/
|
|
4100
4115
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
4101
4116
|
/**
|
|
4102
4117
|
* Prefer `export…from` when re-exporting.
|
|
4103
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-export-from.md
|
|
4104
4119
|
*/
|
|
4105
4120
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
4106
4121
|
/**
|
|
4107
4122
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
4108
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-global-this.md
|
|
4109
4124
|
*/
|
|
4110
4125
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
4111
4126
|
/**
|
|
4112
4127
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
4113
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-import-meta-properties.md
|
|
4114
4129
|
*/
|
|
4115
4130
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
4116
4131
|
/**
|
|
4117
4132
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
4118
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-includes.md
|
|
4119
4134
|
*/
|
|
4120
4135
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
4121
4136
|
/**
|
|
4122
4137
|
* Prefer reading a JSON file as a buffer.
|
|
4123
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
4124
4139
|
*/
|
|
4125
4140
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
4126
4141
|
/**
|
|
4127
4142
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
4128
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
4129
4144
|
*/
|
|
4130
4145
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
4131
4146
|
/**
|
|
4132
4147
|
* Prefer using a logical operator over a ternary.
|
|
4133
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
4134
4149
|
*/
|
|
4135
4150
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
4136
4151
|
/**
|
|
4137
4152
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
4138
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-math-min-max.md
|
|
4139
4154
|
*/
|
|
4140
4155
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
4141
4156
|
/**
|
|
4142
4157
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
4143
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-math-trunc.md
|
|
4144
4159
|
*/
|
|
4145
4160
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
4146
4161
|
/**
|
|
4147
4162
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
4148
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
4149
4164
|
*/
|
|
4150
4165
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
4151
4166
|
/**
|
|
4152
4167
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
4153
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4168
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-modern-math-apis.md
|
|
4154
4169
|
*/
|
|
4155
4170
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
4156
4171
|
/**
|
|
4157
4172
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
4158
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4173
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-module.md
|
|
4159
4174
|
*/
|
|
4160
4175
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
4161
4176
|
/**
|
|
4162
4177
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
4163
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4178
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
4164
4179
|
*/
|
|
4165
4180
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
4166
4181
|
/**
|
|
4167
4182
|
* Prefer negative index over `.length - index` when possible.
|
|
4168
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4183
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-negative-index.md
|
|
4169
4184
|
*/
|
|
4170
4185
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
4171
4186
|
/**
|
|
4172
4187
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
4173
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4188
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-node-protocol.md
|
|
4174
4189
|
*/
|
|
4175
4190
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
4176
4191
|
/**
|
|
4177
4192
|
* Prefer `Number` static properties over global ones.
|
|
4178
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4193
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-number-properties.md
|
|
4179
4194
|
*/
|
|
4180
4195
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
4181
4196
|
/**
|
|
4182
4197
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
4183
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4198
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-object-from-entries.md
|
|
4184
4199
|
*/
|
|
4185
4200
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
4186
4201
|
/**
|
|
4187
4202
|
* Prefer omitting the `catch` binding parameter.
|
|
4188
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4203
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
4189
4204
|
*/
|
|
4190
4205
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
4191
4206
|
/**
|
|
4192
4207
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
4193
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4208
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-prototype-methods.md
|
|
4194
4209
|
*/
|
|
4195
4210
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
4196
4211
|
/**
|
|
4197
4212
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
4198
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4213
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-query-selector.md
|
|
4199
4214
|
*/
|
|
4200
4215
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
4201
4216
|
/**
|
|
4202
4217
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
4203
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4218
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-reflect-apply.md
|
|
4204
4219
|
*/
|
|
4205
4220
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
4206
4221
|
/**
|
|
4207
4222
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
4208
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4223
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-regexp-test.md
|
|
4209
4224
|
*/
|
|
4210
4225
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
4211
4226
|
/**
|
|
4212
4227
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
4213
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4228
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-set-has.md
|
|
4214
4229
|
*/
|
|
4215
4230
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
4216
4231
|
/**
|
|
4217
4232
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
4218
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4233
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-set-size.md
|
|
4219
4234
|
*/
|
|
4220
4235
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
4221
4236
|
/**
|
|
4222
4237
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
4223
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4238
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-single-call.md
|
|
4224
4239
|
*/
|
|
4225
4240
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
4226
4241
|
/**
|
|
4227
4242
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
4228
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4243
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-spread.md
|
|
4229
4244
|
*/
|
|
4230
4245
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
4231
4246
|
/**
|
|
4232
4247
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
4233
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4248
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-raw.md
|
|
4234
4249
|
*/
|
|
4235
4250
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
4236
4251
|
/**
|
|
4237
4252
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
4238
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4253
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-replace-all.md
|
|
4239
4254
|
*/
|
|
4240
4255
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
4241
4256
|
/**
|
|
4242
4257
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
4243
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4258
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-slice.md
|
|
4244
4259
|
*/
|
|
4245
4260
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
4246
4261
|
/**
|
|
4247
4262
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
4248
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4263
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
4249
4264
|
*/
|
|
4250
4265
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
4251
4266
|
/**
|
|
4252
4267
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
4253
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4268
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
4254
4269
|
*/
|
|
4255
4270
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
4256
4271
|
/**
|
|
4257
4272
|
* Prefer using `structuredClone` to create a deep clone.
|
|
4258
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4273
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-structured-clone.md
|
|
4259
4274
|
*/
|
|
4260
4275
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
4261
4276
|
/**
|
|
4262
4277
|
* Prefer `switch` over multiple `else-if`.
|
|
4263
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4278
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-switch.md
|
|
4264
4279
|
*/
|
|
4265
4280
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
4266
4281
|
/**
|
|
4267
4282
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
4268
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4283
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-ternary.md
|
|
4269
4284
|
*/
|
|
4270
4285
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
4271
4286
|
/**
|
|
4272
4287
|
* Prefer top-level await over top-level promises and async function calls.
|
|
4273
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4288
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-top-level-await.md
|
|
4274
4289
|
*/
|
|
4275
4290
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
4276
4291
|
/**
|
|
4277
4292
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
4278
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4293
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-type-error.md
|
|
4279
4294
|
*/
|
|
4280
4295
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
4281
4296
|
/**
|
|
4282
4297
|
* Prevent abbreviations.
|
|
4283
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4298
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prevent-abbreviations.md
|
|
4284
4299
|
*/
|
|
4285
4300
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
4286
4301
|
/**
|
|
4287
4302
|
* Enforce consistent relative URL style.
|
|
4288
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4303
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/relative-url-style.md
|
|
4289
4304
|
*/
|
|
4290
4305
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
4291
4306
|
/**
|
|
4292
4307
|
* Enforce using the separator argument with `Array#join()`.
|
|
4293
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4308
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-array-join-separator.md
|
|
4294
4309
|
*/
|
|
4295
4310
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
4311
|
+
/**
|
|
4312
|
+
* Require non-empty specifier list in import and export statements.
|
|
4313
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-module-specifiers.md
|
|
4314
|
+
*/
|
|
4315
|
+
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
4296
4316
|
/**
|
|
4297
4317
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
4298
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4318
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
4299
4319
|
*/
|
|
4300
4320
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
4301
4321
|
/**
|
|
4302
4322
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
4303
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4323
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-post-message-target-origin.md
|
|
4304
4324
|
*/
|
|
4305
4325
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
4306
4326
|
/**
|
|
4307
4327
|
* Enforce better string content.
|
|
4308
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4328
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/string-content.md
|
|
4309
4329
|
*/
|
|
4310
4330
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
4311
4331
|
/**
|
|
4312
4332
|
* Enforce consistent brace style for `case` clauses.
|
|
4313
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4333
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/switch-case-braces.md
|
|
4314
4334
|
*/
|
|
4315
4335
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
4316
4336
|
/**
|
|
4317
4337
|
* Fix whitespace-insensitive template indentation.
|
|
4318
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4338
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/template-indent.md
|
|
4319
4339
|
*/
|
|
4320
4340
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
4321
4341
|
/**
|
|
4322
4342
|
* Enforce consistent case for text encoding identifiers.
|
|
4323
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4343
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/text-encoding-identifier-case.md
|
|
4324
4344
|
*/
|
|
4325
4345
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>;
|
|
4326
4346
|
/**
|
|
4327
4347
|
* Require `new` when creating an error.
|
|
4328
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4348
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/throw-new-error.md
|
|
4329
4349
|
*/
|
|
4330
4350
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
4331
4351
|
/**
|
|
@@ -4342,7 +4362,7 @@ interface RuleOptions {
|
|
|
4342
4362
|
* Order of UnoCSS utilities in class attribute
|
|
4343
4363
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
4344
4364
|
*/
|
|
4345
|
-
'unocss/order'?: Linter.RuleEntry<
|
|
4365
|
+
'unocss/order'?: Linter.RuleEntry<UnocssOrder>;
|
|
4346
4366
|
/**
|
|
4347
4367
|
* Order of UnoCSS attributes
|
|
4348
4368
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
@@ -4908,6 +4928,16 @@ interface RuleOptions {
|
|
|
4908
4928
|
* @see https://eslint.vuejs.org/rules/no-mutating-props.html
|
|
4909
4929
|
*/
|
|
4910
4930
|
'vue/no-mutating-props'?: Linter.RuleEntry<VueNoMutatingProps>;
|
|
4931
|
+
/**
|
|
4932
|
+
* Disallow negated conditions in `<template>`
|
|
4933
|
+
* @see https://eslint.vuejs.org/rules/no-negated-condition.html
|
|
4934
|
+
*/
|
|
4935
|
+
'vue/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
4936
|
+
/**
|
|
4937
|
+
* disallow negated conditions in v-if/v-else
|
|
4938
|
+
* @see https://eslint.vuejs.org/rules/no-negated-v-if-condition.html
|
|
4939
|
+
*/
|
|
4940
|
+
'vue/no-negated-v-if-condition'?: Linter.RuleEntry<[]>;
|
|
4911
4941
|
/**
|
|
4912
4942
|
* disallow parsing errors in `<template>`
|
|
4913
4943
|
* @see https://eslint.vuejs.org/rules/no-parsing-error.html
|
|
@@ -4979,7 +5009,7 @@ interface RuleOptions {
|
|
|
4979
5009
|
*/
|
|
4980
5010
|
'vue/no-restricted-custom-event'?: Linter.RuleEntry<VueNoRestrictedCustomEvent>;
|
|
4981
5011
|
/**
|
|
4982
|
-
* disallow specific
|
|
5012
|
+
* disallow specific elements
|
|
4983
5013
|
* @see https://eslint.vuejs.org/rules/no-restricted-html-elements.html
|
|
4984
5014
|
*/
|
|
4985
5015
|
'vue/no-restricted-html-elements'?: Linter.RuleEntry<VueNoRestrictedHtmlElements>;
|
|
@@ -6425,7 +6455,6 @@ type TypescriptEslintPreferDestructuring = [] | [({
|
|
|
6425
6455
|
}), {
|
|
6426
6456
|
enforceForDeclarationWithTypeAnnotation?: boolean;
|
|
6427
6457
|
enforceForRenamedProperties?: boolean;
|
|
6428
|
-
[k: string]: unknown | undefined;
|
|
6429
6458
|
}];
|
|
6430
6459
|
// ----- @typescript-eslint/prefer-literal-enum-member -----
|
|
6431
6460
|
type TypescriptEslintPreferLiteralEnumMember = [] | [{
|
|
@@ -6443,7 +6472,6 @@ type TypescriptEslintPreferNullishCoalescing = [] | [{
|
|
|
6443
6472
|
boolean?: boolean;
|
|
6444
6473
|
number?: boolean;
|
|
6445
6474
|
string?: boolean;
|
|
6446
|
-
[k: string]: unknown | undefined;
|
|
6447
6475
|
} | true);
|
|
6448
6476
|
ignoreTernaryTests?: boolean;
|
|
6449
6477
|
}];
|
|
@@ -6593,6 +6621,7 @@ type AccessorPairs = [] | [{
|
|
|
6593
6621
|
getWithoutSet?: boolean;
|
|
6594
6622
|
setWithoutGet?: boolean;
|
|
6595
6623
|
enforceForClassMembers?: boolean;
|
|
6624
|
+
enforceForTSTypes?: boolean;
|
|
6596
6625
|
}];
|
|
6597
6626
|
// ----- array-bracket-newline -----
|
|
6598
6627
|
type ArrayBracketNewline = [] | [(("always" | "never" | "consistent") | {
|
|
@@ -6782,7 +6811,9 @@ type GetterReturn = [] | [{
|
|
|
6782
6811
|
allowImplicit?: boolean;
|
|
6783
6812
|
}];
|
|
6784
6813
|
// ----- grouped-accessor-pairs -----
|
|
6785
|
-
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")]
|
|
6814
|
+
type GroupedAccessorPairs = [] | [("anyOrder" | "getBeforeSet" | "setBeforeGet")] | [("anyOrder" | "getBeforeSet" | "setBeforeGet"), {
|
|
6815
|
+
enforceForTSTypes?: boolean;
|
|
6816
|
+
}];
|
|
6786
6817
|
// ----- handle-callback-err -----
|
|
6787
6818
|
type HandleCallbackErr = [] | [string];
|
|
6788
6819
|
// ----- id-blacklist -----
|
|
@@ -8379,10 +8410,17 @@ type NoRestrictedExports = [] | [({
|
|
|
8379
8410
|
};
|
|
8380
8411
|
})];
|
|
8381
8412
|
// ----- no-restricted-globals -----
|
|
8382
|
-
type NoRestrictedGlobals = (string | {
|
|
8413
|
+
type NoRestrictedGlobals = ((string | {
|
|
8383
8414
|
name: string;
|
|
8384
8415
|
message?: string;
|
|
8385
|
-
})[]
|
|
8416
|
+
})[] | [] | [{
|
|
8417
|
+
globals: (string | {
|
|
8418
|
+
name: string;
|
|
8419
|
+
message?: string;
|
|
8420
|
+
})[];
|
|
8421
|
+
checkGlobalObject?: boolean;
|
|
8422
|
+
globalObjects?: string[];
|
|
8423
|
+
}]);
|
|
8386
8424
|
// ----- no-restricted-imports -----
|
|
8387
8425
|
type NoRestrictedImports = ((string | {
|
|
8388
8426
|
name: string;
|
|
@@ -8511,6 +8549,7 @@ type NoUnusedVars = [] | [(("all" | "local") | {
|
|
|
8511
8549
|
caughtErrorsIgnorePattern?: string;
|
|
8512
8550
|
destructuredArrayIgnorePattern?: string;
|
|
8513
8551
|
ignoreClassWithStaticInitBlock?: boolean;
|
|
8552
|
+
ignoreUsingDeclarations?: boolean;
|
|
8514
8553
|
reportUsedIgnorePattern?: boolean;
|
|
8515
8554
|
})];
|
|
8516
8555
|
// ----- no-use-before-define -----
|
|
@@ -8609,6 +8648,8 @@ type OneVar = [] | [(("always" | "never" | "consecutive") | {
|
|
|
8609
8648
|
var?: ("always" | "never" | "consecutive");
|
|
8610
8649
|
let?: ("always" | "never" | "consecutive");
|
|
8611
8650
|
const?: ("always" | "never" | "consecutive");
|
|
8651
|
+
using?: ("always" | "never" | "consecutive");
|
|
8652
|
+
awaitUsing?: ("always" | "never" | "consecutive");
|
|
8612
8653
|
} | {
|
|
8613
8654
|
initialized?: ("always" | "never" | "consecutive");
|
|
8614
8655
|
uninitialized?: ("always" | "never" | "consecutive");
|
|
@@ -8703,7 +8744,6 @@ type PrettierPrettier = [] | [{
|
|
|
8703
8744
|
fileInfoOptions?: {
|
|
8704
8745
|
[k: string]: unknown | undefined;
|
|
8705
8746
|
};
|
|
8706
|
-
[k: string]: unknown | undefined;
|
|
8707
8747
|
}];
|
|
8708
8748
|
// ----- quote-props -----
|
|
8709
8749
|
type QuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
@@ -9105,6 +9145,10 @@ interface _UnicornImportStyle_BooleanObject {
|
|
|
9105
9145
|
type UnicornNoArrayReduce = [] | [{
|
|
9106
9146
|
allowSimpleOperations?: boolean;
|
|
9107
9147
|
}];
|
|
9148
|
+
// ----- unicorn/no-array-reverse -----
|
|
9149
|
+
type UnicornNoArrayReverse = [] | [{
|
|
9150
|
+
allowExpressionStatement?: boolean;
|
|
9151
|
+
}];
|
|
9108
9152
|
// ----- unicorn/no-instanceof-builtins -----
|
|
9109
9153
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
9110
9154
|
useErrorIsError?: boolean;
|
|
@@ -9258,6 +9302,12 @@ type UnocssEnforceClassCompile = [] | [{
|
|
|
9258
9302
|
prefix?: string;
|
|
9259
9303
|
enableFix?: boolean;
|
|
9260
9304
|
}];
|
|
9305
|
+
// ----- unocss/order -----
|
|
9306
|
+
type UnocssOrder = [] | [{
|
|
9307
|
+
unoFunctions?: string[];
|
|
9308
|
+
unoVariables?: string[];
|
|
9309
|
+
[k: string]: unknown | undefined;
|
|
9310
|
+
}];
|
|
9261
9311
|
// ----- unused-imports/no-unused-imports -----
|
|
9262
9312
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|
|
9263
9313
|
args?: ("all" | "after-used" | "none");
|
|
@@ -10010,6 +10060,7 @@ type VueNoDeprecatedRouterLinkTagProp = [] | [{
|
|
|
10010
10060
|
// ----- vue/no-deprecated-slot-attribute -----
|
|
10011
10061
|
type VueNoDeprecatedSlotAttribute = [] | [{
|
|
10012
10062
|
ignore?: string[];
|
|
10063
|
+
ignoreParents?: string[];
|
|
10013
10064
|
}];
|
|
10014
10065
|
// ----- vue/no-dupe-keys -----
|
|
10015
10066
|
type VueNoDupeKeys = [] | [{
|
|
@@ -10488,14 +10539,25 @@ type ConfigNames = '@eslint-community/eslint-comments' | 'formatter/setup' | 'fo
|
|
|
10488
10539
|
//#endregion
|
|
10489
10540
|
//#region src/types.d.ts
|
|
10490
10541
|
type Awaitable<T> = T | Promise<T>;
|
|
10491
|
-
type Rules = RuleOptions;
|
|
10492
|
-
|
|
10542
|
+
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
10543
|
+
/**
|
|
10544
|
+
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
10545
|
+
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
10546
|
+
* many plugins still lack proper type definitions.
|
|
10547
|
+
*/
|
|
10548
|
+
type TypedFlatConfigItem = Omit<Linter.Config, "plugins" | "rules"> & {
|
|
10493
10549
|
/**
|
|
10494
|
-
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
10550
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
10551
|
+
* When `files` is specified, these plugins are only available to the matching files.
|
|
10495
10552
|
*
|
|
10496
10553
|
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
10497
10554
|
*/
|
|
10498
10555
|
plugins?: Record<string, any>;
|
|
10556
|
+
/**
|
|
10557
|
+
* An object containing the configured rules. When `files` or `ignores` are
|
|
10558
|
+
* specified, these rule configurations are only available to the matching files.
|
|
10559
|
+
*/
|
|
10560
|
+
rules?: Rules;
|
|
10499
10561
|
};
|
|
10500
10562
|
interface OptionsFiles {
|
|
10501
10563
|
/**
|
|
@@ -10797,4 +10859,4 @@ declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
|
|
|
10797
10859
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
10798
10860
|
declare function isInEditorEnv(): boolean;
|
|
10799
10861
|
//#endregion
|
|
10800
|
-
export { Awaitable, ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVue, Rules, TypedFlatConfigItem, combine, comments, disables, factoryConfig, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsonc, node, parserPlain, regexp, sortPackageJson, sortTsconfig, test, toArray, typescript, unicorn, unocss, vue };
|
|
10862
|
+
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVue, Rules, TypedFlatConfigItem, combine, comments, disables, factoryConfig, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsonc, node, parserPlain, regexp, sortPackageJson, sortTsconfig, test, toArray, typescript, unicorn, unocss, vue };
|
package/dist/index.js
CHANGED
|
@@ -702,7 +702,7 @@ function sortPackageJson() {
|
|
|
702
702
|
*/
|
|
703
703
|
function sortTsconfig() {
|
|
704
704
|
return [{
|
|
705
|
-
files: ["**/
|
|
705
|
+
files: ["**/[jt]sconfig.json", "**/[jt]sconfig.*.json"],
|
|
706
706
|
name: "sort/tsconfig-json",
|
|
707
707
|
rules: { "jsonc/sort-keys": [
|
|
708
708
|
"error",
|
|
@@ -977,7 +977,8 @@ function unicorn() {
|
|
|
977
977
|
"unicorn/prefer-string-replace-all": "off",
|
|
978
978
|
"unicorn/prefer-structured-clone": "off",
|
|
979
979
|
"unicorn/prefer-top-level-await": "off",
|
|
980
|
-
"unicorn/prevent-abbreviations": "off"
|
|
980
|
+
"unicorn/prevent-abbreviations": "off",
|
|
981
|
+
"unicorn/prefer-global-this": "off"
|
|
981
982
|
}
|
|
982
983
|
}];
|
|
983
984
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cany748/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js"
|
|
7
7
|
},
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@unocss/eslint-plugin": "^66.
|
|
15
|
-
"eslint-plugin-vue": "^10.
|
|
16
|
-
"typescript-eslint": "^8.
|
|
14
|
+
"@unocss/eslint-plugin": "^66.4.2",
|
|
15
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
16
|
+
"typescript-eslint": "^8.40.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"@unocss/eslint-plugin": {
|
|
@@ -29,35 +29,35 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
31
31
|
"@vitest/eslint-plugin": "^1.3.4",
|
|
32
|
-
"eslint": "^9.
|
|
32
|
+
"eslint": "^9.33.0",
|
|
33
33
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
34
|
-
"eslint-config-prettier": "^10.1.
|
|
35
|
-
"eslint-flat-config-utils": "^2.1.
|
|
34
|
+
"eslint-config-prettier": "^10.1.8",
|
|
35
|
+
"eslint-flat-config-utils": "^2.1.1",
|
|
36
36
|
"eslint-plugin-import-x": "^4.16.1",
|
|
37
37
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
38
|
-
"eslint-plugin-n": "^17.21.
|
|
38
|
+
"eslint-plugin-n": "^17.21.3",
|
|
39
39
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
40
|
-
"eslint-plugin-prettier": "^5.5.
|
|
41
|
-
"eslint-plugin-regexp": "^2.
|
|
42
|
-
"eslint-plugin-unicorn": "^
|
|
43
|
-
"eslint-plugin-unused-imports": "^4.
|
|
40
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
41
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
42
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
43
|
+
"eslint-plugin-unused-imports": "^4.2.0",
|
|
44
44
|
"globals": "^16.3.0",
|
|
45
|
-
"jiti": "^2.
|
|
45
|
+
"jiti": "^2.5.1",
|
|
46
46
|
"jsonc-eslint-parser": "^2.4.0",
|
|
47
|
-
"local-pkg": "^1.1.
|
|
47
|
+
"local-pkg": "^1.1.2",
|
|
48
48
|
"prettier": "^3.6.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/node": "^24.0
|
|
52
|
-
"@unocss/eslint-plugin": "^66.
|
|
53
|
-
"bumpp": "^10.2.
|
|
54
|
-
"eslint-plugin-vue": "10.
|
|
55
|
-
"eslint-typegen": "^2.
|
|
56
|
-
"lint-staged": "^16.1.
|
|
57
|
-
"simple-git-hooks": "^2.13.
|
|
58
|
-
"tsdown": "^0.
|
|
59
|
-
"typescript": "^5.
|
|
60
|
-
"typescript-eslint": "^8.
|
|
51
|
+
"@types/node": "^24.3.0",
|
|
52
|
+
"@unocss/eslint-plugin": "^66.4.2",
|
|
53
|
+
"bumpp": "^10.2.3",
|
|
54
|
+
"eslint-plugin-vue": "^10.4.0",
|
|
55
|
+
"eslint-typegen": "^2.3.0",
|
|
56
|
+
"lint-staged": "^16.1.5",
|
|
57
|
+
"simple-git-hooks": "^2.13.1",
|
|
58
|
+
"tsdown": "^0.14.1",
|
|
59
|
+
"typescript": "^5.9.2",
|
|
60
|
+
"typescript-eslint": "^8.40.0"
|
|
61
61
|
},
|
|
62
62
|
"simple-git-hooks": {
|
|
63
63
|
"pre-commit": "pnpm lint-staged"
|