@pengzhanbo/eslint-config 2.5.0 → 2.6.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/index.d.mts +393 -180
- package/dist/index.mjs +6 -2
- package/package.json +18 -18
package/dist/index.d.mts
CHANGED
|
@@ -270,12 +270,6 @@ interface RuleOptions {
|
|
|
270
270
|
* @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-attribute-decorator.md
|
|
271
271
|
*/
|
|
272
272
|
'angular/no-attribute-decorator'?: Linter.RuleEntry<[]>;
|
|
273
|
-
/**
|
|
274
|
-
* Ensures that directives do not implement conflicting lifecycle interfaces.
|
|
275
|
-
* @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-conflicting-lifecycle.md
|
|
276
|
-
* @deprecated
|
|
277
|
-
*/
|
|
278
|
-
'angular/no-conflicting-lifecycle'?: Linter.RuleEntry<[]>;
|
|
279
273
|
/**
|
|
280
274
|
* Disallow using code which is marked as developer preview
|
|
281
275
|
* @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/no-developer-preview.md
|
|
@@ -377,7 +371,7 @@ interface RuleOptions {
|
|
|
377
371
|
*/
|
|
378
372
|
'angular/prefer-inject'?: Linter.RuleEntry<[]>;
|
|
379
373
|
/**
|
|
380
|
-
* Ensures
|
|
374
|
+
* Ensures components do not opt out of the default `ChangeDetectionStrategy.OnPush` change detection strategy
|
|
381
375
|
* @see https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-on-push-component-change-detection.md
|
|
382
376
|
*/
|
|
383
377
|
'angular/prefer-on-push-component-change-detection'?: Linter.RuleEntry<[]>;
|
|
@@ -7077,753 +7071,921 @@ interface RuleOptions {
|
|
|
7077
7071
|
*/
|
|
7078
7072
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
7079
7073
|
/**
|
|
7080
|
-
*
|
|
7081
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7074
|
+
* Prefer better DOM traversal APIs.
|
|
7075
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/better-dom-traversing.md
|
|
7076
|
+
*/
|
|
7077
|
+
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
7078
|
+
/**
|
|
7079
|
+
* Removed. Prefer `eslint-plugin-regexp`
|
|
7080
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#better-regex
|
|
7081
|
+
* @deprecated
|
|
7082
7082
|
*/
|
|
7083
|
-
'unicorn/better-regex'?: Linter.RuleEntry<
|
|
7083
|
+
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
7084
7084
|
/**
|
|
7085
7085
|
* Enforce a specific parameter name in catch clauses.
|
|
7086
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7086
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/catch-error-name.md
|
|
7087
7087
|
*/
|
|
7088
7088
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
7089
7089
|
/**
|
|
7090
7090
|
* Enforce consistent assertion style with `node:assert`.
|
|
7091
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7091
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-assert.md
|
|
7092
7092
|
*/
|
|
7093
7093
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
7094
|
+
/**
|
|
7095
|
+
* Enforce consistent spelling of compound words in identifiers.
|
|
7096
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-compound-words.md
|
|
7097
|
+
*/
|
|
7098
|
+
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
7094
7099
|
/**
|
|
7095
7100
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
7096
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7101
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-date-clone.md
|
|
7097
7102
|
*/
|
|
7098
7103
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
7099
7104
|
/**
|
|
7100
7105
|
* Use destructured variables over properties.
|
|
7101
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7106
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-destructuring.md
|
|
7102
7107
|
*/
|
|
7103
7108
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
7104
7109
|
/**
|
|
7105
7110
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
7106
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7111
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-empty-array-spread.md
|
|
7107
7112
|
*/
|
|
7108
7113
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
7109
7114
|
/**
|
|
7110
7115
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
7111
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7116
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-existence-index-check.md
|
|
7112
7117
|
*/
|
|
7113
7118
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
7114
7119
|
/**
|
|
7115
7120
|
* Move function definitions to the highest possible scope.
|
|
7116
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7121
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-function-scoping.md
|
|
7117
7122
|
*/
|
|
7118
7123
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
7124
|
+
/**
|
|
7125
|
+
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
7126
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-json-file-read.md
|
|
7127
|
+
*/
|
|
7128
|
+
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
7119
7129
|
/**
|
|
7120
7130
|
* Enforce consistent style for escaping `${` in template literals.
|
|
7121
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7131
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/consistent-template-literal-escape.md
|
|
7122
7132
|
*/
|
|
7123
7133
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
7124
7134
|
/**
|
|
7125
7135
|
* Enforce correct `Error` subclassing.
|
|
7126
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7136
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/custom-error-definition.md
|
|
7127
7137
|
*/
|
|
7128
7138
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
7139
|
+
/**
|
|
7140
|
+
* Enforce consistent style for DOM element dataset access.
|
|
7141
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/dom-node-dataset.md
|
|
7142
|
+
*/
|
|
7143
|
+
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
7129
7144
|
/**
|
|
7130
7145
|
* Enforce no spaces between braces.
|
|
7131
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7146
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/empty-brace-spaces.md
|
|
7132
7147
|
*/
|
|
7133
7148
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
7134
7149
|
/**
|
|
7135
7150
|
* Enforce passing a `message` value when creating a built-in error.
|
|
7136
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7151
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/error-message.md
|
|
7137
7152
|
*/
|
|
7138
7153
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
7139
7154
|
/**
|
|
7140
7155
|
* Require escape sequences to use uppercase or lowercase values.
|
|
7141
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7156
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/escape-case.md
|
|
7142
7157
|
*/
|
|
7143
7158
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
7144
7159
|
/**
|
|
7145
7160
|
* Add expiration conditions to TODO comments.
|
|
7146
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7161
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/expiring-todo-comments.md
|
|
7147
7162
|
*/
|
|
7148
7163
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
7149
7164
|
/**
|
|
7150
7165
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
7151
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7166
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/explicit-length-check.md
|
|
7152
7167
|
*/
|
|
7153
7168
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
7154
7169
|
/**
|
|
7155
|
-
* Enforce a case style for filenames.
|
|
7156
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7170
|
+
* Enforce a case style for filenames and directory names.
|
|
7171
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/filename-case.md
|
|
7157
7172
|
*/
|
|
7158
7173
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
7159
7174
|
/**
|
|
7160
7175
|
* Enforce specific import styles per module.
|
|
7161
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7176
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/import-style.md
|
|
7162
7177
|
*/
|
|
7163
7178
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
7164
7179
|
/**
|
|
7165
7180
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
7166
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7181
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/isolated-functions.md
|
|
7167
7182
|
*/
|
|
7168
7183
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
7169
7184
|
/**
|
|
7170
7185
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
7171
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7186
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/new-for-builtins.md
|
|
7172
7187
|
*/
|
|
7173
7188
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
7174
7189
|
/**
|
|
7175
7190
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
7176
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7191
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
7177
7192
|
*/
|
|
7178
7193
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
7179
7194
|
/**
|
|
7180
7195
|
* Disallow recursive access to `this` within getters and setters.
|
|
7181
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-accessor-recursion.md
|
|
7182
7197
|
*/
|
|
7183
7198
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
7184
7199
|
/**
|
|
7185
7200
|
* Disallow anonymous functions and classes as the default export.
|
|
7186
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-anonymous-default-export.md
|
|
7187
7202
|
*/
|
|
7188
7203
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
7189
7204
|
/**
|
|
7190
7205
|
* Prevent passing a function reference directly to iterator methods.
|
|
7191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-callback-reference.md
|
|
7207
|
+
*/
|
|
7208
|
+
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
7209
|
+
/**
|
|
7210
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
7211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-fill-with-reference-type.md
|
|
7192
7212
|
*/
|
|
7193
|
-
'unicorn/no-array-
|
|
7213
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
7194
7214
|
/**
|
|
7195
7215
|
* Prefer `for…of` over the `forEach` method.
|
|
7196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-for-each.md
|
|
7197
7217
|
*/
|
|
7198
7218
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
7219
|
+
/**
|
|
7220
|
+
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
7221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-from-fill.md
|
|
7222
|
+
*/
|
|
7223
|
+
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
7199
7224
|
/**
|
|
7200
7225
|
* Disallow using the `this` argument in array methods.
|
|
7201
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-method-this-argument.md
|
|
7202
7227
|
*/
|
|
7203
7228
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
7204
7229
|
/**
|
|
7205
7230
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
7206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
7207
7232
|
* @deprecated
|
|
7208
7233
|
*/
|
|
7209
7234
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
7210
7235
|
/**
|
|
7211
7236
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
7212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7237
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-reduce.md
|
|
7213
7238
|
*/
|
|
7214
7239
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
7215
7240
|
/**
|
|
7216
7241
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
7217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7242
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-reverse.md
|
|
7218
7243
|
*/
|
|
7219
7244
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
7220
7245
|
/**
|
|
7221
7246
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
7222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7247
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-array-sort.md
|
|
7223
7248
|
*/
|
|
7224
7249
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
7225
7250
|
/**
|
|
7226
7251
|
* Disallow member access from await expression.
|
|
7227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-await-expression-member.md
|
|
7228
7253
|
*/
|
|
7229
7254
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
7230
7255
|
/**
|
|
7231
7256
|
* Disallow using `await` in `Promise` method parameters.
|
|
7232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-await-in-promise-methods.md
|
|
7233
7258
|
*/
|
|
7234
7259
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
7260
|
+
/**
|
|
7261
|
+
* Disallow unnecessary `Blob` to `File` conversion.
|
|
7262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-blob-to-file.md
|
|
7263
|
+
*/
|
|
7264
|
+
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
7265
|
+
/**
|
|
7266
|
+
* Prefer drawing canvases directly instead of converting them to images.
|
|
7267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-canvas-to-image.md
|
|
7268
|
+
*/
|
|
7269
|
+
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
7270
|
+
/**
|
|
7271
|
+
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
7272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-confusing-array-splice.md
|
|
7273
|
+
*/
|
|
7274
|
+
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
7235
7275
|
/**
|
|
7236
7276
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
7237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-console-spaces.md
|
|
7238
7278
|
*/
|
|
7239
7279
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
7240
7280
|
/**
|
|
7241
7281
|
* Do not use `document.cookie` directly.
|
|
7242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-document-cookie.md
|
|
7243
7283
|
*/
|
|
7244
7284
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
7285
|
+
/**
|
|
7286
|
+
* Disallow duplicate values in `Set` constructor array literals.
|
|
7287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-duplicate-set-values.md
|
|
7288
|
+
*/
|
|
7289
|
+
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
7245
7290
|
/**
|
|
7246
7291
|
* Disallow empty files.
|
|
7247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-empty-file.md
|
|
7248
7293
|
*/
|
|
7249
|
-
'unicorn/no-empty-file'?: Linter.RuleEntry<
|
|
7294
|
+
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
7295
|
+
/**
|
|
7296
|
+
* Disallow exports in scripts.
|
|
7297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-exports-in-scripts.md
|
|
7298
|
+
*/
|
|
7299
|
+
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
7250
7300
|
/**
|
|
7251
7301
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
7252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7302
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-for-loop.md
|
|
7253
7303
|
*/
|
|
7254
7304
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
7255
7305
|
/**
|
|
7256
7306
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
7257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7307
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-hex-escape.md
|
|
7258
7308
|
*/
|
|
7259
7309
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
7260
7310
|
/**
|
|
7261
7311
|
* Disallow immediate mutation after variable assignment.
|
|
7262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7312
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-immediate-mutation.md
|
|
7263
7313
|
*/
|
|
7264
7314
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
7315
|
+
/**
|
|
7316
|
+
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
7317
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-incorrect-query-selector.md
|
|
7318
|
+
*/
|
|
7319
|
+
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
7265
7320
|
/**
|
|
7266
7321
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
7267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7322
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
7268
7323
|
* @deprecated
|
|
7269
7324
|
*/
|
|
7270
7325
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
7271
7326
|
/**
|
|
7272
7327
|
* Disallow `instanceof` with built-in objects
|
|
7273
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7328
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-instanceof-builtins.md
|
|
7274
7329
|
*/
|
|
7275
7330
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
7276
7331
|
/**
|
|
7277
7332
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
7278
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7333
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-invalid-fetch-options.md
|
|
7279
7334
|
*/
|
|
7280
7335
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
7336
|
+
/**
|
|
7337
|
+
* Disallow invalid `accept` values on file inputs.
|
|
7338
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-invalid-file-input-accept.md
|
|
7339
|
+
*/
|
|
7340
|
+
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
7281
7341
|
/**
|
|
7282
7342
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
7283
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7343
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
7284
7344
|
*/
|
|
7285
7345
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
7286
7346
|
/**
|
|
7287
7347
|
* Disallow identifiers starting with `new` or `class`.
|
|
7288
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7348
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-keyword-prefix.md
|
|
7289
7349
|
*/
|
|
7290
7350
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
7351
|
+
/**
|
|
7352
|
+
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
7353
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-late-current-target-access.md
|
|
7354
|
+
*/
|
|
7355
|
+
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
7291
7356
|
/**
|
|
7292
7357
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
7293
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7358
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
7294
7359
|
* @deprecated
|
|
7295
7360
|
*/
|
|
7296
7361
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
7297
7362
|
/**
|
|
7298
7363
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
7299
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7364
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-lonely-if.md
|
|
7300
7365
|
*/
|
|
7301
7366
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
7302
7367
|
/**
|
|
7303
7368
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
7304
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7369
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
7305
7370
|
*/
|
|
7306
7371
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
7372
|
+
/**
|
|
7373
|
+
* Disallow manually wrapped comments.
|
|
7374
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-manually-wrapped-comments.md
|
|
7375
|
+
*/
|
|
7376
|
+
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
7307
7377
|
/**
|
|
7308
7378
|
* Disallow named usage of default import and export.
|
|
7309
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7379
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-named-default.md
|
|
7310
7380
|
*/
|
|
7311
7381
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
7312
7382
|
/**
|
|
7313
7383
|
* Disallow negated conditions.
|
|
7314
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7384
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-negated-condition.md
|
|
7315
7385
|
*/
|
|
7316
7386
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
7317
7387
|
/**
|
|
7318
7388
|
* Disallow negated expression in equality check.
|
|
7319
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7389
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-negation-in-equality-check.md
|
|
7320
7390
|
*/
|
|
7321
7391
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
7322
7392
|
/**
|
|
7323
7393
|
* Disallow nested ternary expressions.
|
|
7324
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7394
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-nested-ternary.md
|
|
7325
7395
|
*/
|
|
7326
7396
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
7327
7397
|
/**
|
|
7328
7398
|
* Disallow `new Array()`.
|
|
7329
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7399
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-new-array.md
|
|
7330
7400
|
*/
|
|
7331
7401
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
7332
7402
|
/**
|
|
7333
7403
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
7334
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7404
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-new-buffer.md
|
|
7335
7405
|
*/
|
|
7336
7406
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
7337
7407
|
/**
|
|
7338
7408
|
* Disallow the use of the `null` literal.
|
|
7339
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7409
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-null.md
|
|
7340
7410
|
*/
|
|
7341
7411
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
7342
7412
|
/**
|
|
7343
7413
|
* Disallow the use of objects as default parameters.
|
|
7344
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7414
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-object-as-default-parameter.md
|
|
7345
7415
|
*/
|
|
7346
7416
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
7347
7417
|
/**
|
|
7348
7418
|
* Disallow `process.exit()`.
|
|
7349
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7419
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-process-exit.md
|
|
7350
7420
|
*/
|
|
7351
7421
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
7352
7422
|
/**
|
|
7353
7423
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
7354
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7424
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
7355
7425
|
*/
|
|
7356
7426
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
7357
7427
|
/**
|
|
7358
7428
|
* Disallow classes that only have static members.
|
|
7359
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7429
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-static-only-class.md
|
|
7360
7430
|
*/
|
|
7361
7431
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
7362
7432
|
/**
|
|
7363
7433
|
* Disallow `then` property.
|
|
7364
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7434
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-thenable.md
|
|
7365
7435
|
*/
|
|
7366
7436
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
7367
7437
|
/**
|
|
7368
7438
|
* Disallow assigning `this` to a variable.
|
|
7369
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7439
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-this-assignment.md
|
|
7370
7440
|
*/
|
|
7371
7441
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
7442
|
+
/**
|
|
7443
|
+
* Disallow `this` outside of classes.
|
|
7444
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-this-outside-of-class.md
|
|
7445
|
+
*/
|
|
7446
|
+
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
7372
7447
|
/**
|
|
7373
7448
|
* Disallow comparing `undefined` using `typeof`.
|
|
7374
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7449
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-typeof-undefined.md
|
|
7375
7450
|
*/
|
|
7376
7451
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
7377
7452
|
/**
|
|
7378
7453
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
7379
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7454
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
7380
7455
|
*/
|
|
7381
7456
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
7382
7457
|
/**
|
|
7383
7458
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
7384
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7459
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
7385
7460
|
*/
|
|
7386
7461
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
7387
7462
|
/**
|
|
7388
7463
|
* Disallow awaiting non-promise values.
|
|
7389
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7464
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-await.md
|
|
7390
7465
|
*/
|
|
7391
7466
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
7467
|
+
/**
|
|
7468
|
+
* Disallow unnecessary nested ternary expressions.
|
|
7469
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-nested-ternary.md
|
|
7470
|
+
*/
|
|
7471
|
+
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
7392
7472
|
/**
|
|
7393
7473
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
7394
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7474
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
7395
7475
|
*/
|
|
7396
7476
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
7397
7477
|
/**
|
|
7398
7478
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
7399
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7479
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
7400
7480
|
*/
|
|
7401
7481
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
7402
7482
|
/**
|
|
7403
7483
|
* Disallow unreadable array destructuring.
|
|
7404
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7484
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
7405
7485
|
*/
|
|
7406
7486
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
7407
7487
|
/**
|
|
7408
7488
|
* Disallow unreadable IIFEs.
|
|
7409
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7489
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unreadable-iife.md
|
|
7410
7490
|
*/
|
|
7411
7491
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
7492
|
+
/**
|
|
7493
|
+
* Disallow ignoring the return value of selected array methods.
|
|
7494
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unused-array-method-return.md
|
|
7495
|
+
*/
|
|
7496
|
+
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
7412
7497
|
/**
|
|
7413
7498
|
* Disallow unused object properties.
|
|
7414
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7499
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-unused-properties.md
|
|
7415
7500
|
*/
|
|
7416
7501
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
7417
7502
|
/**
|
|
7418
7503
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
7419
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7504
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-collection-argument.md
|
|
7420
7505
|
*/
|
|
7421
7506
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
7422
7507
|
/**
|
|
7423
7508
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
7424
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7509
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
7425
7510
|
*/
|
|
7426
7511
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
7427
7512
|
/**
|
|
7428
7513
|
* Disallow useless fallback when spreading in object literals.
|
|
7429
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7514
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
7430
7515
|
*/
|
|
7431
7516
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
7432
7517
|
/**
|
|
7433
7518
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
7434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7519
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
7435
7520
|
*/
|
|
7436
7521
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
7437
7522
|
/**
|
|
7438
7523
|
* Disallow useless array length check.
|
|
7439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7524
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-length-check.md
|
|
7440
7525
|
*/
|
|
7441
7526
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
7442
7527
|
/**
|
|
7443
7528
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
7444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7529
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
7445
7530
|
*/
|
|
7446
7531
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
7447
7532
|
/**
|
|
7448
7533
|
* Disallow unnecessary spread.
|
|
7449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7534
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-spread.md
|
|
7450
7535
|
*/
|
|
7451
7536
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
7452
7537
|
/**
|
|
7453
7538
|
* Disallow useless case in switch statements.
|
|
7454
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7539
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-switch-case.md
|
|
7455
7540
|
*/
|
|
7456
7541
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
7457
7542
|
/**
|
|
7458
7543
|
* Disallow useless `undefined`.
|
|
7459
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7544
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-useless-undefined.md
|
|
7460
7545
|
*/
|
|
7461
7546
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
7462
7547
|
/**
|
|
7463
7548
|
* Disallow number literals with zero fractions or dangling dots.
|
|
7464
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7549
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/no-zero-fractions.md
|
|
7465
7550
|
*/
|
|
7466
7551
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
7467
7552
|
/**
|
|
7468
7553
|
* Enforce proper case for numeric literals.
|
|
7469
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7554
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/number-literal-case.md
|
|
7470
7555
|
*/
|
|
7471
7556
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
7472
7557
|
/**
|
|
7473
7558
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
7474
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7559
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/numeric-separators-style.md
|
|
7475
7560
|
*/
|
|
7476
7561
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
7477
7562
|
/**
|
|
7478
7563
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
7479
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7564
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-add-event-listener.md
|
|
7480
7565
|
*/
|
|
7481
7566
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
7482
7567
|
/**
|
|
7483
7568
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
7484
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7569
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-find.md
|
|
7485
7570
|
*/
|
|
7486
7571
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
7487
7572
|
/**
|
|
7488
7573
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
7489
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7574
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-flat.md
|
|
7490
7575
|
*/
|
|
7491
7576
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
7492
7577
|
/**
|
|
7493
7578
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
7494
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7579
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-flat-map.md
|
|
7495
7580
|
*/
|
|
7496
7581
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
7497
7582
|
/**
|
|
7498
7583
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
7499
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7584
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-index-of.md
|
|
7500
7585
|
*/
|
|
7501
7586
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
7587
|
+
/**
|
|
7588
|
+
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
7589
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-last-methods.md
|
|
7590
|
+
*/
|
|
7591
|
+
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
7502
7592
|
/**
|
|
7503
7593
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
7504
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7594
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-array-some.md
|
|
7505
7595
|
*/
|
|
7506
7596
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
7507
7597
|
/**
|
|
7508
7598
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
7509
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7599
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-at.md
|
|
7510
7600
|
*/
|
|
7511
7601
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
7512
7602
|
/**
|
|
7513
7603
|
* Prefer `BigInt` literals over the constructor.
|
|
7514
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7604
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-bigint-literals.md
|
|
7515
7605
|
*/
|
|
7516
7606
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
7517
7607
|
/**
|
|
7518
7608
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
7519
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7609
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
7520
7610
|
*/
|
|
7521
7611
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
7522
7612
|
/**
|
|
7523
7613
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
7524
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7614
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-class-fields.md
|
|
7525
7615
|
*/
|
|
7526
7616
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
7527
7617
|
/**
|
|
7528
7618
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
7529
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7619
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-classlist-toggle.md
|
|
7530
7620
|
*/
|
|
7531
7621
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
7532
7622
|
/**
|
|
7533
7623
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
7534
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7624
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-code-point.md
|
|
7535
7625
|
*/
|
|
7536
7626
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
7537
7627
|
/**
|
|
7538
7628
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
7539
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7629
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-date-now.md
|
|
7540
7630
|
*/
|
|
7541
7631
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
7542
7632
|
/**
|
|
7543
7633
|
* Prefer default parameters over reassignment.
|
|
7544
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7634
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-default-parameters.md
|
|
7545
7635
|
*/
|
|
7546
7636
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
7547
7637
|
/**
|
|
7548
|
-
* Prefer `
|
|
7549
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7638
|
+
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
7639
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-dom-node-append.md
|
|
7550
7640
|
*/
|
|
7551
7641
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
7552
7642
|
/**
|
|
7553
|
-
*
|
|
7554
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7643
|
+
* Renamed to `unicorn/dom-node-dataset`.
|
|
7644
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
7645
|
+
* @deprecated
|
|
7555
7646
|
*/
|
|
7556
7647
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
7557
7648
|
/**
|
|
7558
7649
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
7559
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-dom-node-remove.md
|
|
7560
7651
|
*/
|
|
7561
7652
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
7562
7653
|
/**
|
|
7563
7654
|
* Prefer `.textContent` over `.innerText`.
|
|
7564
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
7565
7656
|
*/
|
|
7566
7657
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
7567
7658
|
/**
|
|
7568
7659
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
7569
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-event-target.md
|
|
7570
7661
|
*/
|
|
7571
7662
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
7572
7663
|
/**
|
|
7573
7664
|
* Prefer `export…from` when re-exporting.
|
|
7574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-export-from.md
|
|
7575
7666
|
*/
|
|
7576
7667
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
7668
|
+
/**
|
|
7669
|
+
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
7670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-get-or-insert-computed.md
|
|
7671
|
+
*/
|
|
7672
|
+
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
7577
7673
|
/**
|
|
7578
7674
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
7579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-global-this.md
|
|
7580
7676
|
*/
|
|
7581
7677
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
7678
|
+
/**
|
|
7679
|
+
* Prefer HTTPS over HTTP.
|
|
7680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-https.md
|
|
7681
|
+
*/
|
|
7682
|
+
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
7582
7683
|
/**
|
|
7583
7684
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
7584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-import-meta-properties.md
|
|
7585
7686
|
*/
|
|
7586
7687
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
7587
7688
|
/**
|
|
7588
7689
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
7589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-includes.md
|
|
7590
7691
|
*/
|
|
7591
7692
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
7592
7693
|
/**
|
|
7593
|
-
* Prefer
|
|
7594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7694
|
+
* Prefer `.includes()` over repeated equality comparisons.
|
|
7695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
7696
|
+
*/
|
|
7697
|
+
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
7698
|
+
/**
|
|
7699
|
+
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
7700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-iterator-concat.md
|
|
7701
|
+
*/
|
|
7702
|
+
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
7703
|
+
/**
|
|
7704
|
+
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
7705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-iterator-to-array-at-end.md
|
|
7706
|
+
*/
|
|
7707
|
+
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
7708
|
+
/**
|
|
7709
|
+
* Renamed to `unicorn/consistent-json-file-read`.
|
|
7710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
7711
|
+
* @deprecated
|
|
7595
7712
|
*/
|
|
7596
7713
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
7597
7714
|
/**
|
|
7598
|
-
* Prefer `KeyboardEvent#key` over
|
|
7599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7715
|
+
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
7716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
7600
7717
|
*/
|
|
7601
7718
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
7602
7719
|
/**
|
|
7603
7720
|
* Prefer using a logical operator over a ternary.
|
|
7604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
7605
7722
|
*/
|
|
7606
7723
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
7724
|
+
/**
|
|
7725
|
+
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
7726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-math-abs.md
|
|
7727
|
+
*/
|
|
7728
|
+
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
7607
7729
|
/**
|
|
7608
7730
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
7609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-math-min-max.md
|
|
7610
7732
|
*/
|
|
7611
7733
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
7612
7734
|
/**
|
|
7613
7735
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
7614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-math-trunc.md
|
|
7615
7737
|
*/
|
|
7616
7738
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
7617
7739
|
/**
|
|
7618
7740
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
7619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
7620
7742
|
*/
|
|
7621
7743
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
7622
7744
|
/**
|
|
7623
7745
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
7624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7746
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-modern-math-apis.md
|
|
7625
7747
|
*/
|
|
7626
7748
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
7627
7749
|
/**
|
|
7628
7750
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
7629
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7751
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-module.md
|
|
7630
7752
|
*/
|
|
7631
7753
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
7632
7754
|
/**
|
|
7633
7755
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
7634
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
7635
7757
|
*/
|
|
7636
7758
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
7637
7759
|
/**
|
|
7638
7760
|
* Prefer negative index over `.length - index` when possible.
|
|
7639
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-negative-index.md
|
|
7640
7762
|
*/
|
|
7641
7763
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
7642
7764
|
/**
|
|
7643
7765
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
7644
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7766
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-node-protocol.md
|
|
7645
7767
|
*/
|
|
7646
7768
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
7647
7769
|
/**
|
|
7648
7770
|
* Prefer `Number` static properties over global ones.
|
|
7649
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7771
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-number-properties.md
|
|
7650
7772
|
*/
|
|
7651
7773
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
7652
7774
|
/**
|
|
7653
7775
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
7654
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7776
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-object-from-entries.md
|
|
7655
7777
|
*/
|
|
7656
7778
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
7657
7779
|
/**
|
|
7658
7780
|
* Prefer omitting the `catch` binding parameter.
|
|
7659
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7781
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
7660
7782
|
*/
|
|
7661
7783
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
7662
7784
|
/**
|
|
7663
7785
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
7664
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7786
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-prototype-methods.md
|
|
7665
7787
|
*/
|
|
7666
7788
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
7667
7789
|
/**
|
|
7668
|
-
* Prefer `.querySelector()`
|
|
7669
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7790
|
+
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
7791
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-query-selector.md
|
|
7792
|
+
*/
|
|
7793
|
+
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
7794
|
+
/**
|
|
7795
|
+
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
7796
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-queue-microtask.md
|
|
7670
7797
|
*/
|
|
7671
|
-
'unicorn/prefer-
|
|
7798
|
+
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
7672
7799
|
/**
|
|
7673
7800
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
7674
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7801
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-reflect-apply.md
|
|
7675
7802
|
*/
|
|
7676
7803
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
7677
7804
|
/**
|
|
7678
7805
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
7679
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7806
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-regexp-test.md
|
|
7680
7807
|
*/
|
|
7681
7808
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
7682
7809
|
/**
|
|
7683
7810
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
7684
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7811
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-response-static-json.md
|
|
7685
7812
|
*/
|
|
7686
7813
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
7687
7814
|
/**
|
|
7688
7815
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
7689
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7816
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-set-has.md
|
|
7690
7817
|
*/
|
|
7691
|
-
'unicorn/prefer-set-has'?: Linter.RuleEntry<
|
|
7818
|
+
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
7692
7819
|
/**
|
|
7693
7820
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
7694
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7821
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-set-size.md
|
|
7695
7822
|
*/
|
|
7696
7823
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
7697
7824
|
/**
|
|
7698
7825
|
* Prefer simple conditions first in logical expressions.
|
|
7699
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7826
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-simple-condition-first.md
|
|
7700
7827
|
*/
|
|
7701
7828
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
7702
7829
|
/**
|
|
7703
|
-
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
7704
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7830
|
+
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
7831
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-single-call.md
|
|
7705
7832
|
*/
|
|
7706
7833
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
7834
|
+
/**
|
|
7835
|
+
* Prefer `String#split()` with a limit.
|
|
7836
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-split-limit.md
|
|
7837
|
+
*/
|
|
7838
|
+
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
7707
7839
|
/**
|
|
7708
7840
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
7709
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7841
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-spread.md
|
|
7710
7842
|
*/
|
|
7711
7843
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
7844
|
+
/**
|
|
7845
|
+
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
7846
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-match-all.md
|
|
7847
|
+
*/
|
|
7848
|
+
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
7849
|
+
/**
|
|
7850
|
+
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
7851
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-pad-start-end.md
|
|
7852
|
+
*/
|
|
7853
|
+
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
7712
7854
|
/**
|
|
7713
7855
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
7714
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7856
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-raw.md
|
|
7715
7857
|
*/
|
|
7716
7858
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
7717
7859
|
/**
|
|
7718
|
-
* Prefer `String#
|
|
7719
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7860
|
+
* Prefer `String#repeat()` for repeated whitespace.
|
|
7861
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-repeat.md
|
|
7862
|
+
*/
|
|
7863
|
+
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
7864
|
+
/**
|
|
7865
|
+
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
7866
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-replace-all.md
|
|
7720
7867
|
*/
|
|
7721
7868
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
7722
7869
|
/**
|
|
7723
7870
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
7724
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7871
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-slice.md
|
|
7725
7872
|
*/
|
|
7726
7873
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
7727
7874
|
/**
|
|
7728
7875
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
7729
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7876
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
7730
7877
|
*/
|
|
7731
7878
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
7732
7879
|
/**
|
|
7733
7880
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
7734
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7881
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
7735
7882
|
*/
|
|
7736
7883
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
7737
7884
|
/**
|
|
7738
7885
|
* Prefer using `structuredClone` to create a deep clone.
|
|
7739
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7886
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-structured-clone.md
|
|
7740
7887
|
*/
|
|
7741
7888
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
7742
7889
|
/**
|
|
7743
7890
|
* Prefer `switch` over multiple `else-if`.
|
|
7744
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7891
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-switch.md
|
|
7745
7892
|
*/
|
|
7746
7893
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
7747
7894
|
/**
|
|
7748
7895
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
7749
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7896
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-ternary.md
|
|
7750
7897
|
*/
|
|
7751
7898
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
7752
7899
|
/**
|
|
7753
7900
|
* Prefer top-level await over top-level promises and async function calls.
|
|
7754
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7901
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-top-level-await.md
|
|
7755
7902
|
*/
|
|
7756
7903
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
7757
7904
|
/**
|
|
7758
7905
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
7759
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7906
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prefer-type-error.md
|
|
7760
7907
|
*/
|
|
7761
7908
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
7762
7909
|
/**
|
|
7763
7910
|
* Prevent abbreviations.
|
|
7764
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7911
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/prevent-abbreviations.md
|
|
7765
7912
|
*/
|
|
7766
7913
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
7767
7914
|
/**
|
|
7768
7915
|
* Enforce consistent relative URL style.
|
|
7769
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7916
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/relative-url-style.md
|
|
7770
7917
|
*/
|
|
7771
7918
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
7772
7919
|
/**
|
|
7773
7920
|
* Enforce using the separator argument with `Array#join()`.
|
|
7774
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7921
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-array-join-separator.md
|
|
7775
7922
|
*/
|
|
7776
7923
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
7924
|
+
/**
|
|
7925
|
+
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
7926
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-css-escape.md
|
|
7927
|
+
*/
|
|
7928
|
+
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
7777
7929
|
/**
|
|
7778
7930
|
* Require non-empty module attributes for imports and exports
|
|
7779
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7931
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-module-attributes.md
|
|
7780
7932
|
*/
|
|
7781
7933
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
7782
7934
|
/**
|
|
7783
7935
|
* Require non-empty specifier list in import and export statements.
|
|
7784
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7936
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-module-specifiers.md
|
|
7785
7937
|
*/
|
|
7786
7938
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
7787
7939
|
/**
|
|
7788
7940
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
7789
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7941
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
7790
7942
|
*/
|
|
7791
7943
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
7944
|
+
/**
|
|
7945
|
+
* Require passive event listeners for high-frequency events.
|
|
7946
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-passive-events.md
|
|
7947
|
+
*/
|
|
7948
|
+
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
7792
7949
|
/**
|
|
7793
7950
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
7794
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7951
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/require-post-message-target-origin.md
|
|
7795
7952
|
*/
|
|
7796
7953
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
7797
7954
|
/**
|
|
7798
7955
|
* Enforce better string content.
|
|
7799
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7956
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/string-content.md
|
|
7800
7957
|
*/
|
|
7801
7958
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
7802
7959
|
/**
|
|
7803
7960
|
* Enforce consistent brace style for `case` clauses.
|
|
7804
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7961
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/switch-case-braces.md
|
|
7805
7962
|
*/
|
|
7806
7963
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
7807
7964
|
/**
|
|
7808
7965
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
7809
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7966
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/switch-case-break-position.md
|
|
7810
7967
|
*/
|
|
7811
7968
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
7812
7969
|
/**
|
|
7813
7970
|
* Fix whitespace-insensitive template indentation.
|
|
7814
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7971
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/template-indent.md
|
|
7815
7972
|
*/
|
|
7816
7973
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
7817
7974
|
/**
|
|
7818
7975
|
* Enforce consistent case for text encoding identifiers.
|
|
7819
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7976
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/text-encoding-identifier-case.md
|
|
7820
7977
|
*/
|
|
7821
7978
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
7822
7979
|
/**
|
|
7823
7980
|
* Require `new` when creating an error.
|
|
7824
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7981
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/throw-new-error.md
|
|
7825
7982
|
*/
|
|
7826
7983
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
7984
|
+
/**
|
|
7985
|
+
* Limit the complexity of `try` blocks.
|
|
7986
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.0/docs/rules/try-complexity.md
|
|
7987
|
+
*/
|
|
7988
|
+
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
7827
7989
|
/**
|
|
7828
7990
|
* Utilities in UnoCSS blocklist
|
|
7829
7991
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
@@ -17513,23 +17675,40 @@ type TsUnifiedSignatures = [] | [{
|
|
|
17513
17675
|
ignoreDifferentlyNamedParameters?: boolean;
|
|
17514
17676
|
ignoreOverloadsWithDifferentJSDoc?: boolean;
|
|
17515
17677
|
}]; // ----- unicode-bom -----
|
|
17516
|
-
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/
|
|
17517
|
-
type UnicornBetterRegex = [] | [{
|
|
17518
|
-
sortCharacterClasses?: boolean;
|
|
17519
|
-
}]; // ----- unicorn/catch-error-name -----
|
|
17678
|
+
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/catch-error-name -----
|
|
17520
17679
|
type UnicornCatchErrorName = [] | [{
|
|
17521
17680
|
name?: string;
|
|
17522
17681
|
ignore?: unknown[];
|
|
17523
|
-
}]; // ----- unicorn/consistent-
|
|
17682
|
+
}]; // ----- unicorn/consistent-compound-words -----
|
|
17683
|
+
type UnicornConsistentCompoundWords = [] | [{
|
|
17684
|
+
checkProperties?: boolean;
|
|
17685
|
+
checkVariables?: boolean;
|
|
17686
|
+
checkDefaultAndNamespaceImports?: (boolean | "internal");
|
|
17687
|
+
checkShorthandImports?: (boolean | "internal");
|
|
17688
|
+
checkShorthandProperties?: boolean;
|
|
17689
|
+
extendDefaultReplacements?: boolean;
|
|
17690
|
+
replacements?: _UnicornConsistentCompoundWords_Replacements;
|
|
17691
|
+
allowList?: _UnicornConsistentCompoundWords_TrueObject;
|
|
17692
|
+
}];
|
|
17693
|
+
interface _UnicornConsistentCompoundWords_Replacements {
|
|
17694
|
+
[k: string]: (false | string) | undefined;
|
|
17695
|
+
}
|
|
17696
|
+
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
17697
|
+
[k: string]: true | undefined;
|
|
17698
|
+
} // ----- unicorn/consistent-function-scoping -----
|
|
17524
17699
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
17525
17700
|
checkArrowFunctions?: boolean;
|
|
17701
|
+
}]; // ----- unicorn/consistent-json-file-read -----
|
|
17702
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/dom-node-dataset -----
|
|
17703
|
+
type UnicornDomNodeDataset = [] | [{
|
|
17704
|
+
preferAttributes?: boolean;
|
|
17526
17705
|
}]; // ----- unicorn/escape-case -----
|
|
17527
17706
|
type UnicornEscapeCase = [] | [("uppercase" | "lowercase")]; // ----- unicorn/expiring-todo-comments -----
|
|
17528
17707
|
type UnicornExpiringTodoComments = [] | [{
|
|
17529
17708
|
terms?: string[];
|
|
17530
17709
|
ignore?: unknown[];
|
|
17531
|
-
|
|
17532
|
-
|
|
17710
|
+
checkDates?: boolean;
|
|
17711
|
+
checkDatesOnPullRequests?: boolean;
|
|
17533
17712
|
allowWarningComments?: boolean;
|
|
17534
17713
|
date?: string;
|
|
17535
17714
|
}]; // ----- unicorn/explicit-length-check -----
|
|
@@ -17540,6 +17719,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
17540
17719
|
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
17541
17720
|
ignore?: unknown[];
|
|
17542
17721
|
multipleFileExtensions?: boolean;
|
|
17722
|
+
checkDirectories?: boolean;
|
|
17543
17723
|
} | {
|
|
17544
17724
|
cases?: {
|
|
17545
17725
|
camelCase?: boolean;
|
|
@@ -17549,6 +17729,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
17549
17729
|
};
|
|
17550
17730
|
ignore?: unknown[];
|
|
17551
17731
|
multipleFileExtensions?: boolean;
|
|
17732
|
+
checkDirectories?: boolean;
|
|
17552
17733
|
})]; // ----- unicorn/import-style -----
|
|
17553
17734
|
type UnicornImportStyle = [] | [{
|
|
17554
17735
|
checkImport?: boolean;
|
|
@@ -17572,6 +17753,9 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
17572
17753
|
functions?: string[];
|
|
17573
17754
|
selectors?: string[];
|
|
17574
17755
|
comments?: string[];
|
|
17756
|
+
}]; // ----- unicorn/no-array-callback-reference -----
|
|
17757
|
+
type UnicornNoArrayCallbackReference = [] | [{
|
|
17758
|
+
ignore?: string[];
|
|
17575
17759
|
}]; // ----- unicorn/no-array-reduce -----
|
|
17576
17760
|
type UnicornNoArrayReduce = [] | [{
|
|
17577
17761
|
allowSimpleOperations?: boolean;
|
|
@@ -17581,6 +17765,9 @@ type UnicornNoArrayReverse = [] | [{
|
|
|
17581
17765
|
}]; // ----- unicorn/no-array-sort -----
|
|
17582
17766
|
type UnicornNoArraySort = [] | [{
|
|
17583
17767
|
allowExpressionStatement?: boolean;
|
|
17768
|
+
}]; // ----- unicorn/no-empty-file -----
|
|
17769
|
+
type UnicornNoEmptyFile = [] | [{
|
|
17770
|
+
allowComments?: boolean;
|
|
17584
17771
|
}]; // ----- unicorn/no-instanceof-builtins -----
|
|
17585
17772
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
17586
17773
|
useErrorIsError?: boolean;
|
|
@@ -17594,13 +17781,14 @@ type UnicornNoKeywordPrefix = [] | [{
|
|
|
17594
17781
|
onlyCamelCase?: boolean;
|
|
17595
17782
|
}]; // ----- unicorn/no-null -----
|
|
17596
17783
|
type UnicornNoNull = [] | [{
|
|
17784
|
+
checkArguments?: boolean;
|
|
17597
17785
|
checkStrictEquality?: boolean;
|
|
17598
17786
|
}]; // ----- unicorn/no-typeof-undefined -----
|
|
17599
17787
|
type UnicornNoTypeofUndefined = [] | [{
|
|
17600
17788
|
checkGlobalVariables?: boolean;
|
|
17601
17789
|
}]; // ----- unicorn/no-unnecessary-polyfills -----
|
|
17602
17790
|
type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
17603
|
-
targets
|
|
17791
|
+
targets?: (string | unknown[] | {
|
|
17604
17792
|
[k: string]: unknown | undefined;
|
|
17605
17793
|
});
|
|
17606
17794
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
@@ -17631,6 +17819,7 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
17631
17819
|
onlyIfContainsSeparator?: boolean;
|
|
17632
17820
|
minimumDigits?: number;
|
|
17633
17821
|
groupLength?: number;
|
|
17822
|
+
fractionGroupLength?: number;
|
|
17634
17823
|
};
|
|
17635
17824
|
onlyIfContainsSeparator?: boolean;
|
|
17636
17825
|
}]; // ----- unicorn/prefer-add-event-listener -----
|
|
@@ -17648,7 +17837,10 @@ type UnicornPreferAt = [] | [{
|
|
|
17648
17837
|
checkAllIndexAccess?: boolean;
|
|
17649
17838
|
}]; // ----- unicorn/prefer-export-from -----
|
|
17650
17839
|
type UnicornPreferExportFrom = [] | [{
|
|
17651
|
-
|
|
17840
|
+
checkUsedVariables?: boolean;
|
|
17841
|
+
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
17842
|
+
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
17843
|
+
minimumComparisons?: number;
|
|
17652
17844
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
17653
17845
|
type UnicornPreferNumberProperties = [] | [{
|
|
17654
17846
|
checkInfinity?: boolean;
|
|
@@ -17656,9 +17848,22 @@ type UnicornPreferNumberProperties = [] | [{
|
|
|
17656
17848
|
}]; // ----- unicorn/prefer-object-from-entries -----
|
|
17657
17849
|
type UnicornPreferObjectFromEntries = [] | [{
|
|
17658
17850
|
functions?: unknown[];
|
|
17851
|
+
}]; // ----- unicorn/prefer-query-selector -----
|
|
17852
|
+
type UnicornPreferQuerySelector = [] | [{
|
|
17853
|
+
allowWithVariables?: boolean;
|
|
17854
|
+
}]; // ----- unicorn/prefer-queue-microtask -----
|
|
17855
|
+
type UnicornPreferQueueMicrotask = [] | [{
|
|
17856
|
+
checkSetImmediate?: boolean;
|
|
17857
|
+
checkSetTimeout?: boolean;
|
|
17858
|
+
}]; // ----- unicorn/prefer-set-has -----
|
|
17859
|
+
type UnicornPreferSetHas = [] | [{
|
|
17860
|
+
minimumItems?: number;
|
|
17659
17861
|
}]; // ----- unicorn/prefer-single-call -----
|
|
17660
17862
|
type UnicornPreferSingleCall = [] | [{
|
|
17661
17863
|
ignore?: unknown[];
|
|
17864
|
+
}]; // ----- unicorn/prefer-string-repeat -----
|
|
17865
|
+
type UnicornPreferStringRepeat = [] | [{
|
|
17866
|
+
minimumRepetitions?: number;
|
|
17662
17867
|
}]; // ----- unicorn/prefer-structured-clone -----
|
|
17663
17868
|
type UnicornPreferStructuredClone = [] | [{
|
|
17664
17869
|
functions?: unknown[];
|
|
@@ -17691,15 +17896,20 @@ interface _UnicornPreventAbbreviations_BooleanObject {
|
|
|
17691
17896
|
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
17692
17897
|
[k: string]: boolean | undefined;
|
|
17693
17898
|
} // ----- unicorn/relative-url-style -----
|
|
17694
|
-
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/
|
|
17899
|
+
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
17900
|
+
type UnicornRequireCssEscape = [] | [{
|
|
17901
|
+
checkAllSelectors?: boolean;
|
|
17902
|
+
}]; // ----- unicorn/string-content -----
|
|
17695
17903
|
type UnicornStringContent = [] | [{
|
|
17696
17904
|
patterns?: {
|
|
17697
17905
|
[k: string]: (string | {
|
|
17698
17906
|
suggest: string;
|
|
17699
17907
|
fix?: boolean;
|
|
17908
|
+
caseSensitive?: boolean;
|
|
17700
17909
|
message?: string;
|
|
17701
17910
|
}) | undefined;
|
|
17702
17911
|
};
|
|
17912
|
+
selectors?: string[];
|
|
17703
17913
|
}]; // ----- unicorn/switch-case-braces -----
|
|
17704
17914
|
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
17705
17915
|
type UnicornTemplateIndent = [] | [{
|
|
@@ -17711,6 +17921,9 @@ type UnicornTemplateIndent = [] | [{
|
|
|
17711
17921
|
}]; // ----- unicorn/text-encoding-identifier-case -----
|
|
17712
17922
|
type UnicornTextEncodingIdentifierCase = [] | [{
|
|
17713
17923
|
withDash?: boolean;
|
|
17924
|
+
}]; // ----- unicorn/try-complexity -----
|
|
17925
|
+
type UnicornTryComplexity = [] | [{
|
|
17926
|
+
max?: number;
|
|
17714
17927
|
}]; // ----- unocss/enforce-class-compile -----
|
|
17715
17928
|
type UnocssEnforceClassCompile = [] | [{
|
|
17716
17929
|
prefix?: string;
|