@zayne-labs/eslint-config 0.9.14 → 0.9.15
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.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +226 -183
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -2873,6 +2873,11 @@ interface Rules {
|
|
|
2873
2873
|
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
2874
2874
|
*/
|
|
2875
2875
|
'prefer-template'?: Linter.RuleEntry<[]>;
|
|
2876
|
+
/**
|
|
2877
|
+
* Disallow losing originally caught error when re-throwing custom errors
|
|
2878
|
+
* @see https://eslint.org/docs/latest/rules/preserve-caught-error
|
|
2879
|
+
*/
|
|
2880
|
+
'preserve-caught-error'?: Linter.RuleEntry<PreserveCaughtError>;
|
|
2876
2881
|
/**
|
|
2877
2882
|
* Require quotes around object literal property names
|
|
2878
2883
|
* @see https://eslint.org/docs/latest/rules/quote-props
|
|
@@ -3884,8 +3889,9 @@ interface Rules {
|
|
|
3884
3889
|
*/
|
|
3885
3890
|
'stylistic/jsx-pascal-case'?: Linter.RuleEntry<StylisticJsxPascalCase>;
|
|
3886
3891
|
/**
|
|
3887
|
-
* Disallow multiple spaces between inline JSX props
|
|
3892
|
+
* Disallow multiple spaces between inline JSX props. Deprecated, use `no-multi-spaces` rule instead.
|
|
3888
3893
|
* @see https://eslint.style/rules/jsx-props-no-multi-spaces
|
|
3894
|
+
* @deprecated
|
|
3889
3895
|
*/
|
|
3890
3896
|
'stylistic/jsx-props-no-multi-spaces'?: Linter.RuleEntry<[]>;
|
|
3891
3897
|
/**
|
|
@@ -5088,690 +5094,710 @@ interface Rules {
|
|
|
5088
5094
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5089
5095
|
/**
|
|
5090
5096
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
5091
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5097
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/better-regex.md
|
|
5092
5098
|
*/
|
|
5093
5099
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
5094
5100
|
/**
|
|
5095
5101
|
* Enforce a specific parameter name in catch clauses.
|
|
5096
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5102
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/catch-error-name.md
|
|
5097
5103
|
*/
|
|
5098
5104
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5099
5105
|
/**
|
|
5100
5106
|
* Enforce consistent assertion style with `node:assert`.
|
|
5101
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5107
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-assert.md
|
|
5102
5108
|
*/
|
|
5103
5109
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5104
5110
|
/**
|
|
5105
5111
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5106
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5112
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-date-clone.md
|
|
5107
5113
|
*/
|
|
5108
5114
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5109
5115
|
/**
|
|
5110
5116
|
* Use destructured variables over properties.
|
|
5111
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5117
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-destructuring.md
|
|
5112
5118
|
*/
|
|
5113
5119
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5114
5120
|
/**
|
|
5115
5121
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5116
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5122
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5117
5123
|
*/
|
|
5118
5124
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5119
5125
|
/**
|
|
5120
5126
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5121
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5127
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-existence-index-check.md
|
|
5122
5128
|
*/
|
|
5123
5129
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5124
5130
|
/**
|
|
5125
5131
|
* Move function definitions to the highest possible scope.
|
|
5126
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5132
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/consistent-function-scoping.md
|
|
5127
5133
|
*/
|
|
5128
5134
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5129
5135
|
/**
|
|
5130
5136
|
* Enforce correct `Error` subclassing.
|
|
5131
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5137
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/custom-error-definition.md
|
|
5132
5138
|
*/
|
|
5133
5139
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5134
5140
|
/**
|
|
5135
5141
|
* Enforce no spaces between braces.
|
|
5136
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5142
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/empty-brace-spaces.md
|
|
5137
5143
|
*/
|
|
5138
5144
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5139
5145
|
/**
|
|
5140
5146
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5141
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5147
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/error-message.md
|
|
5142
5148
|
*/
|
|
5143
5149
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5144
5150
|
/**
|
|
5145
5151
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5146
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5152
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/escape-case.md
|
|
5147
5153
|
*/
|
|
5148
5154
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5149
5155
|
/**
|
|
5150
5156
|
* Add expiration conditions to TODO comments.
|
|
5151
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5157
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/expiring-todo-comments.md
|
|
5152
5158
|
*/
|
|
5153
5159
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5154
5160
|
/**
|
|
5155
5161
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5156
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5162
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/explicit-length-check.md
|
|
5157
5163
|
*/
|
|
5158
5164
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5159
5165
|
/**
|
|
5160
5166
|
* Enforce a case style for filenames.
|
|
5161
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5167
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/filename-case.md
|
|
5162
5168
|
*/
|
|
5163
5169
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5164
5170
|
/**
|
|
5165
5171
|
* Enforce specific import styles per module.
|
|
5166
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5172
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/import-style.md
|
|
5167
5173
|
*/
|
|
5168
5174
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5169
5175
|
/**
|
|
5170
5176
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
5171
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5177
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/new-for-builtins.md
|
|
5172
5178
|
*/
|
|
5173
5179
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5174
5180
|
/**
|
|
5175
5181
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5176
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5182
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5177
5183
|
*/
|
|
5178
5184
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5179
5185
|
/**
|
|
5180
5186
|
* Disallow recursive access to `this` within getters and setters.
|
|
5181
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5187
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-accessor-recursion.md
|
|
5182
5188
|
*/
|
|
5183
5189
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5184
5190
|
/**
|
|
5185
5191
|
* Disallow anonymous functions and classes as the default export.
|
|
5186
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5192
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-anonymous-default-export.md
|
|
5187
5193
|
*/
|
|
5188
5194
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5189
5195
|
/**
|
|
5190
5196
|
* Prevent passing a function reference directly to iterator methods.
|
|
5191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5197
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-callback-reference.md
|
|
5192
5198
|
*/
|
|
5193
5199
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
5194
5200
|
/**
|
|
5195
5201
|
* Prefer `for…of` over the `forEach` method.
|
|
5196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5202
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-for-each.md
|
|
5197
5203
|
*/
|
|
5198
5204
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
5199
5205
|
/**
|
|
5200
5206
|
* Disallow using the `this` argument in array methods.
|
|
5201
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5207
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-method-this-argument.md
|
|
5202
5208
|
*/
|
|
5203
5209
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5204
5210
|
/**
|
|
5205
5211
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5212
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
5207
5213
|
* @deprecated
|
|
5208
5214
|
*/
|
|
5209
5215
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5210
5216
|
/**
|
|
5211
5217
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5218
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-reduce.md
|
|
5213
5219
|
*/
|
|
5214
5220
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5215
5221
|
/**
|
|
5216
5222
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5223
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-reverse.md
|
|
5218
5224
|
*/
|
|
5219
5225
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5226
|
+
/**
|
|
5227
|
+
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
5228
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-array-sort.md
|
|
5229
|
+
*/
|
|
5230
|
+
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
5220
5231
|
/**
|
|
5221
5232
|
* Disallow member access from await expression.
|
|
5222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5233
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-await-expression-member.md
|
|
5223
5234
|
*/
|
|
5224
5235
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5225
5236
|
/**
|
|
5226
5237
|
* Disallow using `await` in `Promise` method parameters.
|
|
5227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5238
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5228
5239
|
*/
|
|
5229
5240
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5230
5241
|
/**
|
|
5231
5242
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5243
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-console-spaces.md
|
|
5233
5244
|
*/
|
|
5234
5245
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
5235
5246
|
/**
|
|
5236
5247
|
* Do not use `document.cookie` directly.
|
|
5237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5248
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-document-cookie.md
|
|
5238
5249
|
*/
|
|
5239
5250
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
5240
5251
|
/**
|
|
5241
5252
|
* Disallow empty files.
|
|
5242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5253
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-empty-file.md
|
|
5243
5254
|
*/
|
|
5244
5255
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
5245
5256
|
/**
|
|
5246
5257
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5258
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-for-loop.md
|
|
5248
5259
|
*/
|
|
5249
5260
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5250
5261
|
/**
|
|
5251
5262
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
5252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5263
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-hex-escape.md
|
|
5253
5264
|
*/
|
|
5254
5265
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5255
5266
|
/**
|
|
5256
5267
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5268
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
5258
5269
|
* @deprecated
|
|
5259
5270
|
*/
|
|
5260
5271
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5261
5272
|
/**
|
|
5262
5273
|
* Disallow `instanceof` with built-in objects
|
|
5263
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5274
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-instanceof-builtins.md
|
|
5264
5275
|
*/
|
|
5265
5276
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
5266
5277
|
/**
|
|
5267
5278
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5268
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5279
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5269
5280
|
*/
|
|
5270
5281
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
5271
5282
|
/**
|
|
5272
5283
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5273
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5284
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5274
5285
|
*/
|
|
5275
5286
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
5276
5287
|
/**
|
|
5277
5288
|
* Disallow identifiers starting with `new` or `class`.
|
|
5278
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5289
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-keyword-prefix.md
|
|
5279
5290
|
*/
|
|
5280
5291
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
5281
5292
|
/**
|
|
5282
5293
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
5283
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5294
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
5284
5295
|
* @deprecated
|
|
5285
5296
|
*/
|
|
5286
5297
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
5287
5298
|
/**
|
|
5288
5299
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5289
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5300
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-lonely-if.md
|
|
5290
5301
|
*/
|
|
5291
5302
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
5292
5303
|
/**
|
|
5293
5304
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5294
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5305
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5295
5306
|
*/
|
|
5296
5307
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5297
5308
|
/**
|
|
5298
5309
|
* Disallow named usage of default import and export.
|
|
5299
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5310
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-named-default.md
|
|
5300
5311
|
*/
|
|
5301
5312
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
5302
5313
|
/**
|
|
5303
5314
|
* Disallow negated conditions.
|
|
5304
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5315
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-negated-condition.md
|
|
5305
5316
|
*/
|
|
5306
5317
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
5307
5318
|
/**
|
|
5308
5319
|
* Disallow negated expression in equality check.
|
|
5309
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5320
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-negation-in-equality-check.md
|
|
5310
5321
|
*/
|
|
5311
5322
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
5312
5323
|
/**
|
|
5313
5324
|
* Disallow nested ternary expressions.
|
|
5314
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5325
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-nested-ternary.md
|
|
5315
5326
|
*/
|
|
5316
5327
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5317
5328
|
/**
|
|
5318
5329
|
* Disallow `new Array()`.
|
|
5319
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5330
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-new-array.md
|
|
5320
5331
|
*/
|
|
5321
5332
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
5322
5333
|
/**
|
|
5323
5334
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5324
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5335
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-new-buffer.md
|
|
5325
5336
|
*/
|
|
5326
5337
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
5327
5338
|
/**
|
|
5328
5339
|
* Disallow the use of the `null` literal.
|
|
5329
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5340
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-null.md
|
|
5330
5341
|
*/
|
|
5331
5342
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
5332
5343
|
/**
|
|
5333
5344
|
* Disallow the use of objects as default parameters.
|
|
5334
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5345
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5335
5346
|
*/
|
|
5336
5347
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
5337
5348
|
/**
|
|
5338
5349
|
* Disallow `process.exit()`.
|
|
5339
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5350
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-process-exit.md
|
|
5340
5351
|
*/
|
|
5341
5352
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
5342
5353
|
/**
|
|
5343
5354
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5344
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5355
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5345
5356
|
*/
|
|
5346
5357
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5347
5358
|
/**
|
|
5348
5359
|
* Disallow classes that only have static members.
|
|
5349
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5360
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-static-only-class.md
|
|
5350
5361
|
*/
|
|
5351
5362
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
5352
5363
|
/**
|
|
5353
5364
|
* Disallow `then` property.
|
|
5354
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5365
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-thenable.md
|
|
5355
5366
|
*/
|
|
5356
5367
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
5357
5368
|
/**
|
|
5358
5369
|
* Disallow assigning `this` to a variable.
|
|
5359
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5370
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-this-assignment.md
|
|
5360
5371
|
*/
|
|
5361
5372
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
5362
5373
|
/**
|
|
5363
5374
|
* Disallow comparing `undefined` using `typeof`.
|
|
5364
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5375
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-typeof-undefined.md
|
|
5365
5376
|
*/
|
|
5366
5377
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
5367
5378
|
/**
|
|
5368
5379
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
5369
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5380
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
5370
5381
|
*/
|
|
5371
5382
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5372
5383
|
/**
|
|
5373
5384
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
5374
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5385
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
5375
5386
|
*/
|
|
5376
5387
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
5377
5388
|
/**
|
|
5378
5389
|
* Disallow awaiting non-promise values.
|
|
5379
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5390
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unnecessary-await.md
|
|
5380
5391
|
*/
|
|
5381
5392
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
5382
5393
|
/**
|
|
5383
5394
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5384
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5395
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5385
5396
|
*/
|
|
5386
5397
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
5387
5398
|
/**
|
|
5388
5399
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
5389
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5400
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
5390
5401
|
*/
|
|
5391
5402
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
5392
5403
|
/**
|
|
5393
5404
|
* Disallow unreadable array destructuring.
|
|
5394
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5405
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
5395
5406
|
*/
|
|
5396
5407
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
5397
5408
|
/**
|
|
5398
5409
|
* Disallow unreadable IIFEs.
|
|
5399
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5410
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unreadable-iife.md
|
|
5400
5411
|
*/
|
|
5401
5412
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
5402
5413
|
/**
|
|
5403
5414
|
* Disallow unused object properties.
|
|
5404
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5415
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-unused-properties.md
|
|
5405
5416
|
*/
|
|
5406
5417
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
5407
5418
|
/**
|
|
5408
5419
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
5409
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5420
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
5410
5421
|
*/
|
|
5411
5422
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
5412
5423
|
/**
|
|
5413
5424
|
* Disallow useless fallback when spreading in object literals.
|
|
5414
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5425
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5415
5426
|
*/
|
|
5416
5427
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
5417
5428
|
/**
|
|
5418
5429
|
* Disallow useless array length check.
|
|
5419
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5430
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-length-check.md
|
|
5420
5431
|
*/
|
|
5421
5432
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
5422
5433
|
/**
|
|
5423
5434
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5424
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5435
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5425
5436
|
*/
|
|
5426
5437
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
5427
5438
|
/**
|
|
5428
5439
|
* Disallow unnecessary spread.
|
|
5429
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5440
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-spread.md
|
|
5430
5441
|
*/
|
|
5431
5442
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
5432
5443
|
/**
|
|
5433
5444
|
* Disallow useless case in switch statements.
|
|
5434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5445
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-switch-case.md
|
|
5435
5446
|
*/
|
|
5436
5447
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
5437
5448
|
/**
|
|
5438
5449
|
* Disallow useless `undefined`.
|
|
5439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5450
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-useless-undefined.md
|
|
5440
5451
|
*/
|
|
5441
5452
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
5442
5453
|
/**
|
|
5443
5454
|
* Disallow number literals with zero fractions or dangling dots.
|
|
5444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5455
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/no-zero-fractions.md
|
|
5445
5456
|
*/
|
|
5446
5457
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
5447
5458
|
/**
|
|
5448
5459
|
* Enforce proper case for numeric literals.
|
|
5449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5460
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/number-literal-case.md
|
|
5450
5461
|
*/
|
|
5451
5462
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
5452
5463
|
/**
|
|
5453
5464
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
5454
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5465
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/numeric-separators-style.md
|
|
5455
5466
|
*/
|
|
5456
5467
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
5457
5468
|
/**
|
|
5458
5469
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
5459
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-add-event-listener.md
|
|
5460
5471
|
*/
|
|
5461
5472
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
5462
5473
|
/**
|
|
5463
5474
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
5464
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-array-find.md
|
|
5465
5476
|
*/
|
|
5466
5477
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
5467
5478
|
/**
|
|
5468
5479
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
5469
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-array-flat.md
|
|
5470
5481
|
*/
|
|
5471
5482
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
5472
5483
|
/**
|
|
5473
5484
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
5474
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5485
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-array-flat-map.md
|
|
5475
5486
|
*/
|
|
5476
5487
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
5477
5488
|
/**
|
|
5478
5489
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
5479
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5490
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-array-index-of.md
|
|
5480
5491
|
*/
|
|
5481
5492
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
5482
5493
|
/**
|
|
5483
5494
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
5484
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5495
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-array-some.md
|
|
5485
5496
|
*/
|
|
5486
5497
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
5487
5498
|
/**
|
|
5488
5499
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
5489
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5500
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-at.md
|
|
5490
5501
|
*/
|
|
5491
5502
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
5503
|
+
/**
|
|
5504
|
+
* Prefer `BigInt` literals over the constructor.
|
|
5505
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-bigint-literals.md
|
|
5506
|
+
*/
|
|
5507
|
+
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
5492
5508
|
/**
|
|
5493
5509
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
5494
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5510
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
5495
5511
|
*/
|
|
5496
5512
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
5497
5513
|
/**
|
|
5498
5514
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
5499
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5515
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-class-fields.md
|
|
5500
5516
|
*/
|
|
5501
5517
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
5518
|
+
/**
|
|
5519
|
+
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
5520
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-classlist-toggle.md
|
|
5521
|
+
*/
|
|
5522
|
+
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
5502
5523
|
/**
|
|
5503
5524
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
5504
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5525
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-code-point.md
|
|
5505
5526
|
*/
|
|
5506
5527
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
5507
5528
|
/**
|
|
5508
5529
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
5509
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5530
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-date-now.md
|
|
5510
5531
|
*/
|
|
5511
5532
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
5512
5533
|
/**
|
|
5513
5534
|
* Prefer default parameters over reassignment.
|
|
5514
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5535
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-default-parameters.md
|
|
5515
5536
|
*/
|
|
5516
5537
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
5517
5538
|
/**
|
|
5518
5539
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
5519
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5540
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-dom-node-append.md
|
|
5520
5541
|
*/
|
|
5521
5542
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
5522
5543
|
/**
|
|
5523
5544
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
5524
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5545
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
5525
5546
|
*/
|
|
5526
5547
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
5527
5548
|
/**
|
|
5528
5549
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
5529
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5550
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-dom-node-remove.md
|
|
5530
5551
|
*/
|
|
5531
5552
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
5532
5553
|
/**
|
|
5533
5554
|
* Prefer `.textContent` over `.innerText`.
|
|
5534
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5555
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
5535
5556
|
*/
|
|
5536
5557
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
5537
5558
|
/**
|
|
5538
5559
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
5539
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5560
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-event-target.md
|
|
5540
5561
|
*/
|
|
5541
5562
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
5542
5563
|
/**
|
|
5543
5564
|
* Prefer `export…from` when re-exporting.
|
|
5544
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5565
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-export-from.md
|
|
5545
5566
|
*/
|
|
5546
5567
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
5547
5568
|
/**
|
|
5548
5569
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
5549
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5570
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-global-this.md
|
|
5550
5571
|
*/
|
|
5551
5572
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
5552
5573
|
/**
|
|
5553
5574
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
5554
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5575
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-import-meta-properties.md
|
|
5555
5576
|
*/
|
|
5556
5577
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
5557
5578
|
/**
|
|
5558
5579
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
5559
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5580
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-includes.md
|
|
5560
5581
|
*/
|
|
5561
5582
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
5562
5583
|
/**
|
|
5563
5584
|
* Prefer reading a JSON file as a buffer.
|
|
5564
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5585
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
5565
5586
|
*/
|
|
5566
5587
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
5567
5588
|
/**
|
|
5568
5589
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
5569
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5590
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
5570
5591
|
*/
|
|
5571
5592
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
5572
5593
|
/**
|
|
5573
5594
|
* Prefer using a logical operator over a ternary.
|
|
5574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5595
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
5575
5596
|
*/
|
|
5576
5597
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
5577
5598
|
/**
|
|
5578
5599
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
5579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5600
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-math-min-max.md
|
|
5580
5601
|
*/
|
|
5581
5602
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5582
5603
|
/**
|
|
5583
5604
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
5584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5605
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-math-trunc.md
|
|
5585
5606
|
*/
|
|
5586
5607
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
5587
5608
|
/**
|
|
5588
5609
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
5589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5610
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
5590
5611
|
*/
|
|
5591
5612
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
5592
5613
|
/**
|
|
5593
5614
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
5594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5615
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-modern-math-apis.md
|
|
5595
5616
|
*/
|
|
5596
5617
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
5597
5618
|
/**
|
|
5598
5619
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
5599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5620
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-module.md
|
|
5600
5621
|
*/
|
|
5601
5622
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
5602
5623
|
/**
|
|
5603
5624
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
5604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5625
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
5605
5626
|
*/
|
|
5606
5627
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
5607
5628
|
/**
|
|
5608
5629
|
* Prefer negative index over `.length - index` when possible.
|
|
5609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5630
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-negative-index.md
|
|
5610
5631
|
*/
|
|
5611
5632
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
5612
5633
|
/**
|
|
5613
5634
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
5614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5635
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-node-protocol.md
|
|
5615
5636
|
*/
|
|
5616
5637
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
5617
5638
|
/**
|
|
5618
5639
|
* Prefer `Number` static properties over global ones.
|
|
5619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-number-properties.md
|
|
5620
5641
|
*/
|
|
5621
5642
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
5622
5643
|
/**
|
|
5623
5644
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
5624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-object-from-entries.md
|
|
5625
5646
|
*/
|
|
5626
5647
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
5627
5648
|
/**
|
|
5628
5649
|
* Prefer omitting the `catch` binding parameter.
|
|
5629
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
5630
5651
|
*/
|
|
5631
5652
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
5632
5653
|
/**
|
|
5633
5654
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
5634
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-prototype-methods.md
|
|
5635
5656
|
*/
|
|
5636
5657
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
5637
5658
|
/**
|
|
5638
5659
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
5639
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-query-selector.md
|
|
5640
5661
|
*/
|
|
5641
5662
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
5642
5663
|
/**
|
|
5643
5664
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
5644
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-reflect-apply.md
|
|
5645
5666
|
*/
|
|
5646
5667
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
5647
5668
|
/**
|
|
5648
5669
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
5649
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-regexp-test.md
|
|
5650
5671
|
*/
|
|
5651
5672
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
5652
5673
|
/**
|
|
5653
5674
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
5654
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-set-has.md
|
|
5655
5676
|
*/
|
|
5656
5677
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
5657
5678
|
/**
|
|
5658
5679
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
5659
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-set-size.md
|
|
5660
5681
|
*/
|
|
5661
5682
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
5662
5683
|
/**
|
|
5663
5684
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
5664
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-single-call.md
|
|
5665
5686
|
*/
|
|
5666
5687
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
5667
5688
|
/**
|
|
5668
5689
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
5669
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-spread.md
|
|
5670
5691
|
*/
|
|
5671
5692
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
5672
5693
|
/**
|
|
5673
5694
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
5674
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-string-raw.md
|
|
5675
5696
|
*/
|
|
5676
5697
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
5677
5698
|
/**
|
|
5678
5699
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
5679
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-string-replace-all.md
|
|
5680
5701
|
*/
|
|
5681
5702
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
5682
5703
|
/**
|
|
5683
5704
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
5684
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-string-slice.md
|
|
5685
5706
|
*/
|
|
5686
5707
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
5687
5708
|
/**
|
|
5688
5709
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
5689
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
5690
5711
|
*/
|
|
5691
5712
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
5692
5713
|
/**
|
|
5693
5714
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
5694
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
5695
5716
|
*/
|
|
5696
5717
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
5697
5718
|
/**
|
|
5698
5719
|
* Prefer using `structuredClone` to create a deep clone.
|
|
5699
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-structured-clone.md
|
|
5700
5721
|
*/
|
|
5701
5722
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
5702
5723
|
/**
|
|
5703
5724
|
* Prefer `switch` over multiple `else-if`.
|
|
5704
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-switch.md
|
|
5705
5726
|
*/
|
|
5706
5727
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
5707
5728
|
/**
|
|
5708
5729
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
5709
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-ternary.md
|
|
5710
5731
|
*/
|
|
5711
5732
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
5712
5733
|
/**
|
|
5713
5734
|
* Prefer top-level await over top-level promises and async function calls.
|
|
5714
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-top-level-await.md
|
|
5715
5736
|
*/
|
|
5716
5737
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
5717
5738
|
/**
|
|
5718
5739
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
5719
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prefer-type-error.md
|
|
5720
5741
|
*/
|
|
5721
5742
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
5722
5743
|
/**
|
|
5723
5744
|
* Prevent abbreviations.
|
|
5724
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/prevent-abbreviations.md
|
|
5725
5746
|
*/
|
|
5726
5747
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
5727
5748
|
/**
|
|
5728
5749
|
* Enforce consistent relative URL style.
|
|
5729
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/relative-url-style.md
|
|
5730
5751
|
*/
|
|
5731
5752
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
5732
5753
|
/**
|
|
5733
5754
|
* Enforce using the separator argument with `Array#join()`.
|
|
5734
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/require-array-join-separator.md
|
|
5735
5756
|
*/
|
|
5736
5757
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
5758
|
+
/**
|
|
5759
|
+
* Require non-empty module attributes for imports and exports
|
|
5760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/require-module-attributes.md
|
|
5761
|
+
*/
|
|
5762
|
+
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
5737
5763
|
/**
|
|
5738
5764
|
* Require non-empty specifier list in import and export statements.
|
|
5739
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/require-module-specifiers.md
|
|
5740
5766
|
*/
|
|
5741
5767
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
5742
5768
|
/**
|
|
5743
5769
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
5744
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
5745
5771
|
*/
|
|
5746
5772
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
5747
5773
|
/**
|
|
5748
5774
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
5749
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/require-post-message-target-origin.md
|
|
5750
5776
|
*/
|
|
5751
5777
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
5752
5778
|
/**
|
|
5753
5779
|
* Enforce better string content.
|
|
5754
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/string-content.md
|
|
5755
5781
|
*/
|
|
5756
5782
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
5757
5783
|
/**
|
|
5758
5784
|
* Enforce consistent brace style for `case` clauses.
|
|
5759
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/switch-case-braces.md
|
|
5760
5786
|
*/
|
|
5761
5787
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
5762
5788
|
/**
|
|
5763
5789
|
* Fix whitespace-insensitive template indentation.
|
|
5764
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/template-indent.md
|
|
5765
5791
|
*/
|
|
5766
5792
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
5767
5793
|
/**
|
|
5768
5794
|
* Enforce consistent case for text encoding identifiers.
|
|
5769
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/text-encoding-identifier-case.md
|
|
5770
5796
|
*/
|
|
5771
5797
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>;
|
|
5772
5798
|
/**
|
|
5773
5799
|
* Require `new` when creating an error.
|
|
5774
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.0/docs/rules/throw-new-error.md
|
|
5775
5801
|
*/
|
|
5776
5802
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
5777
5803
|
/**
|
|
@@ -8156,6 +8182,7 @@ type JsdocRequireReturnsType = [] | [{
|
|
|
8156
8182
|
}];
|
|
8157
8183
|
// ----- jsdoc/require-template -----
|
|
8158
8184
|
type JsdocRequireTemplate = [] | [{
|
|
8185
|
+
exemptedBy?: string[];
|
|
8159
8186
|
requireSeparateTemplates?: boolean;
|
|
8160
8187
|
}];
|
|
8161
8188
|
// ----- jsdoc/require-throws -----
|
|
@@ -11549,6 +11576,10 @@ type PreferReflect = [] | [{
|
|
|
11549
11576
|
type PreferRegexLiterals = [] | [{
|
|
11550
11577
|
disallowRedundantWrapping?: boolean;
|
|
11551
11578
|
}];
|
|
11579
|
+
// ----- preserve-caught-error -----
|
|
11580
|
+
type PreserveCaughtError = [] | [{
|
|
11581
|
+
requireCatchParameter?: boolean;
|
|
11582
|
+
}];
|
|
11552
11583
|
// ----- quote-props -----
|
|
11553
11584
|
type QuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
11554
11585
|
keywords?: boolean;
|
|
@@ -11575,8 +11606,6 @@ type ReactHooksExhaustiveDeps = [] | [{
|
|
|
11575
11606
|
// ----- react-naming-convention/component-name -----
|
|
11576
11607
|
type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
|
|
11577
11608
|
allowAllCaps?: boolean;
|
|
11578
|
-
allowLeadingUnderscore?: boolean;
|
|
11579
|
-
allowNamespace?: boolean;
|
|
11580
11609
|
excepts?: string[];
|
|
11581
11610
|
rule?: ("PascalCase" | "CONSTANT_CASE");
|
|
11582
11611
|
})];
|
|
@@ -11956,6 +11985,7 @@ type StylisticIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
11956
11985
|
const?: (number | ("first" | "off"));
|
|
11957
11986
|
using?: (number | ("first" | "off"));
|
|
11958
11987
|
});
|
|
11988
|
+
assignmentOperator?: (number | "off");
|
|
11959
11989
|
outerIIFEBody?: (number | "off");
|
|
11960
11990
|
MemberExpression?: (number | "off");
|
|
11961
11991
|
FunctionDeclaration?: {
|
|
@@ -12188,6 +12218,22 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12188
12218
|
before?: boolean;
|
|
12189
12219
|
after?: boolean;
|
|
12190
12220
|
};
|
|
12221
|
+
arguments?: {
|
|
12222
|
+
before?: boolean;
|
|
12223
|
+
after?: boolean;
|
|
12224
|
+
};
|
|
12225
|
+
as?: {
|
|
12226
|
+
before?: boolean;
|
|
12227
|
+
after?: boolean;
|
|
12228
|
+
};
|
|
12229
|
+
async?: {
|
|
12230
|
+
before?: boolean;
|
|
12231
|
+
after?: boolean;
|
|
12232
|
+
};
|
|
12233
|
+
await?: {
|
|
12234
|
+
before?: boolean;
|
|
12235
|
+
after?: boolean;
|
|
12236
|
+
};
|
|
12191
12237
|
boolean?: {
|
|
12192
12238
|
before?: boolean;
|
|
12193
12239
|
after?: boolean;
|
|
@@ -12252,6 +12298,10 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12252
12298
|
before?: boolean;
|
|
12253
12299
|
after?: boolean;
|
|
12254
12300
|
};
|
|
12301
|
+
eval?: {
|
|
12302
|
+
before?: boolean;
|
|
12303
|
+
after?: boolean;
|
|
12304
|
+
};
|
|
12255
12305
|
export?: {
|
|
12256
12306
|
before?: boolean;
|
|
12257
12307
|
after?: boolean;
|
|
@@ -12280,10 +12330,18 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12280
12330
|
before?: boolean;
|
|
12281
12331
|
after?: boolean;
|
|
12282
12332
|
};
|
|
12333
|
+
from?: {
|
|
12334
|
+
before?: boolean;
|
|
12335
|
+
after?: boolean;
|
|
12336
|
+
};
|
|
12283
12337
|
function?: {
|
|
12284
12338
|
before?: boolean;
|
|
12285
12339
|
after?: boolean;
|
|
12286
12340
|
};
|
|
12341
|
+
get?: {
|
|
12342
|
+
before?: boolean;
|
|
12343
|
+
after?: boolean;
|
|
12344
|
+
};
|
|
12287
12345
|
goto?: {
|
|
12288
12346
|
before?: boolean;
|
|
12289
12347
|
after?: boolean;
|
|
@@ -12316,6 +12374,10 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12316
12374
|
before?: boolean;
|
|
12317
12375
|
after?: boolean;
|
|
12318
12376
|
};
|
|
12377
|
+
let?: {
|
|
12378
|
+
before?: boolean;
|
|
12379
|
+
after?: boolean;
|
|
12380
|
+
};
|
|
12319
12381
|
long?: {
|
|
12320
12382
|
before?: boolean;
|
|
12321
12383
|
after?: boolean;
|
|
@@ -12332,6 +12394,10 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12332
12394
|
before?: boolean;
|
|
12333
12395
|
after?: boolean;
|
|
12334
12396
|
};
|
|
12397
|
+
of?: {
|
|
12398
|
+
before?: boolean;
|
|
12399
|
+
after?: boolean;
|
|
12400
|
+
};
|
|
12335
12401
|
package?: {
|
|
12336
12402
|
before?: boolean;
|
|
12337
12403
|
after?: boolean;
|
|
@@ -12352,6 +12418,10 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12352
12418
|
before?: boolean;
|
|
12353
12419
|
after?: boolean;
|
|
12354
12420
|
};
|
|
12421
|
+
set?: {
|
|
12422
|
+
before?: boolean;
|
|
12423
|
+
after?: boolean;
|
|
12424
|
+
};
|
|
12355
12425
|
short?: {
|
|
12356
12426
|
before?: boolean;
|
|
12357
12427
|
after?: boolean;
|
|
@@ -12396,59 +12466,43 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12396
12466
|
before?: boolean;
|
|
12397
12467
|
after?: boolean;
|
|
12398
12468
|
};
|
|
12399
|
-
|
|
12400
|
-
before?: boolean;
|
|
12401
|
-
after?: boolean;
|
|
12402
|
-
};
|
|
12403
|
-
var?: {
|
|
12404
|
-
before?: boolean;
|
|
12405
|
-
after?: boolean;
|
|
12406
|
-
};
|
|
12407
|
-
void?: {
|
|
12408
|
-
before?: boolean;
|
|
12409
|
-
after?: boolean;
|
|
12410
|
-
};
|
|
12411
|
-
volatile?: {
|
|
12412
|
-
before?: boolean;
|
|
12413
|
-
after?: boolean;
|
|
12414
|
-
};
|
|
12415
|
-
while?: {
|
|
12469
|
+
type?: {
|
|
12416
12470
|
before?: boolean;
|
|
12417
12471
|
after?: boolean;
|
|
12418
12472
|
};
|
|
12419
|
-
|
|
12473
|
+
typeof?: {
|
|
12420
12474
|
before?: boolean;
|
|
12421
12475
|
after?: boolean;
|
|
12422
12476
|
};
|
|
12423
|
-
|
|
12477
|
+
using?: {
|
|
12424
12478
|
before?: boolean;
|
|
12425
12479
|
after?: boolean;
|
|
12426
12480
|
};
|
|
12427
|
-
|
|
12481
|
+
var?: {
|
|
12428
12482
|
before?: boolean;
|
|
12429
12483
|
after?: boolean;
|
|
12430
12484
|
};
|
|
12431
|
-
|
|
12485
|
+
void?: {
|
|
12432
12486
|
before?: boolean;
|
|
12433
12487
|
after?: boolean;
|
|
12434
12488
|
};
|
|
12435
|
-
|
|
12489
|
+
volatile?: {
|
|
12436
12490
|
before?: boolean;
|
|
12437
12491
|
after?: boolean;
|
|
12438
12492
|
};
|
|
12439
|
-
|
|
12493
|
+
while?: {
|
|
12440
12494
|
before?: boolean;
|
|
12441
12495
|
after?: boolean;
|
|
12442
12496
|
};
|
|
12443
|
-
|
|
12497
|
+
with?: {
|
|
12444
12498
|
before?: boolean;
|
|
12445
12499
|
after?: boolean;
|
|
12446
12500
|
};
|
|
12447
|
-
|
|
12501
|
+
yield?: {
|
|
12448
12502
|
before?: boolean;
|
|
12449
12503
|
after?: boolean;
|
|
12450
12504
|
};
|
|
12451
|
-
|
|
12505
|
+
accessor?: {
|
|
12452
12506
|
before?: boolean;
|
|
12453
12507
|
after?: boolean;
|
|
12454
12508
|
};
|
|
@@ -12456,22 +12510,6 @@ type StylisticKeywordSpacing = [] | [{
|
|
|
12456
12510
|
before?: boolean;
|
|
12457
12511
|
after?: boolean;
|
|
12458
12512
|
};
|
|
12459
|
-
set?: {
|
|
12460
|
-
before?: boolean;
|
|
12461
|
-
after?: boolean;
|
|
12462
|
-
};
|
|
12463
|
-
using?: {
|
|
12464
|
-
before?: boolean;
|
|
12465
|
-
after?: boolean;
|
|
12466
|
-
};
|
|
12467
|
-
yield?: {
|
|
12468
|
-
before?: boolean;
|
|
12469
|
-
after?: boolean;
|
|
12470
|
-
};
|
|
12471
|
-
type?: {
|
|
12472
|
-
before?: boolean;
|
|
12473
|
-
after?: boolean;
|
|
12474
|
-
};
|
|
12475
12513
|
};
|
|
12476
12514
|
}];
|
|
12477
12515
|
// ----- stylistic/line-comment-position -----
|
|
@@ -12671,6 +12709,7 @@ type StylisticNoExtraParens = ([] | ["functions"] | [] | ["all"] | ["all", {
|
|
|
12671
12709
|
LogicalExpression?: boolean;
|
|
12672
12710
|
AwaitExpression?: boolean;
|
|
12673
12711
|
};
|
|
12712
|
+
ignoredNodes?: string[];
|
|
12674
12713
|
}]);
|
|
12675
12714
|
// ----- stylistic/no-mixed-operators -----
|
|
12676
12715
|
type StylisticNoMixedOperators = [] | [{
|
|
@@ -12786,7 +12825,7 @@ type StylisticPaddedBlocks = [] | [(("always" | "never" | "start" | "end") | {
|
|
|
12786
12825
|
// ----- stylistic/padding-line-between-statements -----
|
|
12787
12826
|
type _StylisticPaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always");
|
|
12788
12827
|
type _StylisticPaddingLineBetweenStatementsStatementOption = (_StylisticPaddingLineBetweenStatementsStatementType | [_StylisticPaddingLineBetweenStatementsStatementType, ...(_StylisticPaddingLineBetweenStatementsStatementType)[]]);
|
|
12789
|
-
type _StylisticPaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "
|
|
12828
|
+
type _StylisticPaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "return" | "singleline-return" | "multiline-return" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using" | "type" | "singleline-type" | "multiline-type");
|
|
12790
12829
|
type StylisticPaddingLineBetweenStatements = {
|
|
12791
12830
|
blankLine: _StylisticPaddingLineBetweenStatementsPaddingType;
|
|
12792
12831
|
prev: _StylisticPaddingLineBetweenStatementsStatementOption;
|
|
@@ -14603,6 +14642,10 @@ type UnicornNoArrayReduce = [] | [{
|
|
|
14603
14642
|
type UnicornNoArrayReverse = [] | [{
|
|
14604
14643
|
allowExpressionStatement?: boolean;
|
|
14605
14644
|
}];
|
|
14645
|
+
// ----- unicorn/no-array-sort -----
|
|
14646
|
+
type UnicornNoArraySort = [] | [{
|
|
14647
|
+
allowExpressionStatement?: boolean;
|
|
14648
|
+
}];
|
|
14606
14649
|
// ----- unicorn/no-instanceof-builtins -----
|
|
14607
14650
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
14608
14651
|
useErrorIsError?: boolean;
|