@dhzh/eslint-config 2.1.0 → 2.1.1
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/index.mjs +5 -5
- package/dist/index.d.mts +397 -173
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -580,6 +580,11 @@ interface RuleOptions {
|
|
|
580
580
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-fetch
|
|
581
581
|
*/
|
|
582
582
|
'@eslint-react/web-api-no-leaked-fetch'?: Linter.RuleEntry<[]>;
|
|
583
|
+
/**
|
|
584
|
+
* Enforces that every 'IntersectionObserver' created in a component or custom hook has a corresponding 'IntersectionObserver.disconnect()'.
|
|
585
|
+
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-intersection-observer
|
|
586
|
+
*/
|
|
587
|
+
'@eslint-react/web-api-no-leaked-intersection-observer'?: Linter.RuleEntry<[]>;
|
|
583
588
|
/**
|
|
584
589
|
* Enforces that every 'setInterval' in a component or custom hook has a corresponding 'clearInterval'.
|
|
585
590
|
* @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
|
|
@@ -5990,753 +5995,921 @@ interface RuleOptions {
|
|
|
5990
5995
|
*/
|
|
5991
5996
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5992
5997
|
/**
|
|
5993
|
-
*
|
|
5994
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5998
|
+
* Prefer better DOM traversal APIs.
|
|
5999
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/better-dom-traversing.md
|
|
6000
|
+
*/
|
|
6001
|
+
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
6002
|
+
/**
|
|
6003
|
+
* Removed. Prefer `eslint-plugin-regexp`
|
|
6004
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#better-regex
|
|
6005
|
+
* @deprecated
|
|
5995
6006
|
*/
|
|
5996
|
-
'unicorn/better-regex'?: Linter.RuleEntry<
|
|
6007
|
+
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
5997
6008
|
/**
|
|
5998
6009
|
* Enforce a specific parameter name in catch clauses.
|
|
5999
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6010
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/catch-error-name.md
|
|
6000
6011
|
*/
|
|
6001
6012
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
6002
6013
|
/**
|
|
6003
6014
|
* Enforce consistent assertion style with `node:assert`.
|
|
6004
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6015
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-assert.md
|
|
6005
6016
|
*/
|
|
6006
6017
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
6018
|
+
/**
|
|
6019
|
+
* Enforce consistent spelling of compound words in identifiers.
|
|
6020
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-compound-words.md
|
|
6021
|
+
*/
|
|
6022
|
+
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
6007
6023
|
/**
|
|
6008
6024
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6009
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6025
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-date-clone.md
|
|
6010
6026
|
*/
|
|
6011
6027
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
6012
6028
|
/**
|
|
6013
6029
|
* Use destructured variables over properties.
|
|
6014
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6030
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-destructuring.md
|
|
6015
6031
|
*/
|
|
6016
6032
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
6017
6033
|
/**
|
|
6018
6034
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6019
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6035
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-empty-array-spread.md
|
|
6020
6036
|
*/
|
|
6021
6037
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
6022
6038
|
/**
|
|
6023
6039
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6024
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6040
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-existence-index-check.md
|
|
6025
6041
|
*/
|
|
6026
6042
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
6027
6043
|
/**
|
|
6028
6044
|
* Move function definitions to the highest possible scope.
|
|
6029
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6045
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-function-scoping.md
|
|
6030
6046
|
*/
|
|
6031
6047
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
6048
|
+
/**
|
|
6049
|
+
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
6050
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-json-file-read.md
|
|
6051
|
+
*/
|
|
6052
|
+
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
6032
6053
|
/**
|
|
6033
6054
|
* Enforce consistent style for escaping `${` in template literals.
|
|
6034
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6055
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-template-literal-escape.md
|
|
6035
6056
|
*/
|
|
6036
6057
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
6037
6058
|
/**
|
|
6038
6059
|
* Enforce correct `Error` subclassing.
|
|
6039
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6060
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/custom-error-definition.md
|
|
6040
6061
|
*/
|
|
6041
6062
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
6063
|
+
/**
|
|
6064
|
+
* Enforce consistent style for DOM element dataset access.
|
|
6065
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/dom-node-dataset.md
|
|
6066
|
+
*/
|
|
6067
|
+
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
6042
6068
|
/**
|
|
6043
6069
|
* Enforce no spaces between braces.
|
|
6044
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6070
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/empty-brace-spaces.md
|
|
6045
6071
|
*/
|
|
6046
6072
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
6047
6073
|
/**
|
|
6048
6074
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6049
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6075
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/error-message.md
|
|
6050
6076
|
*/
|
|
6051
6077
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
6052
6078
|
/**
|
|
6053
6079
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6054
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6080
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/escape-case.md
|
|
6055
6081
|
*/
|
|
6056
6082
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
6057
6083
|
/**
|
|
6058
6084
|
* Add expiration conditions to TODO comments.
|
|
6059
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6085
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/expiring-todo-comments.md
|
|
6060
6086
|
*/
|
|
6061
6087
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
6062
6088
|
/**
|
|
6063
6089
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6064
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6090
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/explicit-length-check.md
|
|
6065
6091
|
*/
|
|
6066
6092
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
6067
6093
|
/**
|
|
6068
|
-
* Enforce a case style for filenames.
|
|
6069
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6094
|
+
* Enforce a case style for filenames and directory names.
|
|
6095
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/filename-case.md
|
|
6070
6096
|
*/
|
|
6071
6097
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
6072
6098
|
/**
|
|
6073
6099
|
* Enforce specific import styles per module.
|
|
6074
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6100
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/import-style.md
|
|
6075
6101
|
*/
|
|
6076
6102
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
6077
6103
|
/**
|
|
6078
6104
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
6079
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6105
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/isolated-functions.md
|
|
6080
6106
|
*/
|
|
6081
6107
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
6082
6108
|
/**
|
|
6083
6109
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6084
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6110
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/new-for-builtins.md
|
|
6085
6111
|
*/
|
|
6086
6112
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
6087
6113
|
/**
|
|
6088
6114
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6089
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-abusive-eslint-disable.md
|
|
6090
6116
|
*/
|
|
6091
6117
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
6092
6118
|
/**
|
|
6093
6119
|
* Disallow recursive access to `this` within getters and setters.
|
|
6094
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6120
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-accessor-recursion.md
|
|
6095
6121
|
*/
|
|
6096
6122
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
6097
6123
|
/**
|
|
6098
6124
|
* Disallow anonymous functions and classes as the default export.
|
|
6099
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-anonymous-default-export.md
|
|
6100
6126
|
*/
|
|
6101
6127
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
6102
6128
|
/**
|
|
6103
6129
|
* Prevent passing a function reference directly to iterator methods.
|
|
6104
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6130
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-callback-reference.md
|
|
6105
6131
|
*/
|
|
6106
|
-
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<
|
|
6132
|
+
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
6133
|
+
/**
|
|
6134
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
6135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-fill-with-reference-type.md
|
|
6136
|
+
*/
|
|
6137
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
6107
6138
|
/**
|
|
6108
6139
|
* Prefer `for…of` over the `forEach` method.
|
|
6109
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-for-each.md
|
|
6110
6141
|
*/
|
|
6111
6142
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
6143
|
+
/**
|
|
6144
|
+
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
6145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-from-fill.md
|
|
6146
|
+
*/
|
|
6147
|
+
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
6112
6148
|
/**
|
|
6113
6149
|
* Disallow using the `this` argument in array methods.
|
|
6114
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-method-this-argument.md
|
|
6115
6151
|
*/
|
|
6116
6152
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
6117
6153
|
/**
|
|
6118
6154
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6119
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
6120
6156
|
* @deprecated
|
|
6121
6157
|
*/
|
|
6122
6158
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
6123
6159
|
/**
|
|
6124
6160
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6125
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6161
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reduce.md
|
|
6126
6162
|
*/
|
|
6127
6163
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
6128
6164
|
/**
|
|
6129
6165
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6130
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6166
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reverse.md
|
|
6131
6167
|
*/
|
|
6132
6168
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
6133
6169
|
/**
|
|
6134
6170
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6135
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6171
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-sort.md
|
|
6136
6172
|
*/
|
|
6137
6173
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6138
6174
|
/**
|
|
6139
6175
|
* Disallow member access from await expression.
|
|
6140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6176
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-expression-member.md
|
|
6141
6177
|
*/
|
|
6142
6178
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
6143
6179
|
/**
|
|
6144
6180
|
* Disallow using `await` in `Promise` method parameters.
|
|
6145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6181
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-in-promise-methods.md
|
|
6146
6182
|
*/
|
|
6147
6183
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6184
|
+
/**
|
|
6185
|
+
* Disallow unnecessary `Blob` to `File` conversion.
|
|
6186
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-blob-to-file.md
|
|
6187
|
+
*/
|
|
6188
|
+
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
6189
|
+
/**
|
|
6190
|
+
* Prefer drawing canvases directly instead of converting them to images.
|
|
6191
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-canvas-to-image.md
|
|
6192
|
+
*/
|
|
6193
|
+
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
6194
|
+
/**
|
|
6195
|
+
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
6196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-confusing-array-splice.md
|
|
6197
|
+
*/
|
|
6198
|
+
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
6148
6199
|
/**
|
|
6149
6200
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
6150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-console-spaces.md
|
|
6151
6202
|
*/
|
|
6152
6203
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6153
6204
|
/**
|
|
6154
6205
|
* Do not use `document.cookie` directly.
|
|
6155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-document-cookie.md
|
|
6156
6207
|
*/
|
|
6157
6208
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6209
|
+
/**
|
|
6210
|
+
* Disallow duplicate values in `Set` constructor array literals.
|
|
6211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-duplicate-set-values.md
|
|
6212
|
+
*/
|
|
6213
|
+
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
6158
6214
|
/**
|
|
6159
6215
|
* Disallow empty files.
|
|
6160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-empty-file.md
|
|
6161
6217
|
*/
|
|
6162
|
-
'unicorn/no-empty-file'?: Linter.RuleEntry<
|
|
6218
|
+
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
6219
|
+
/**
|
|
6220
|
+
* Disallow exports in scripts.
|
|
6221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-exports-in-scripts.md
|
|
6222
|
+
*/
|
|
6223
|
+
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
6163
6224
|
/**
|
|
6164
6225
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
6165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-for-loop.md
|
|
6166
6227
|
*/
|
|
6167
6228
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
6168
6229
|
/**
|
|
6169
6230
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
6170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-hex-escape.md
|
|
6171
6232
|
*/
|
|
6172
6233
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
6173
6234
|
/**
|
|
6174
6235
|
* Disallow immediate mutation after variable assignment.
|
|
6175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-immediate-mutation.md
|
|
6176
6237
|
*/
|
|
6177
6238
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
6239
|
+
/**
|
|
6240
|
+
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
6241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-incorrect-query-selector.md
|
|
6242
|
+
*/
|
|
6243
|
+
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
6178
6244
|
/**
|
|
6179
6245
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
6180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6246
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
6181
6247
|
* @deprecated
|
|
6182
6248
|
*/
|
|
6183
6249
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
6184
6250
|
/**
|
|
6185
6251
|
* Disallow `instanceof` with built-in objects
|
|
6186
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-instanceof-builtins.md
|
|
6187
6253
|
*/
|
|
6188
6254
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6189
6255
|
/**
|
|
6190
6256
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-fetch-options.md
|
|
6192
6258
|
*/
|
|
6193
6259
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6260
|
+
/**
|
|
6261
|
+
* Disallow invalid `accept` values on file inputs.
|
|
6262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-file-input-accept.md
|
|
6263
|
+
*/
|
|
6264
|
+
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
6194
6265
|
/**
|
|
6195
6266
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-remove-event-listener.md
|
|
6197
6268
|
*/
|
|
6198
6269
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6199
6270
|
/**
|
|
6200
6271
|
* Disallow identifiers starting with `new` or `class`.
|
|
6201
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-keyword-prefix.md
|
|
6202
6273
|
*/
|
|
6203
6274
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6275
|
+
/**
|
|
6276
|
+
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
6277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-late-current-target-access.md
|
|
6278
|
+
*/
|
|
6279
|
+
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
6204
6280
|
/**
|
|
6205
6281
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
6207
6283
|
* @deprecated
|
|
6208
6284
|
*/
|
|
6209
6285
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6210
6286
|
/**
|
|
6211
6287
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6288
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-lonely-if.md
|
|
6213
6289
|
*/
|
|
6214
6290
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6215
6291
|
/**
|
|
6216
6292
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6293
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-magic-array-flat-depth.md
|
|
6218
6294
|
*/
|
|
6219
6295
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6296
|
+
/**
|
|
6297
|
+
* Disallow manually wrapped comments.
|
|
6298
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-manually-wrapped-comments.md
|
|
6299
|
+
*/
|
|
6300
|
+
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
6220
6301
|
/**
|
|
6221
6302
|
* Disallow named usage of default import and export.
|
|
6222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6303
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-named-default.md
|
|
6223
6304
|
*/
|
|
6224
6305
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6225
6306
|
/**
|
|
6226
6307
|
* Disallow negated conditions.
|
|
6227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6308
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negated-condition.md
|
|
6228
6309
|
*/
|
|
6229
6310
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6230
6311
|
/**
|
|
6231
6312
|
* Disallow negated expression in equality check.
|
|
6232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6313
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negation-in-equality-check.md
|
|
6233
6314
|
*/
|
|
6234
6315
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6235
6316
|
/**
|
|
6236
6317
|
* Disallow nested ternary expressions.
|
|
6237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6318
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-nested-ternary.md
|
|
6238
6319
|
*/
|
|
6239
6320
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6240
6321
|
/**
|
|
6241
6322
|
* Disallow `new Array()`.
|
|
6242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6323
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-array.md
|
|
6243
6324
|
*/
|
|
6244
6325
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6245
6326
|
/**
|
|
6246
6327
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6328
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-buffer.md
|
|
6248
6329
|
*/
|
|
6249
6330
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6250
6331
|
/**
|
|
6251
6332
|
* Disallow the use of the `null` literal.
|
|
6252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6333
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-null.md
|
|
6253
6334
|
*/
|
|
6254
6335
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6255
6336
|
/**
|
|
6256
6337
|
* Disallow the use of objects as default parameters.
|
|
6257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6338
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-object-as-default-parameter.md
|
|
6258
6339
|
*/
|
|
6259
6340
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6260
6341
|
/**
|
|
6261
6342
|
* Disallow `process.exit()`.
|
|
6262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6343
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-process-exit.md
|
|
6263
6344
|
*/
|
|
6264
6345
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6265
6346
|
/**
|
|
6266
6347
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6348
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-single-promise-in-promise-methods.md
|
|
6268
6349
|
*/
|
|
6269
6350
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6270
6351
|
/**
|
|
6271
6352
|
* Disallow classes that only have static members.
|
|
6272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6353
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-static-only-class.md
|
|
6273
6354
|
*/
|
|
6274
6355
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6275
6356
|
/**
|
|
6276
6357
|
* Disallow `then` property.
|
|
6277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6358
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-thenable.md
|
|
6278
6359
|
*/
|
|
6279
6360
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6280
6361
|
/**
|
|
6281
6362
|
* Disallow assigning `this` to a variable.
|
|
6282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6363
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-assignment.md
|
|
6283
6364
|
*/
|
|
6284
6365
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6366
|
+
/**
|
|
6367
|
+
* Disallow `this` outside of classes.
|
|
6368
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-outside-of-class.md
|
|
6369
|
+
*/
|
|
6370
|
+
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
6285
6371
|
/**
|
|
6286
6372
|
* Disallow comparing `undefined` using `typeof`.
|
|
6287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6373
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-typeof-undefined.md
|
|
6288
6374
|
*/
|
|
6289
6375
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6290
6376
|
/**
|
|
6291
6377
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6378
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6293
6379
|
*/
|
|
6294
6380
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6295
6381
|
/**
|
|
6296
6382
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6383
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-splice-count.md
|
|
6298
6384
|
*/
|
|
6299
6385
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6300
6386
|
/**
|
|
6301
6387
|
* Disallow awaiting non-promise values.
|
|
6302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6388
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-await.md
|
|
6303
6389
|
*/
|
|
6304
6390
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6391
|
+
/**
|
|
6392
|
+
* Disallow unnecessary nested ternary expressions.
|
|
6393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-nested-ternary.md
|
|
6394
|
+
*/
|
|
6395
|
+
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6305
6396
|
/**
|
|
6306
6397
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-polyfills.md
|
|
6308
6399
|
*/
|
|
6309
6400
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6310
6401
|
/**
|
|
6311
6402
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-slice-end.md
|
|
6313
6404
|
*/
|
|
6314
6405
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6315
6406
|
/**
|
|
6316
6407
|
* Disallow unreadable array destructuring.
|
|
6317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-array-destructuring.md
|
|
6318
6409
|
*/
|
|
6319
6410
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
6320
6411
|
/**
|
|
6321
6412
|
* Disallow unreadable IIFEs.
|
|
6322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-iife.md
|
|
6323
6414
|
*/
|
|
6324
6415
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6416
|
+
/**
|
|
6417
|
+
* Disallow ignoring the return value of selected array methods.
|
|
6418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-array-method-return.md
|
|
6419
|
+
*/
|
|
6420
|
+
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
6325
6421
|
/**
|
|
6326
6422
|
* Disallow unused object properties.
|
|
6327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-properties.md
|
|
6328
6424
|
*/
|
|
6329
6425
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6330
6426
|
/**
|
|
6331
6427
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
6332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-collection-argument.md
|
|
6333
6429
|
*/
|
|
6334
6430
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
6335
6431
|
/**
|
|
6336
6432
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6433
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6338
6434
|
*/
|
|
6339
6435
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6340
6436
|
/**
|
|
6341
6437
|
* Disallow useless fallback when spreading in object literals.
|
|
6342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6438
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-fallback-in-spread.md
|
|
6343
6439
|
*/
|
|
6344
6440
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6345
6441
|
/**
|
|
6346
6442
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
6347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6443
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-iterator-to-array.md
|
|
6348
6444
|
*/
|
|
6349
6445
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
6350
6446
|
/**
|
|
6351
6447
|
* Disallow useless array length check.
|
|
6352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6448
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-length-check.md
|
|
6353
6449
|
*/
|
|
6354
6450
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6355
6451
|
/**
|
|
6356
6452
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6453
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-promise-resolve-reject.md
|
|
6358
6454
|
*/
|
|
6359
6455
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6360
6456
|
/**
|
|
6361
6457
|
* Disallow unnecessary spread.
|
|
6362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6458
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-spread.md
|
|
6363
6459
|
*/
|
|
6364
6460
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6365
6461
|
/**
|
|
6366
6462
|
* Disallow useless case in switch statements.
|
|
6367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6463
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-switch-case.md
|
|
6368
6464
|
*/
|
|
6369
6465
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6370
6466
|
/**
|
|
6371
6467
|
* Disallow useless `undefined`.
|
|
6372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6468
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-undefined.md
|
|
6373
6469
|
*/
|
|
6374
6470
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6375
6471
|
/**
|
|
6376
6472
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6473
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-zero-fractions.md
|
|
6378
6474
|
*/
|
|
6379
6475
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6380
6476
|
/**
|
|
6381
6477
|
* Enforce proper case for numeric literals.
|
|
6382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6478
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/number-literal-case.md
|
|
6383
6479
|
*/
|
|
6384
6480
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6385
6481
|
/**
|
|
6386
6482
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6483
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/numeric-separators-style.md
|
|
6388
6484
|
*/
|
|
6389
6485
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6390
6486
|
/**
|
|
6391
6487
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6488
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-add-event-listener.md
|
|
6393
6489
|
*/
|
|
6394
6490
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6395
6491
|
/**
|
|
6396
6492
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6493
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-find.md
|
|
6398
6494
|
*/
|
|
6399
6495
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6400
6496
|
/**
|
|
6401
6497
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6498
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat.md
|
|
6403
6499
|
*/
|
|
6404
6500
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6405
6501
|
/**
|
|
6406
6502
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6503
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat-map.md
|
|
6408
6504
|
*/
|
|
6409
6505
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6410
6506
|
/**
|
|
6411
6507
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6508
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-index-of.md
|
|
6413
6509
|
*/
|
|
6414
6510
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6511
|
+
/**
|
|
6512
|
+
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
6513
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-last-methods.md
|
|
6514
|
+
*/
|
|
6515
|
+
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
6415
6516
|
/**
|
|
6416
6517
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6518
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-some.md
|
|
6418
6519
|
*/
|
|
6419
6520
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6420
6521
|
/**
|
|
6421
6522
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6523
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-at.md
|
|
6423
6524
|
*/
|
|
6424
6525
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6425
6526
|
/**
|
|
6426
6527
|
* Prefer `BigInt` literals over the constructor.
|
|
6427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6528
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-bigint-literals.md
|
|
6428
6529
|
*/
|
|
6429
6530
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6430
6531
|
/**
|
|
6431
6532
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6533
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-blob-reading-methods.md
|
|
6433
6534
|
*/
|
|
6434
6535
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6435
6536
|
/**
|
|
6436
6537
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6538
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-class-fields.md
|
|
6438
6539
|
*/
|
|
6439
6540
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6440
6541
|
/**
|
|
6441
6542
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6543
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-classlist-toggle.md
|
|
6443
6544
|
*/
|
|
6444
6545
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6445
6546
|
/**
|
|
6446
6547
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6548
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-code-point.md
|
|
6448
6549
|
*/
|
|
6449
6550
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6450
6551
|
/**
|
|
6451
6552
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6553
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-date-now.md
|
|
6453
6554
|
*/
|
|
6454
6555
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6455
6556
|
/**
|
|
6456
6557
|
* Prefer default parameters over reassignment.
|
|
6457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6558
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-default-parameters.md
|
|
6458
6559
|
*/
|
|
6459
6560
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6460
6561
|
/**
|
|
6461
|
-
* Prefer `
|
|
6462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6562
|
+
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
6563
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-append.md
|
|
6463
6564
|
*/
|
|
6464
6565
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6465
6566
|
/**
|
|
6466
|
-
*
|
|
6467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6567
|
+
* Renamed to `unicorn/dom-node-dataset`.
|
|
6568
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
6569
|
+
* @deprecated
|
|
6468
6570
|
*/
|
|
6469
6571
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6470
6572
|
/**
|
|
6471
6573
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6574
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-remove.md
|
|
6473
6575
|
*/
|
|
6474
6576
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6475
6577
|
/**
|
|
6476
6578
|
* Prefer `.textContent` over `.innerText`.
|
|
6477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6579
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-text-content.md
|
|
6478
6580
|
*/
|
|
6479
6581
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6480
6582
|
/**
|
|
6481
6583
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6584
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-event-target.md
|
|
6483
6585
|
*/
|
|
6484
6586
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6485
6587
|
/**
|
|
6486
6588
|
* Prefer `export…from` when re-exporting.
|
|
6487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6589
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-export-from.md
|
|
6488
6590
|
*/
|
|
6489
6591
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6592
|
+
/**
|
|
6593
|
+
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
6594
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-get-or-insert-computed.md
|
|
6595
|
+
*/
|
|
6596
|
+
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
6490
6597
|
/**
|
|
6491
6598
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6599
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-global-this.md
|
|
6493
6600
|
*/
|
|
6494
6601
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6602
|
+
/**
|
|
6603
|
+
* Prefer HTTPS over HTTP.
|
|
6604
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-https.md
|
|
6605
|
+
*/
|
|
6606
|
+
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
6495
6607
|
/**
|
|
6496
6608
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6609
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-import-meta-properties.md
|
|
6498
6610
|
*/
|
|
6499
6611
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6500
6612
|
/**
|
|
6501
6613
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6502
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6614
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes.md
|
|
6503
6615
|
*/
|
|
6504
6616
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6505
6617
|
/**
|
|
6506
|
-
* Prefer
|
|
6507
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6618
|
+
* Prefer `.includes()` over repeated equality comparisons.
|
|
6619
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
6620
|
+
*/
|
|
6621
|
+
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
6622
|
+
/**
|
|
6623
|
+
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
6624
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-concat.md
|
|
6625
|
+
*/
|
|
6626
|
+
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
6627
|
+
/**
|
|
6628
|
+
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
6629
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-to-array-at-end.md
|
|
6630
|
+
*/
|
|
6631
|
+
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
6632
|
+
/**
|
|
6633
|
+
* Renamed to `unicorn/consistent-json-file-read`.
|
|
6634
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
6635
|
+
* @deprecated
|
|
6508
6636
|
*/
|
|
6509
6637
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6510
6638
|
/**
|
|
6511
|
-
* Prefer `KeyboardEvent#key` over
|
|
6512
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6639
|
+
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
6640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-keyboard-event-key.md
|
|
6513
6641
|
*/
|
|
6514
6642
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6515
6643
|
/**
|
|
6516
6644
|
* Prefer using a logical operator over a ternary.
|
|
6517
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6518
6646
|
*/
|
|
6519
6647
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6648
|
+
/**
|
|
6649
|
+
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
6650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-abs.md
|
|
6651
|
+
*/
|
|
6652
|
+
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
6520
6653
|
/**
|
|
6521
6654
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6522
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-min-max.md
|
|
6523
6656
|
*/
|
|
6524
6657
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6525
6658
|
/**
|
|
6526
6659
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6527
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-trunc.md
|
|
6528
6661
|
*/
|
|
6529
6662
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6530
6663
|
/**
|
|
6531
6664
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6532
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-dom-apis.md
|
|
6533
6666
|
*/
|
|
6534
6667
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6535
6668
|
/**
|
|
6536
6669
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6537
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-math-apis.md
|
|
6538
6671
|
*/
|
|
6539
6672
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6540
6673
|
/**
|
|
6541
6674
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6542
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-module.md
|
|
6543
6676
|
*/
|
|
6544
6677
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6545
6678
|
/**
|
|
6546
6679
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6547
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-native-coercion-functions.md
|
|
6548
6681
|
*/
|
|
6549
6682
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6550
6683
|
/**
|
|
6551
6684
|
* Prefer negative index over `.length - index` when possible.
|
|
6552
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-negative-index.md
|
|
6553
6686
|
*/
|
|
6554
6687
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6555
6688
|
/**
|
|
6556
6689
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-node-protocol.md
|
|
6558
6691
|
*/
|
|
6559
6692
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6560
6693
|
/**
|
|
6561
6694
|
* Prefer `Number` static properties over global ones.
|
|
6562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-number-properties.md
|
|
6563
6696
|
*/
|
|
6564
6697
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6565
6698
|
/**
|
|
6566
6699
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6567
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-object-from-entries.md
|
|
6568
6701
|
*/
|
|
6569
6702
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6570
6703
|
/**
|
|
6571
6704
|
* Prefer omitting the `catch` binding parameter.
|
|
6572
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-optional-catch-binding.md
|
|
6573
6706
|
*/
|
|
6574
6707
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6575
6708
|
/**
|
|
6576
6709
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6577
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-prototype-methods.md
|
|
6578
6711
|
*/
|
|
6579
6712
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6580
6713
|
/**
|
|
6581
|
-
* Prefer `.querySelector()`
|
|
6582
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6714
|
+
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
6715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-query-selector.md
|
|
6716
|
+
*/
|
|
6717
|
+
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
6718
|
+
/**
|
|
6719
|
+
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
6720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-queue-microtask.md
|
|
6583
6721
|
*/
|
|
6584
|
-
'unicorn/prefer-
|
|
6722
|
+
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
6585
6723
|
/**
|
|
6586
6724
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6587
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-reflect-apply.md
|
|
6588
6726
|
*/
|
|
6589
6727
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6590
6728
|
/**
|
|
6591
6729
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6592
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-regexp-test.md
|
|
6593
6731
|
*/
|
|
6594
6732
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6595
6733
|
/**
|
|
6596
6734
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6597
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-response-static-json.md
|
|
6598
6736
|
*/
|
|
6599
6737
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
6600
6738
|
/**
|
|
6601
6739
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6602
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-has.md
|
|
6603
6741
|
*/
|
|
6604
|
-
'unicorn/prefer-set-has'?: Linter.RuleEntry<
|
|
6742
|
+
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
6605
6743
|
/**
|
|
6606
6744
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6607
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-size.md
|
|
6608
6746
|
*/
|
|
6609
6747
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6610
6748
|
/**
|
|
6611
6749
|
* Prefer simple conditions first in logical expressions.
|
|
6612
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-simple-condition-first.md
|
|
6613
6751
|
*/
|
|
6614
6752
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
6615
6753
|
/**
|
|
6616
|
-
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6617
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6754
|
+
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-single-call.md
|
|
6618
6756
|
*/
|
|
6619
6757
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6758
|
+
/**
|
|
6759
|
+
* Prefer `String#split()` with a limit.
|
|
6760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-split-limit.md
|
|
6761
|
+
*/
|
|
6762
|
+
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
6620
6763
|
/**
|
|
6621
6764
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6622
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-spread.md
|
|
6623
6766
|
*/
|
|
6624
6767
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6768
|
+
/**
|
|
6769
|
+
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
6770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-match-all.md
|
|
6771
|
+
*/
|
|
6772
|
+
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
6773
|
+
/**
|
|
6774
|
+
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
6775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-pad-start-end.md
|
|
6776
|
+
*/
|
|
6777
|
+
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
6625
6778
|
/**
|
|
6626
6779
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6627
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-raw.md
|
|
6628
6781
|
*/
|
|
6629
6782
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6630
6783
|
/**
|
|
6631
|
-
* Prefer `String#
|
|
6632
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6784
|
+
* Prefer `String#repeat()` for repeated whitespace.
|
|
6785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-repeat.md
|
|
6786
|
+
*/
|
|
6787
|
+
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
6788
|
+
/**
|
|
6789
|
+
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
6790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-replace-all.md
|
|
6633
6791
|
*/
|
|
6634
6792
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6635
6793
|
/**
|
|
6636
6794
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6637
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-slice.md
|
|
6638
6796
|
*/
|
|
6639
6797
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6640
6798
|
/**
|
|
6641
6799
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6642
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-starts-ends-with.md
|
|
6643
6801
|
*/
|
|
6644
6802
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6645
6803
|
/**
|
|
6646
6804
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6647
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-trim-start-end.md
|
|
6648
6806
|
*/
|
|
6649
6807
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6650
6808
|
/**
|
|
6651
6809
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6652
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6810
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-structured-clone.md
|
|
6653
6811
|
*/
|
|
6654
6812
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6655
6813
|
/**
|
|
6656
6814
|
* Prefer `switch` over multiple `else-if`.
|
|
6657
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6815
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-switch.md
|
|
6658
6816
|
*/
|
|
6659
6817
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6660
6818
|
/**
|
|
6661
6819
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6662
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6820
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-ternary.md
|
|
6663
6821
|
*/
|
|
6664
6822
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6665
6823
|
/**
|
|
6666
6824
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6667
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6825
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-top-level-await.md
|
|
6668
6826
|
*/
|
|
6669
6827
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6670
6828
|
/**
|
|
6671
6829
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6672
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6830
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-type-error.md
|
|
6673
6831
|
*/
|
|
6674
6832
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6675
6833
|
/**
|
|
6676
6834
|
* Prevent abbreviations.
|
|
6677
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6835
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prevent-abbreviations.md
|
|
6678
6836
|
*/
|
|
6679
6837
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
6680
6838
|
/**
|
|
6681
6839
|
* Enforce consistent relative URL style.
|
|
6682
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6840
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/relative-url-style.md
|
|
6683
6841
|
*/
|
|
6684
6842
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6685
6843
|
/**
|
|
6686
6844
|
* Enforce using the separator argument with `Array#join()`.
|
|
6687
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6845
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-array-join-separator.md
|
|
6688
6846
|
*/
|
|
6689
6847
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6848
|
+
/**
|
|
6849
|
+
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
6850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-css-escape.md
|
|
6851
|
+
*/
|
|
6852
|
+
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
6690
6853
|
/**
|
|
6691
6854
|
* Require non-empty module attributes for imports and exports
|
|
6692
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6855
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-attributes.md
|
|
6693
6856
|
*/
|
|
6694
6857
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6695
6858
|
/**
|
|
6696
6859
|
* Require non-empty specifier list in import and export statements.
|
|
6697
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6860
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-specifiers.md
|
|
6698
6861
|
*/
|
|
6699
6862
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6700
6863
|
/**
|
|
6701
6864
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6702
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6865
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6703
6866
|
*/
|
|
6704
6867
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6868
|
+
/**
|
|
6869
|
+
* Require passive event listeners for high-frequency events.
|
|
6870
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-passive-events.md
|
|
6871
|
+
*/
|
|
6872
|
+
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
6705
6873
|
/**
|
|
6706
6874
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6707
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6875
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-post-message-target-origin.md
|
|
6708
6876
|
*/
|
|
6709
6877
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6710
6878
|
/**
|
|
6711
6879
|
* Enforce better string content.
|
|
6712
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6880
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/string-content.md
|
|
6713
6881
|
*/
|
|
6714
6882
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6715
6883
|
/**
|
|
6716
6884
|
* Enforce consistent brace style for `case` clauses.
|
|
6717
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6885
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-braces.md
|
|
6718
6886
|
*/
|
|
6719
6887
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6720
6888
|
/**
|
|
6721
6889
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
6722
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6890
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-break-position.md
|
|
6723
6891
|
*/
|
|
6724
6892
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
6725
6893
|
/**
|
|
6726
6894
|
* Fix whitespace-insensitive template indentation.
|
|
6727
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6895
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/template-indent.md
|
|
6728
6896
|
*/
|
|
6729
6897
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6730
6898
|
/**
|
|
6731
6899
|
* Enforce consistent case for text encoding identifiers.
|
|
6732
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6900
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/text-encoding-identifier-case.md
|
|
6733
6901
|
*/
|
|
6734
6902
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
6735
6903
|
/**
|
|
6736
6904
|
* Require `new` when creating an error.
|
|
6737
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6905
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/throw-new-error.md
|
|
6738
6906
|
*/
|
|
6739
6907
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6908
|
+
/**
|
|
6909
|
+
* Limit the complexity of `try` blocks.
|
|
6910
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/try-complexity.md
|
|
6911
|
+
*/
|
|
6912
|
+
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
6740
6913
|
/**
|
|
6741
6914
|
* Disallow unused variables
|
|
6742
6915
|
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
|
|
@@ -14046,23 +14219,40 @@ type TomlSpacedComment = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
14046
14219
|
markers?: string[];
|
|
14047
14220
|
}]; // ----- toml/table-bracket-spacing -----
|
|
14048
14221
|
type TomlTableBracketSpacing = [] | [("always" | "never")]; // ----- unicode-bom -----
|
|
14049
|
-
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/
|
|
14050
|
-
type UnicornBetterRegex = [] | [{
|
|
14051
|
-
sortCharacterClasses?: boolean;
|
|
14052
|
-
}]; // ----- unicorn/catch-error-name -----
|
|
14222
|
+
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/catch-error-name -----
|
|
14053
14223
|
type UnicornCatchErrorName = [] | [{
|
|
14054
14224
|
name?: string;
|
|
14055
14225
|
ignore?: unknown[];
|
|
14056
|
-
}]; // ----- unicorn/consistent-
|
|
14226
|
+
}]; // ----- unicorn/consistent-compound-words -----
|
|
14227
|
+
type UnicornConsistentCompoundWords = [] | [{
|
|
14228
|
+
checkProperties?: boolean;
|
|
14229
|
+
checkVariables?: boolean;
|
|
14230
|
+
checkDefaultAndNamespaceImports?: (boolean | "internal");
|
|
14231
|
+
checkShorthandImports?: (boolean | "internal");
|
|
14232
|
+
checkShorthandProperties?: boolean;
|
|
14233
|
+
extendDefaultReplacements?: boolean;
|
|
14234
|
+
replacements?: _UnicornConsistentCompoundWords_Replacements;
|
|
14235
|
+
allowList?: _UnicornConsistentCompoundWords_TrueObject;
|
|
14236
|
+
}];
|
|
14237
|
+
interface _UnicornConsistentCompoundWords_Replacements {
|
|
14238
|
+
[k: string]: (false | string) | undefined;
|
|
14239
|
+
}
|
|
14240
|
+
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
14241
|
+
[k: string]: true | undefined;
|
|
14242
|
+
} // ----- unicorn/consistent-function-scoping -----
|
|
14057
14243
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
14058
14244
|
checkArrowFunctions?: boolean;
|
|
14245
|
+
}]; // ----- unicorn/consistent-json-file-read -----
|
|
14246
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/dom-node-dataset -----
|
|
14247
|
+
type UnicornDomNodeDataset = [] | [{
|
|
14248
|
+
preferAttributes?: boolean;
|
|
14059
14249
|
}]; // ----- unicorn/escape-case -----
|
|
14060
14250
|
type UnicornEscapeCase = [] | [("uppercase" | "lowercase")]; // ----- unicorn/expiring-todo-comments -----
|
|
14061
14251
|
type UnicornExpiringTodoComments = [] | [{
|
|
14062
14252
|
terms?: string[];
|
|
14063
14253
|
ignore?: unknown[];
|
|
14064
|
-
|
|
14065
|
-
|
|
14254
|
+
checkDates?: boolean;
|
|
14255
|
+
checkDatesOnPullRequests?: boolean;
|
|
14066
14256
|
allowWarningComments?: boolean;
|
|
14067
14257
|
date?: string;
|
|
14068
14258
|
}]; // ----- unicorn/explicit-length-check -----
|
|
@@ -14073,6 +14263,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
14073
14263
|
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
14074
14264
|
ignore?: unknown[];
|
|
14075
14265
|
multipleFileExtensions?: boolean;
|
|
14266
|
+
checkDirectories?: boolean;
|
|
14076
14267
|
} | {
|
|
14077
14268
|
cases?: {
|
|
14078
14269
|
camelCase?: boolean;
|
|
@@ -14082,6 +14273,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
14082
14273
|
};
|
|
14083
14274
|
ignore?: unknown[];
|
|
14084
14275
|
multipleFileExtensions?: boolean;
|
|
14276
|
+
checkDirectories?: boolean;
|
|
14085
14277
|
})]; // ----- unicorn/import-style -----
|
|
14086
14278
|
type UnicornImportStyle = [] | [{
|
|
14087
14279
|
checkImport?: boolean;
|
|
@@ -14105,6 +14297,9 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
14105
14297
|
functions?: string[];
|
|
14106
14298
|
selectors?: string[];
|
|
14107
14299
|
comments?: string[];
|
|
14300
|
+
}]; // ----- unicorn/no-array-callback-reference -----
|
|
14301
|
+
type UnicornNoArrayCallbackReference = [] | [{
|
|
14302
|
+
ignore?: string[];
|
|
14108
14303
|
}]; // ----- unicorn/no-array-reduce -----
|
|
14109
14304
|
type UnicornNoArrayReduce = [] | [{
|
|
14110
14305
|
allowSimpleOperations?: boolean;
|
|
@@ -14114,6 +14309,9 @@ type UnicornNoArrayReverse = [] | [{
|
|
|
14114
14309
|
}]; // ----- unicorn/no-array-sort -----
|
|
14115
14310
|
type UnicornNoArraySort = [] | [{
|
|
14116
14311
|
allowExpressionStatement?: boolean;
|
|
14312
|
+
}]; // ----- unicorn/no-empty-file -----
|
|
14313
|
+
type UnicornNoEmptyFile = [] | [{
|
|
14314
|
+
allowComments?: boolean;
|
|
14117
14315
|
}]; // ----- unicorn/no-instanceof-builtins -----
|
|
14118
14316
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
14119
14317
|
useErrorIsError?: boolean;
|
|
@@ -14127,13 +14325,14 @@ type UnicornNoKeywordPrefix = [] | [{
|
|
|
14127
14325
|
onlyCamelCase?: boolean;
|
|
14128
14326
|
}]; // ----- unicorn/no-null -----
|
|
14129
14327
|
type UnicornNoNull = [] | [{
|
|
14328
|
+
checkArguments?: boolean;
|
|
14130
14329
|
checkStrictEquality?: boolean;
|
|
14131
14330
|
}]; // ----- unicorn/no-typeof-undefined -----
|
|
14132
14331
|
type UnicornNoTypeofUndefined = [] | [{
|
|
14133
14332
|
checkGlobalVariables?: boolean;
|
|
14134
14333
|
}]; // ----- unicorn/no-unnecessary-polyfills -----
|
|
14135
14334
|
type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
14136
|
-
targets
|
|
14335
|
+
targets?: (string | unknown[] | {
|
|
14137
14336
|
[k: string]: unknown | undefined;
|
|
14138
14337
|
});
|
|
14139
14338
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
@@ -14164,6 +14363,7 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
14164
14363
|
onlyIfContainsSeparator?: boolean;
|
|
14165
14364
|
minimumDigits?: number;
|
|
14166
14365
|
groupLength?: number;
|
|
14366
|
+
fractionGroupLength?: number;
|
|
14167
14367
|
};
|
|
14168
14368
|
onlyIfContainsSeparator?: boolean;
|
|
14169
14369
|
}]; // ----- unicorn/prefer-add-event-listener -----
|
|
@@ -14181,7 +14381,10 @@ type UnicornPreferAt = [] | [{
|
|
|
14181
14381
|
checkAllIndexAccess?: boolean;
|
|
14182
14382
|
}]; // ----- unicorn/prefer-export-from -----
|
|
14183
14383
|
type UnicornPreferExportFrom = [] | [{
|
|
14184
|
-
|
|
14384
|
+
checkUsedVariables?: boolean;
|
|
14385
|
+
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
14386
|
+
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
14387
|
+
minimumComparisons?: number;
|
|
14185
14388
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
14186
14389
|
type UnicornPreferNumberProperties = [] | [{
|
|
14187
14390
|
checkInfinity?: boolean;
|
|
@@ -14189,9 +14392,22 @@ type UnicornPreferNumberProperties = [] | [{
|
|
|
14189
14392
|
}]; // ----- unicorn/prefer-object-from-entries -----
|
|
14190
14393
|
type UnicornPreferObjectFromEntries = [] | [{
|
|
14191
14394
|
functions?: unknown[];
|
|
14395
|
+
}]; // ----- unicorn/prefer-query-selector -----
|
|
14396
|
+
type UnicornPreferQuerySelector = [] | [{
|
|
14397
|
+
allowWithVariables?: boolean;
|
|
14398
|
+
}]; // ----- unicorn/prefer-queue-microtask -----
|
|
14399
|
+
type UnicornPreferQueueMicrotask = [] | [{
|
|
14400
|
+
checkSetImmediate?: boolean;
|
|
14401
|
+
checkSetTimeout?: boolean;
|
|
14402
|
+
}]; // ----- unicorn/prefer-set-has -----
|
|
14403
|
+
type UnicornPreferSetHas = [] | [{
|
|
14404
|
+
minimumItems?: number;
|
|
14192
14405
|
}]; // ----- unicorn/prefer-single-call -----
|
|
14193
14406
|
type UnicornPreferSingleCall = [] | [{
|
|
14194
14407
|
ignore?: unknown[];
|
|
14408
|
+
}]; // ----- unicorn/prefer-string-repeat -----
|
|
14409
|
+
type UnicornPreferStringRepeat = [] | [{
|
|
14410
|
+
minimumRepetitions?: number;
|
|
14195
14411
|
}]; // ----- unicorn/prefer-structured-clone -----
|
|
14196
14412
|
type UnicornPreferStructuredClone = [] | [{
|
|
14197
14413
|
functions?: unknown[];
|
|
@@ -14224,15 +14440,20 @@ interface _UnicornPreventAbbreviations_BooleanObject {
|
|
|
14224
14440
|
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
14225
14441
|
[k: string]: boolean | undefined;
|
|
14226
14442
|
} // ----- unicorn/relative-url-style -----
|
|
14227
|
-
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/
|
|
14443
|
+
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
14444
|
+
type UnicornRequireCssEscape = [] | [{
|
|
14445
|
+
checkAllSelectors?: boolean;
|
|
14446
|
+
}]; // ----- unicorn/string-content -----
|
|
14228
14447
|
type UnicornStringContent = [] | [{
|
|
14229
14448
|
patterns?: {
|
|
14230
14449
|
[k: string]: (string | {
|
|
14231
14450
|
suggest: string;
|
|
14232
14451
|
fix?: boolean;
|
|
14452
|
+
caseSensitive?: boolean;
|
|
14233
14453
|
message?: string;
|
|
14234
14454
|
}) | undefined;
|
|
14235
14455
|
};
|
|
14456
|
+
selectors?: string[];
|
|
14236
14457
|
}]; // ----- unicorn/switch-case-braces -----
|
|
14237
14458
|
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
14238
14459
|
type UnicornTemplateIndent = [] | [{
|
|
@@ -14244,6 +14465,9 @@ type UnicornTemplateIndent = [] | [{
|
|
|
14244
14465
|
}]; // ----- unicorn/text-encoding-identifier-case -----
|
|
14245
14466
|
type UnicornTextEncodingIdentifierCase = [] | [{
|
|
14246
14467
|
withDash?: boolean;
|
|
14468
|
+
}]; // ----- unicorn/try-complexity -----
|
|
14469
|
+
type UnicornTryComplexity = [] | [{
|
|
14470
|
+
max?: number;
|
|
14247
14471
|
}]; // ----- unused-imports/no-unused-imports -----
|
|
14248
14472
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|
|
14249
14473
|
args?: ("all" | "after-used" | "none");
|