@dhzh/eslint-config 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +11 -11
- package/dist/cli.js +11 -11
- package/dist/index.d.cts +161 -131
- package/dist/index.d.ts +161 -131
- package/package.json +12 -12
package/dist/index.d.cts
CHANGED
|
@@ -5708,652 +5708,677 @@ interface RuleOptions {
|
|
|
5708
5708
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>
|
|
5709
5709
|
/**
|
|
5710
5710
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
5711
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/better-regex.md
|
|
5712
5712
|
*/
|
|
5713
5713
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>
|
|
5714
5714
|
/**
|
|
5715
5715
|
* Enforce a specific parameter name in catch clauses.
|
|
5716
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/catch-error-name.md
|
|
5717
5717
|
*/
|
|
5718
5718
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
5719
5719
|
/**
|
|
5720
5720
|
* Use destructured variables over properties.
|
|
5721
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/consistent-destructuring.md
|
|
5722
5722
|
*/
|
|
5723
5723
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
5724
|
+
/**
|
|
5725
|
+
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5727
|
+
*/
|
|
5728
|
+
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
5724
5729
|
/**
|
|
5725
5730
|
* Move function definitions to the highest possible scope.
|
|
5726
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/consistent-function-scoping.md
|
|
5727
5732
|
*/
|
|
5728
5733
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
5729
5734
|
/**
|
|
5730
5735
|
* Enforce correct `Error` subclassing.
|
|
5731
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/custom-error-definition.md
|
|
5732
5737
|
*/
|
|
5733
5738
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
5734
5739
|
/**
|
|
5735
5740
|
* Enforce no spaces between braces.
|
|
5736
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/empty-brace-spaces.md
|
|
5737
5742
|
*/
|
|
5738
5743
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
5739
5744
|
/**
|
|
5740
5745
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5741
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5746
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/error-message.md
|
|
5742
5747
|
*/
|
|
5743
5748
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
5744
5749
|
/**
|
|
5745
5750
|
* Require escape sequences to use uppercase values.
|
|
5746
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5751
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/escape-case.md
|
|
5747
5752
|
*/
|
|
5748
5753
|
'unicorn/escape-case'?: Linter.RuleEntry<[]>
|
|
5749
5754
|
/**
|
|
5750
5755
|
* Add expiration conditions to TODO comments.
|
|
5751
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/expiring-todo-comments.md
|
|
5752
5757
|
*/
|
|
5753
5758
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
5754
5759
|
/**
|
|
5755
5760
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5756
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/explicit-length-check.md
|
|
5757
5762
|
*/
|
|
5758
5763
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
5759
5764
|
/**
|
|
5760
5765
|
* Enforce a case style for filenames.
|
|
5761
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5766
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/filename-case.md
|
|
5762
5767
|
*/
|
|
5763
5768
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
5764
5769
|
/**
|
|
5765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#import-index
|
|
5766
5771
|
* @deprecated
|
|
5767
5772
|
*/
|
|
5768
5773
|
'unicorn/import-index'?: Linter.RuleEntry<[]>
|
|
5769
5774
|
/**
|
|
5770
5775
|
* Enforce specific import styles per module.
|
|
5771
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5776
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/import-style.md
|
|
5772
5777
|
*/
|
|
5773
5778
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
5774
5779
|
/**
|
|
5775
5780
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
5776
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5781
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/new-for-builtins.md
|
|
5777
5782
|
*/
|
|
5778
5783
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
5779
5784
|
/**
|
|
5780
5785
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5781
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5786
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5782
5787
|
*/
|
|
5783
5788
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
5784
5789
|
/**
|
|
5785
5790
|
* Disallow anonymous functions and classes as the default export.
|
|
5786
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5791
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-anonymous-default-export.md
|
|
5787
5792
|
*/
|
|
5788
5793
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
5789
5794
|
/**
|
|
5790
5795
|
* Prevent passing a function reference directly to iterator methods.
|
|
5791
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5796
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-array-callback-reference.md
|
|
5792
5797
|
*/
|
|
5793
5798
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>
|
|
5794
5799
|
/**
|
|
5795
5800
|
* Prefer `for…of` over the `forEach` method.
|
|
5796
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5801
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-array-for-each.md
|
|
5797
5802
|
*/
|
|
5798
5803
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
5799
5804
|
/**
|
|
5800
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#no-array-instanceof
|
|
5801
5806
|
* @deprecated
|
|
5802
5807
|
*/
|
|
5803
5808
|
'unicorn/no-array-instanceof'?: Linter.RuleEntry<[]>
|
|
5804
5809
|
/**
|
|
5805
5810
|
* Disallow using the `this` argument in array methods.
|
|
5806
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5811
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-array-method-this-argument.md
|
|
5807
5812
|
*/
|
|
5808
5813
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
5809
5814
|
/**
|
|
5810
5815
|
* Enforce combining multiple `Array#push()` into one call.
|
|
5811
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5816
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-array-push-push.md
|
|
5812
5817
|
*/
|
|
5813
5818
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<UnicornNoArrayPushPush>
|
|
5814
5819
|
/**
|
|
5815
5820
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5816
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5821
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-array-reduce.md
|
|
5817
5822
|
*/
|
|
5818
5823
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
5819
5824
|
/**
|
|
5820
5825
|
* Disallow member access from await expression.
|
|
5821
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5826
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-await-expression-member.md
|
|
5822
5827
|
*/
|
|
5823
5828
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
5824
5829
|
/**
|
|
5825
5830
|
* Disallow using `await` in `Promise` method parameters.
|
|
5826
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5831
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5827
5832
|
*/
|
|
5828
5833
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
5829
5834
|
/**
|
|
5830
5835
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5831
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5836
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-console-spaces.md
|
|
5832
5837
|
*/
|
|
5833
5838
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
5834
5839
|
/**
|
|
5835
5840
|
* Do not use `document.cookie` directly.
|
|
5836
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5841
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-document-cookie.md
|
|
5837
5842
|
*/
|
|
5838
5843
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
5839
5844
|
/**
|
|
5840
5845
|
* Disallow empty files.
|
|
5841
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5846
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-empty-file.md
|
|
5842
5847
|
*/
|
|
5843
5848
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>
|
|
5844
5849
|
/**
|
|
5845
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#no-fn-reference-in-iterator
|
|
5846
5851
|
* @deprecated
|
|
5847
5852
|
*/
|
|
5848
5853
|
'unicorn/no-fn-reference-in-iterator'?: Linter.RuleEntry<[]>
|
|
5849
5854
|
/**
|
|
5850
5855
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5851
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5856
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-for-loop.md
|
|
5852
5857
|
*/
|
|
5853
5858
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
5854
5859
|
/**
|
|
5855
5860
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
5856
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5861
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-hex-escape.md
|
|
5857
5862
|
*/
|
|
5858
5863
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
5859
5864
|
/**
|
|
5860
5865
|
* Require `Array.isArray()` instead of `instanceof Array`.
|
|
5861
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5866
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-instanceof-array.md
|
|
5862
5867
|
*/
|
|
5863
5868
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
5869
|
+
/**
|
|
5870
|
+
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5871
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5872
|
+
*/
|
|
5873
|
+
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
5864
5874
|
/**
|
|
5865
5875
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5866
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5876
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5867
5877
|
*/
|
|
5868
5878
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
5869
5879
|
/**
|
|
5870
5880
|
* Disallow identifiers starting with `new` or `class`.
|
|
5871
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5881
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-keyword-prefix.md
|
|
5872
5882
|
*/
|
|
5873
5883
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
5874
5884
|
/**
|
|
5875
5885
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5876
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5886
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-lonely-if.md
|
|
5877
5887
|
*/
|
|
5878
5888
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
5889
|
+
/**
|
|
5890
|
+
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5891
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5892
|
+
*/
|
|
5893
|
+
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
5879
5894
|
/**
|
|
5880
5895
|
* Disallow negated conditions.
|
|
5881
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5896
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-negated-condition.md
|
|
5882
5897
|
*/
|
|
5883
5898
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
5884
5899
|
/**
|
|
5885
5900
|
* Disallow nested ternary expressions.
|
|
5886
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5901
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-nested-ternary.md
|
|
5887
5902
|
*/
|
|
5888
5903
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
5889
5904
|
/**
|
|
5890
5905
|
* Disallow `new Array()`.
|
|
5891
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5906
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-new-array.md
|
|
5892
5907
|
*/
|
|
5893
5908
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
5894
5909
|
/**
|
|
5895
5910
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5896
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5911
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-new-buffer.md
|
|
5897
5912
|
*/
|
|
5898
5913
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
5899
5914
|
/**
|
|
5900
5915
|
* Disallow the use of the `null` literal.
|
|
5901
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5916
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-null.md
|
|
5902
5917
|
*/
|
|
5903
5918
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
5904
5919
|
/**
|
|
5905
5920
|
* Disallow the use of objects as default parameters.
|
|
5906
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5921
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5907
5922
|
*/
|
|
5908
5923
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
5909
5924
|
/**
|
|
5910
5925
|
* Disallow `process.exit()`.
|
|
5911
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5926
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-process-exit.md
|
|
5912
5927
|
*/
|
|
5913
5928
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
5914
5929
|
/**
|
|
5915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5930
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#no-reduce
|
|
5916
5931
|
* @deprecated
|
|
5917
5932
|
*/
|
|
5918
5933
|
'unicorn/no-reduce'?: Linter.RuleEntry<[]>
|
|
5919
5934
|
/**
|
|
5920
5935
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5921
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5936
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5922
5937
|
*/
|
|
5923
5938
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
5924
5939
|
/**
|
|
5925
5940
|
* Disallow classes that only have static members.
|
|
5926
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5941
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-static-only-class.md
|
|
5927
5942
|
*/
|
|
5928
5943
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
5929
5944
|
/**
|
|
5930
5945
|
* Disallow `then` property.
|
|
5931
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5946
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-thenable.md
|
|
5932
5947
|
*/
|
|
5933
5948
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
5934
5949
|
/**
|
|
5935
5950
|
* Disallow assigning `this` to a variable.
|
|
5936
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5951
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-this-assignment.md
|
|
5937
5952
|
*/
|
|
5938
5953
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
5939
5954
|
/**
|
|
5940
5955
|
* Disallow comparing `undefined` using `typeof`.
|
|
5941
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5956
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-typeof-undefined.md
|
|
5942
5957
|
*/
|
|
5943
5958
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
5944
5959
|
/**
|
|
5945
5960
|
* Disallow awaiting non-promise values.
|
|
5946
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5961
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-unnecessary-await.md
|
|
5947
5962
|
*/
|
|
5948
5963
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
5949
5964
|
/**
|
|
5950
5965
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5951
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5966
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5952
5967
|
*/
|
|
5953
5968
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
5954
5969
|
/**
|
|
5955
5970
|
* Disallow unreadable array destructuring.
|
|
5956
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5971
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
5957
5972
|
*/
|
|
5958
5973
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
5959
5974
|
/**
|
|
5960
5975
|
* Disallow unreadable IIFEs.
|
|
5961
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5976
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-unreadable-iife.md
|
|
5962
5977
|
*/
|
|
5963
5978
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
5964
5979
|
/**
|
|
5965
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5980
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#no-unsafe-regex
|
|
5966
5981
|
* @deprecated
|
|
5967
5982
|
*/
|
|
5968
5983
|
'unicorn/no-unsafe-regex'?: Linter.RuleEntry<[]>
|
|
5969
5984
|
/**
|
|
5970
5985
|
* Disallow unused object properties.
|
|
5971
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5986
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-unused-properties.md
|
|
5972
5987
|
*/
|
|
5973
5988
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
5974
5989
|
/**
|
|
5975
5990
|
* Disallow useless fallback when spreading in object literals.
|
|
5976
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5991
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5977
5992
|
*/
|
|
5978
5993
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
5979
5994
|
/**
|
|
5980
5995
|
* Disallow useless array length check.
|
|
5981
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5996
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-length-check.md
|
|
5982
5997
|
*/
|
|
5983
5998
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
5984
5999
|
/**
|
|
5985
6000
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5986
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6001
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5987
6002
|
*/
|
|
5988
6003
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
5989
6004
|
/**
|
|
5990
6005
|
* Disallow unnecessary spread.
|
|
5991
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6006
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-spread.md
|
|
5992
6007
|
*/
|
|
5993
6008
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
5994
6009
|
/**
|
|
5995
6010
|
* Disallow useless case in switch statements.
|
|
5996
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6011
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-switch-case.md
|
|
5997
6012
|
*/
|
|
5998
6013
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
5999
6014
|
/**
|
|
6000
6015
|
* Disallow useless `undefined`.
|
|
6001
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6016
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-useless-undefined.md
|
|
6002
6017
|
*/
|
|
6003
6018
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
6004
6019
|
/**
|
|
6005
6020
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6006
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6021
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/no-zero-fractions.md
|
|
6007
6022
|
*/
|
|
6008
6023
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
6009
6024
|
/**
|
|
6010
6025
|
* Enforce proper case for numeric literals.
|
|
6011
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6026
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/number-literal-case.md
|
|
6012
6027
|
*/
|
|
6013
6028
|
'unicorn/number-literal-case'?: Linter.RuleEntry<[]>
|
|
6014
6029
|
/**
|
|
6015
6030
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6016
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6031
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/numeric-separators-style.md
|
|
6017
6032
|
*/
|
|
6018
6033
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
6019
6034
|
/**
|
|
6020
6035
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6021
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6036
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-add-event-listener.md
|
|
6022
6037
|
*/
|
|
6023
6038
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
6024
6039
|
/**
|
|
6025
6040
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6026
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6041
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-array-find.md
|
|
6027
6042
|
*/
|
|
6028
6043
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
6029
6044
|
/**
|
|
6030
6045
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6031
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6046
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-array-flat.md
|
|
6032
6047
|
*/
|
|
6033
6048
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
6034
6049
|
/**
|
|
6035
6050
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6036
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6051
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-array-flat-map.md
|
|
6037
6052
|
*/
|
|
6038
6053
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
6039
6054
|
/**
|
|
6040
6055
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6041
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6056
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-array-index-of.md
|
|
6042
6057
|
*/
|
|
6043
6058
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
6044
6059
|
/**
|
|
6045
6060
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast}(…)`.
|
|
6046
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6061
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-array-some.md
|
|
6047
6062
|
*/
|
|
6048
6063
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
6049
6064
|
/**
|
|
6050
6065
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6051
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6066
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-at.md
|
|
6052
6067
|
*/
|
|
6053
6068
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
6054
6069
|
/**
|
|
6055
6070
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6056
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6071
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
6057
6072
|
*/
|
|
6058
6073
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
6059
6074
|
/**
|
|
6060
6075
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6061
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6076
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-code-point.md
|
|
6062
6077
|
*/
|
|
6063
6078
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
6064
6079
|
/**
|
|
6065
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6080
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-dataset
|
|
6066
6081
|
* @deprecated
|
|
6067
6082
|
*/
|
|
6068
6083
|
'unicorn/prefer-dataset'?: Linter.RuleEntry<[]>
|
|
6069
6084
|
/**
|
|
6070
6085
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6071
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6086
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-date-now.md
|
|
6072
6087
|
*/
|
|
6073
6088
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
6074
6089
|
/**
|
|
6075
6090
|
* Prefer default parameters over reassignment.
|
|
6076
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6091
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-default-parameters.md
|
|
6077
6092
|
*/
|
|
6078
6093
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
6079
6094
|
/**
|
|
6080
6095
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
6081
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6096
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-dom-node-append.md
|
|
6082
6097
|
*/
|
|
6083
6098
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
6084
6099
|
/**
|
|
6085
6100
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
6086
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6101
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
6087
6102
|
*/
|
|
6088
6103
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
6089
6104
|
/**
|
|
6090
6105
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6091
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6106
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-dom-node-remove.md
|
|
6092
6107
|
*/
|
|
6093
6108
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
6094
6109
|
/**
|
|
6095
6110
|
* Prefer `.textContent` over `.innerText`.
|
|
6096
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6111
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
6097
6112
|
*/
|
|
6098
6113
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
6099
6114
|
/**
|
|
6100
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-event-key
|
|
6101
6116
|
* @deprecated
|
|
6102
6117
|
*/
|
|
6103
6118
|
'unicorn/prefer-event-key'?: Linter.RuleEntry<[]>
|
|
6104
6119
|
/**
|
|
6105
6120
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6106
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6121
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-event-target.md
|
|
6107
6122
|
*/
|
|
6108
6123
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
6109
6124
|
/**
|
|
6110
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-exponentiation-operator
|
|
6111
6126
|
* @deprecated
|
|
6112
6127
|
*/
|
|
6113
6128
|
'unicorn/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>
|
|
6114
6129
|
/**
|
|
6115
6130
|
* Prefer `export…from` when re-exporting.
|
|
6116
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6131
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-export-from.md
|
|
6117
6132
|
*/
|
|
6118
6133
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
6119
6134
|
/**
|
|
6120
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-flat-map
|
|
6121
6136
|
* @deprecated
|
|
6122
6137
|
*/
|
|
6123
6138
|
'unicorn/prefer-flat-map'?: Linter.RuleEntry<[]>
|
|
6124
6139
|
/**
|
|
6125
6140
|
* Prefer `.includes()` over `.indexOf()` and `Array#some()` when checking for existence or non-existence.
|
|
6126
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6141
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-includes.md
|
|
6127
6142
|
*/
|
|
6128
6143
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
6129
6144
|
/**
|
|
6130
6145
|
* Prefer reading a JSON file as a buffer.
|
|
6131
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6146
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
6132
6147
|
*/
|
|
6133
6148
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
6134
6149
|
/**
|
|
6135
6150
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
6136
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6151
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
6137
6152
|
*/
|
|
6138
6153
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
6139
6154
|
/**
|
|
6140
6155
|
* Prefer using a logical operator over a ternary.
|
|
6141
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6156
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6142
6157
|
*/
|
|
6143
6158
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
6144
6159
|
/**
|
|
6145
6160
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6146
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6161
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-math-trunc.md
|
|
6147
6162
|
*/
|
|
6148
6163
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
6149
6164
|
/**
|
|
6150
6165
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6151
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6166
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
6152
6167
|
*/
|
|
6153
6168
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
6154
6169
|
/**
|
|
6155
6170
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6156
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6171
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-modern-math-apis.md
|
|
6157
6172
|
*/
|
|
6158
6173
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
6159
6174
|
/**
|
|
6160
6175
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6161
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6176
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-module.md
|
|
6162
6177
|
*/
|
|
6163
6178
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
6164
6179
|
/**
|
|
6165
6180
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6166
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6181
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
6167
6182
|
*/
|
|
6168
6183
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
6169
6184
|
/**
|
|
6170
6185
|
* Prefer negative index over `.length - index` when possible.
|
|
6171
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6186
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-negative-index.md
|
|
6172
6187
|
*/
|
|
6173
6188
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
6174
6189
|
/**
|
|
6175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-node-append
|
|
6176
6191
|
* @deprecated
|
|
6177
6192
|
*/
|
|
6178
6193
|
'unicorn/prefer-node-append'?: Linter.RuleEntry<[]>
|
|
6179
6194
|
/**
|
|
6180
6195
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6181
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-node-protocol.md
|
|
6182
6197
|
*/
|
|
6183
6198
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
6184
6199
|
/**
|
|
6185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-node-remove
|
|
6186
6201
|
* @deprecated
|
|
6187
6202
|
*/
|
|
6188
6203
|
'unicorn/prefer-node-remove'?: Linter.RuleEntry<[]>
|
|
6189
6204
|
/**
|
|
6190
6205
|
* Prefer `Number` static properties over global ones.
|
|
6191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-number-properties.md
|
|
6192
6207
|
*/
|
|
6193
6208
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
6194
6209
|
/**
|
|
6195
6210
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-object-from-entries.md
|
|
6197
6212
|
*/
|
|
6198
6213
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
6199
6214
|
/**
|
|
6200
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6215
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-object-has-own
|
|
6201
6216
|
* @deprecated
|
|
6202
6217
|
*/
|
|
6203
6218
|
'unicorn/prefer-object-has-own'?: Linter.RuleEntry<[]>
|
|
6204
6219
|
/**
|
|
6205
6220
|
* Prefer omitting the `catch` binding parameter.
|
|
6206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
6207
6222
|
*/
|
|
6208
6223
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
6209
6224
|
/**
|
|
6210
6225
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6211
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-prototype-methods.md
|
|
6212
6227
|
*/
|
|
6213
6228
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
6214
6229
|
/**
|
|
6215
6230
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()`.
|
|
6216
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-query-selector.md
|
|
6217
6232
|
*/
|
|
6218
6233
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>
|
|
6219
6234
|
/**
|
|
6220
6235
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6221
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-reflect-apply.md
|
|
6222
6237
|
*/
|
|
6223
6238
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
6224
6239
|
/**
|
|
6225
6240
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6226
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-regexp-test.md
|
|
6227
6242
|
*/
|
|
6228
6243
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
6229
6244
|
/**
|
|
6230
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6245
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-replace-all
|
|
6231
6246
|
* @deprecated
|
|
6232
6247
|
*/
|
|
6233
6248
|
'unicorn/prefer-replace-all'?: Linter.RuleEntry<[]>
|
|
6234
6249
|
/**
|
|
6235
6250
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6236
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-set-has.md
|
|
6237
6252
|
*/
|
|
6238
6253
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>
|
|
6239
6254
|
/**
|
|
6240
6255
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6241
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-set-size.md
|
|
6242
6257
|
*/
|
|
6243
6258
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
6244
6259
|
/**
|
|
6245
6260
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6246
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-spread.md
|
|
6247
6262
|
*/
|
|
6248
6263
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
6249
6264
|
/**
|
|
6250
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6265
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-starts-ends-with
|
|
6251
6266
|
* @deprecated
|
|
6252
6267
|
*/
|
|
6253
6268
|
'unicorn/prefer-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
6269
|
+
/**
|
|
6270
|
+
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-string-raw.md
|
|
6272
|
+
*/
|
|
6273
|
+
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
6254
6274
|
/**
|
|
6255
6275
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
6256
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6276
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-string-replace-all.md
|
|
6257
6277
|
*/
|
|
6258
6278
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
6259
6279
|
/**
|
|
6260
6280
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6261
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6281
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-string-slice.md
|
|
6262
6282
|
*/
|
|
6263
6283
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
6264
6284
|
/**
|
|
6265
6285
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6266
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6286
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
6267
6287
|
*/
|
|
6268
6288
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
6269
6289
|
/**
|
|
6270
6290
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6271
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6291
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
6272
6292
|
*/
|
|
6273
6293
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
6294
|
+
/**
|
|
6295
|
+
* Prefer using `structuredClone` to create a deep clone.
|
|
6296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-structured-clone.md
|
|
6297
|
+
*/
|
|
6298
|
+
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
6274
6299
|
/**
|
|
6275
6300
|
* Prefer `switch` over multiple `else-if`.
|
|
6276
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-switch.md
|
|
6277
6302
|
*/
|
|
6278
6303
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
6279
6304
|
/**
|
|
6280
6305
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6281
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-ternary.md
|
|
6282
6307
|
*/
|
|
6283
6308
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
6284
6309
|
/**
|
|
6285
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6310
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-text-content
|
|
6286
6311
|
* @deprecated
|
|
6287
6312
|
*/
|
|
6288
6313
|
'unicorn/prefer-text-content'?: Linter.RuleEntry<[]>
|
|
6289
6314
|
/**
|
|
6290
6315
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6291
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-top-level-await.md
|
|
6292
6317
|
*/
|
|
6293
6318
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
6294
6319
|
/**
|
|
6295
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6320
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#prefer-trim-start-end
|
|
6296
6321
|
* @deprecated
|
|
6297
6322
|
*/
|
|
6298
6323
|
'unicorn/prefer-trim-start-end'?: Linter.RuleEntry<[]>
|
|
6299
6324
|
/**
|
|
6300
6325
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6301
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prefer-type-error.md
|
|
6302
6327
|
*/
|
|
6303
6328
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
6304
6329
|
/**
|
|
6305
6330
|
* Prevent abbreviations.
|
|
6306
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/prevent-abbreviations.md
|
|
6307
6332
|
*/
|
|
6308
6333
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
6309
6334
|
/**
|
|
6310
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6335
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/deprecated-rules.md#regex-shorthand
|
|
6311
6336
|
* @deprecated
|
|
6312
6337
|
*/
|
|
6313
6338
|
'unicorn/regex-shorthand'?: Linter.RuleEntry<[]>
|
|
6314
6339
|
/**
|
|
6315
6340
|
* Enforce consistent relative URL style.
|
|
6316
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/relative-url-style.md
|
|
6317
6342
|
*/
|
|
6318
6343
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
6319
6344
|
/**
|
|
6320
6345
|
* Enforce using the separator argument with `Array#join()`.
|
|
6321
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/require-array-join-separator.md
|
|
6322
6347
|
*/
|
|
6323
6348
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
6324
6349
|
/**
|
|
6325
6350
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6326
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6327
6352
|
*/
|
|
6328
6353
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
6329
6354
|
/**
|
|
6330
6355
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6331
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/require-post-message-target-origin.md
|
|
6332
6357
|
*/
|
|
6333
6358
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
6334
6359
|
/**
|
|
6335
6360
|
* Enforce better string content.
|
|
6336
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/string-content.md
|
|
6337
6362
|
*/
|
|
6338
6363
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
6339
6364
|
/**
|
|
6340
6365
|
* Enforce consistent brace style for `case` clauses.
|
|
6341
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/switch-case-braces.md
|
|
6342
6367
|
*/
|
|
6343
6368
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
6344
6369
|
/**
|
|
6345
6370
|
* Fix whitespace-insensitive template indentation.
|
|
6346
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/template-indent.md
|
|
6347
6372
|
*/
|
|
6348
6373
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
6349
6374
|
/**
|
|
6350
6375
|
* Enforce consistent case for text encoding identifiers.
|
|
6351
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/text-encoding-identifier-case.md
|
|
6352
6377
|
*/
|
|
6353
6378
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>
|
|
6354
6379
|
/**
|
|
6355
|
-
* Require `new` when
|
|
6356
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6380
|
+
* Require `new` when creating an error.
|
|
6381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/throw-new-error.md
|
|
6357
6382
|
*/
|
|
6358
6383
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
6359
6384
|
/**
|
|
@@ -13764,11 +13789,16 @@ type UnicornPreferExportFrom = []|[{
|
|
|
13764
13789
|
// ----- unicorn/prefer-number-properties -----
|
|
13765
13790
|
type UnicornPreferNumberProperties = []|[{
|
|
13766
13791
|
checkInfinity?: boolean
|
|
13792
|
+
checkNaN?: boolean
|
|
13767
13793
|
}]
|
|
13768
13794
|
// ----- unicorn/prefer-object-from-entries -----
|
|
13769
13795
|
type UnicornPreferObjectFromEntries = []|[{
|
|
13770
13796
|
functions?: unknown[]
|
|
13771
13797
|
}]
|
|
13798
|
+
// ----- unicorn/prefer-structured-clone -----
|
|
13799
|
+
type UnicornPreferStructuredClone = []|[{
|
|
13800
|
+
functions?: unknown[]
|
|
13801
|
+
}]
|
|
13772
13802
|
// ----- unicorn/prefer-switch -----
|
|
13773
13803
|
type UnicornPreferSwitch = []|[{
|
|
13774
13804
|
minimumCases?: number
|