@bfra.me/eslint-config 0.28.3 → 0.29.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/lib/index.d.ts +215 -138
- package/lib/index.js +243 -5
- package/package.json +10 -9
- package/src/config.d.ts +9 -0
- package/src/configs/index.ts +1 -0
- package/src/configs/markdown.ts +2 -2
- package/src/configs/sort.ts +271 -0
- package/src/define-config.ts +9 -1
- package/src/globs.ts +10 -0
- package/src/rules.d.ts +161 -137
package/lib/index.d.ts
CHANGED
|
@@ -4254,690 +4254,710 @@ interface Rules {
|
|
|
4254
4254
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>
|
|
4255
4255
|
/**
|
|
4256
4256
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
4257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/better-regex.md
|
|
4258
4258
|
*/
|
|
4259
4259
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>
|
|
4260
4260
|
/**
|
|
4261
4261
|
* Enforce a specific parameter name in catch clauses.
|
|
4262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/catch-error-name.md
|
|
4263
4263
|
*/
|
|
4264
4264
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
4265
4265
|
/**
|
|
4266
4266
|
* Enforce consistent assertion style with `node:assert`.
|
|
4267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-assert.md
|
|
4268
4268
|
*/
|
|
4269
4269
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
4270
4270
|
/**
|
|
4271
4271
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
4272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-date-clone.md
|
|
4273
4273
|
*/
|
|
4274
4274
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
4275
4275
|
/**
|
|
4276
4276
|
* Use destructured variables over properties.
|
|
4277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-destructuring.md
|
|
4278
4278
|
*/
|
|
4279
4279
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
4280
4280
|
/**
|
|
4281
4281
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
4282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-empty-array-spread.md
|
|
4283
4283
|
*/
|
|
4284
4284
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
4285
4285
|
/**
|
|
4286
4286
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
4287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-existence-index-check.md
|
|
4288
4288
|
*/
|
|
4289
4289
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
4290
4290
|
/**
|
|
4291
4291
|
* Move function definitions to the highest possible scope.
|
|
4292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-function-scoping.md
|
|
4293
4293
|
*/
|
|
4294
4294
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
4295
4295
|
/**
|
|
4296
4296
|
* Enforce correct `Error` subclassing.
|
|
4297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/custom-error-definition.md
|
|
4298
4298
|
*/
|
|
4299
4299
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
4300
4300
|
/**
|
|
4301
4301
|
* Enforce no spaces between braces.
|
|
4302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4302
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/empty-brace-spaces.md
|
|
4303
4303
|
*/
|
|
4304
4304
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
4305
4305
|
/**
|
|
4306
4306
|
* Enforce passing a `message` value when creating a built-in error.
|
|
4307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4307
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/error-message.md
|
|
4308
4308
|
*/
|
|
4309
4309
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
4310
4310
|
/**
|
|
4311
4311
|
* Require escape sequences to use uppercase or lowercase values.
|
|
4312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4312
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/escape-case.md
|
|
4313
4313
|
*/
|
|
4314
4314
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
4315
4315
|
/**
|
|
4316
4316
|
* Add expiration conditions to TODO comments.
|
|
4317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4317
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/expiring-todo-comments.md
|
|
4318
4318
|
*/
|
|
4319
4319
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
4320
4320
|
/**
|
|
4321
4321
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
4322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4322
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/explicit-length-check.md
|
|
4323
4323
|
*/
|
|
4324
4324
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
4325
4325
|
/**
|
|
4326
4326
|
* Enforce a case style for filenames.
|
|
4327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4327
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/filename-case.md
|
|
4328
4328
|
*/
|
|
4329
4329
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
4330
4330
|
/**
|
|
4331
4331
|
* Enforce specific import styles per module.
|
|
4332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4332
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/import-style.md
|
|
4333
4333
|
*/
|
|
4334
4334
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
4335
4335
|
/**
|
|
4336
4336
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
4337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4337
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/new-for-builtins.md
|
|
4338
4338
|
*/
|
|
4339
4339
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
4340
4340
|
/**
|
|
4341
4341
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
4342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4342
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-abusive-eslint-disable.md
|
|
4343
4343
|
*/
|
|
4344
4344
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
4345
4345
|
/**
|
|
4346
4346
|
* Disallow recursive access to `this` within getters and setters.
|
|
4347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4347
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-accessor-recursion.md
|
|
4348
4348
|
*/
|
|
4349
4349
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
4350
4350
|
/**
|
|
4351
4351
|
* Disallow anonymous functions and classes as the default export.
|
|
4352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4352
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-anonymous-default-export.md
|
|
4353
4353
|
*/
|
|
4354
4354
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
4355
4355
|
/**
|
|
4356
4356
|
* Prevent passing a function reference directly to iterator methods.
|
|
4357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4357
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-callback-reference.md
|
|
4358
4358
|
*/
|
|
4359
4359
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>
|
|
4360
4360
|
/**
|
|
4361
4361
|
* Prefer `for…of` over the `forEach` method.
|
|
4362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4362
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-for-each.md
|
|
4363
4363
|
*/
|
|
4364
4364
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
4365
4365
|
/**
|
|
4366
4366
|
* Disallow using the `this` argument in array methods.
|
|
4367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4367
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-method-this-argument.md
|
|
4368
4368
|
*/
|
|
4369
4369
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
4370
4370
|
/**
|
|
4371
4371
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
4372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4372
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-array-push-push
|
|
4373
4373
|
* @deprecated
|
|
4374
4374
|
*/
|
|
4375
4375
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
4376
4376
|
/**
|
|
4377
4377
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
4378
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4378
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-reduce.md
|
|
4379
4379
|
*/
|
|
4380
4380
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
4381
4381
|
/**
|
|
4382
4382
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
4383
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4383
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-reverse.md
|
|
4384
4384
|
*/
|
|
4385
4385
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>
|
|
4386
|
+
/**
|
|
4387
|
+
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
4388
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-sort.md
|
|
4389
|
+
*/
|
|
4390
|
+
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>
|
|
4386
4391
|
/**
|
|
4387
4392
|
* Disallow member access from await expression.
|
|
4388
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-await-expression-member.md
|
|
4389
4394
|
*/
|
|
4390
4395
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
4391
4396
|
/**
|
|
4392
4397
|
* Disallow using `await` in `Promise` method parameters.
|
|
4393
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-await-in-promise-methods.md
|
|
4394
4399
|
*/
|
|
4395
4400
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
4396
4401
|
/**
|
|
4397
4402
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
4398
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-console-spaces.md
|
|
4399
4404
|
*/
|
|
4400
4405
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
4401
4406
|
/**
|
|
4402
4407
|
* Do not use `document.cookie` directly.
|
|
4403
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-document-cookie.md
|
|
4404
4409
|
*/
|
|
4405
4410
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
4406
4411
|
/**
|
|
4407
4412
|
* Disallow empty files.
|
|
4408
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-empty-file.md
|
|
4409
4414
|
*/
|
|
4410
4415
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>
|
|
4411
4416
|
/**
|
|
4412
4417
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
4413
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-for-loop.md
|
|
4414
4419
|
*/
|
|
4415
4420
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
4416
4421
|
/**
|
|
4417
4422
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
4418
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-hex-escape.md
|
|
4419
4424
|
*/
|
|
4420
4425
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
4421
4426
|
/**
|
|
4422
4427
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
4423
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-instanceof-array
|
|
4424
4429
|
* @deprecated
|
|
4425
4430
|
*/
|
|
4426
4431
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
4427
4432
|
/**
|
|
4428
4433
|
* Disallow `instanceof` with built-in objects
|
|
4429
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4434
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-instanceof-builtins.md
|
|
4430
4435
|
*/
|
|
4431
4436
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
4432
4437
|
/**
|
|
4433
4438
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
4434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4439
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-invalid-fetch-options.md
|
|
4435
4440
|
*/
|
|
4436
4441
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
4437
4442
|
/**
|
|
4438
4443
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
4439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4444
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-invalid-remove-event-listener.md
|
|
4440
4445
|
*/
|
|
4441
4446
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
4442
4447
|
/**
|
|
4443
4448
|
* Disallow identifiers starting with `new` or `class`.
|
|
4444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4449
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-keyword-prefix.md
|
|
4445
4450
|
*/
|
|
4446
4451
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
4447
4452
|
/**
|
|
4448
4453
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
4449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4454
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-length-as-slice-end
|
|
4450
4455
|
* @deprecated
|
|
4451
4456
|
*/
|
|
4452
4457
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
4453
4458
|
/**
|
|
4454
4459
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
4455
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4460
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-lonely-if.md
|
|
4456
4461
|
*/
|
|
4457
4462
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
4458
4463
|
/**
|
|
4459
4464
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
4460
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4465
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-magic-array-flat-depth.md
|
|
4461
4466
|
*/
|
|
4462
4467
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
4463
4468
|
/**
|
|
4464
4469
|
* Disallow named usage of default import and export.
|
|
4465
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-named-default.md
|
|
4466
4471
|
*/
|
|
4467
4472
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
4468
4473
|
/**
|
|
4469
4474
|
* Disallow negated conditions.
|
|
4470
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-negated-condition.md
|
|
4471
4476
|
*/
|
|
4472
4477
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
4473
4478
|
/**
|
|
4474
4479
|
* Disallow negated expression in equality check.
|
|
4475
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-negation-in-equality-check.md
|
|
4476
4481
|
*/
|
|
4477
4482
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
4478
4483
|
/**
|
|
4479
4484
|
* Disallow nested ternary expressions.
|
|
4480
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4485
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-nested-ternary.md
|
|
4481
4486
|
*/
|
|
4482
4487
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
4483
4488
|
/**
|
|
4484
4489
|
* Disallow `new Array()`.
|
|
4485
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4490
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-new-array.md
|
|
4486
4491
|
*/
|
|
4487
4492
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
4488
4493
|
/**
|
|
4489
4494
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
4490
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4495
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-new-buffer.md
|
|
4491
4496
|
*/
|
|
4492
4497
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
4493
4498
|
/**
|
|
4494
4499
|
* Disallow the use of the `null` literal.
|
|
4495
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4500
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-null.md
|
|
4496
4501
|
*/
|
|
4497
4502
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
4498
4503
|
/**
|
|
4499
4504
|
* Disallow the use of objects as default parameters.
|
|
4500
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4505
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-object-as-default-parameter.md
|
|
4501
4506
|
*/
|
|
4502
4507
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
4503
4508
|
/**
|
|
4504
4509
|
* Disallow `process.exit()`.
|
|
4505
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4510
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-process-exit.md
|
|
4506
4511
|
*/
|
|
4507
4512
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
4508
4513
|
/**
|
|
4509
4514
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
4510
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4515
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-single-promise-in-promise-methods.md
|
|
4511
4516
|
*/
|
|
4512
4517
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
4513
4518
|
/**
|
|
4514
4519
|
* Disallow classes that only have static members.
|
|
4515
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4520
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-static-only-class.md
|
|
4516
4521
|
*/
|
|
4517
4522
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
4518
4523
|
/**
|
|
4519
4524
|
* Disallow `then` property.
|
|
4520
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4525
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-thenable.md
|
|
4521
4526
|
*/
|
|
4522
4527
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
4523
4528
|
/**
|
|
4524
4529
|
* Disallow assigning `this` to a variable.
|
|
4525
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4530
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-this-assignment.md
|
|
4526
4531
|
*/
|
|
4527
4532
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
4528
4533
|
/**
|
|
4529
4534
|
* Disallow comparing `undefined` using `typeof`.
|
|
4530
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4535
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-typeof-undefined.md
|
|
4531
4536
|
*/
|
|
4532
4537
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
4533
4538
|
/**
|
|
4534
4539
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
4535
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4540
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-array-flat-depth.md
|
|
4536
4541
|
*/
|
|
4537
4542
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
4538
4543
|
/**
|
|
4539
4544
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
4540
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4545
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-array-splice-count.md
|
|
4541
4546
|
*/
|
|
4542
4547
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
4543
4548
|
/**
|
|
4544
4549
|
* Disallow awaiting non-promise values.
|
|
4545
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4550
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-await.md
|
|
4546
4551
|
*/
|
|
4547
4552
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
4548
4553
|
/**
|
|
4549
4554
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
4550
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4555
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-polyfills.md
|
|
4551
4556
|
*/
|
|
4552
4557
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
4553
4558
|
/**
|
|
4554
4559
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
4555
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4560
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-slice-end.md
|
|
4556
4561
|
*/
|
|
4557
4562
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
4558
4563
|
/**
|
|
4559
4564
|
* Disallow unreadable array destructuring.
|
|
4560
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4565
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unreadable-array-destructuring.md
|
|
4561
4566
|
*/
|
|
4562
4567
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
4563
4568
|
/**
|
|
4564
4569
|
* Disallow unreadable IIFEs.
|
|
4565
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4570
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unreadable-iife.md
|
|
4566
4571
|
*/
|
|
4567
4572
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
4568
4573
|
/**
|
|
4569
4574
|
* Disallow unused object properties.
|
|
4570
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4575
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unused-properties.md
|
|
4571
4576
|
*/
|
|
4572
4577
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
4573
4578
|
/**
|
|
4574
4579
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
4575
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4580
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-error-capture-stack-trace.md
|
|
4576
4581
|
*/
|
|
4577
4582
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
4578
4583
|
/**
|
|
4579
4584
|
* Disallow useless fallback when spreading in object literals.
|
|
4580
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4585
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-fallback-in-spread.md
|
|
4581
4586
|
*/
|
|
4582
4587
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
4583
4588
|
/**
|
|
4584
4589
|
* Disallow useless array length check.
|
|
4585
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4590
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-length-check.md
|
|
4586
4591
|
*/
|
|
4587
4592
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
4588
4593
|
/**
|
|
4589
4594
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
4590
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4595
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-promise-resolve-reject.md
|
|
4591
4596
|
*/
|
|
4592
4597
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
4593
4598
|
/**
|
|
4594
4599
|
* Disallow unnecessary spread.
|
|
4595
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4600
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-spread.md
|
|
4596
4601
|
*/
|
|
4597
4602
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
4598
4603
|
/**
|
|
4599
4604
|
* Disallow useless case in switch statements.
|
|
4600
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4605
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-switch-case.md
|
|
4601
4606
|
*/
|
|
4602
4607
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
4603
4608
|
/**
|
|
4604
4609
|
* Disallow useless `undefined`.
|
|
4605
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4610
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-undefined.md
|
|
4606
4611
|
*/
|
|
4607
4612
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
4608
4613
|
/**
|
|
4609
4614
|
* Disallow number literals with zero fractions or dangling dots.
|
|
4610
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4615
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-zero-fractions.md
|
|
4611
4616
|
*/
|
|
4612
4617
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
4613
4618
|
/**
|
|
4614
4619
|
* Enforce proper case for numeric literals.
|
|
4615
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4620
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/number-literal-case.md
|
|
4616
4621
|
*/
|
|
4617
4622
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
4618
4623
|
/**
|
|
4619
4624
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
4620
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4625
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/numeric-separators-style.md
|
|
4621
4626
|
*/
|
|
4622
4627
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
4623
4628
|
/**
|
|
4624
4629
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
4625
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4630
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-add-event-listener.md
|
|
4626
4631
|
*/
|
|
4627
4632
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
4628
4633
|
/**
|
|
4629
4634
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
4630
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4635
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-find.md
|
|
4631
4636
|
*/
|
|
4632
4637
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
4633
4638
|
/**
|
|
4634
4639
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
4635
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-flat.md
|
|
4636
4641
|
*/
|
|
4637
4642
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
4638
4643
|
/**
|
|
4639
4644
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
4640
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-flat-map.md
|
|
4641
4646
|
*/
|
|
4642
4647
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
4643
4648
|
/**
|
|
4644
4649
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
4645
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-index-of.md
|
|
4646
4651
|
*/
|
|
4647
4652
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
4648
4653
|
/**
|
|
4649
4654
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
4650
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-some.md
|
|
4651
4656
|
*/
|
|
4652
4657
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
4653
4658
|
/**
|
|
4654
4659
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
4655
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-at.md
|
|
4656
4661
|
*/
|
|
4657
4662
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
4663
|
+
/**
|
|
4664
|
+
* Prefer `BigInt` literals over the constructor.
|
|
4665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-bigint-literals.md
|
|
4666
|
+
*/
|
|
4667
|
+
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>
|
|
4658
4668
|
/**
|
|
4659
4669
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
4660
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-blob-reading-methods.md
|
|
4661
4671
|
*/
|
|
4662
4672
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
4663
4673
|
/**
|
|
4664
4674
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
4665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-class-fields.md
|
|
4666
4676
|
*/
|
|
4667
4677
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>
|
|
4678
|
+
/**
|
|
4679
|
+
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
4680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-classlist-toggle.md
|
|
4681
|
+
*/
|
|
4682
|
+
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>
|
|
4668
4683
|
/**
|
|
4669
4684
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
4670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-code-point.md
|
|
4671
4686
|
*/
|
|
4672
4687
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
4673
4688
|
/**
|
|
4674
4689
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
4675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-date-now.md
|
|
4676
4691
|
*/
|
|
4677
4692
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
4678
4693
|
/**
|
|
4679
4694
|
* Prefer default parameters over reassignment.
|
|
4680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-default-parameters.md
|
|
4681
4696
|
*/
|
|
4682
4697
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
4683
4698
|
/**
|
|
4684
4699
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
4685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-append.md
|
|
4686
4701
|
*/
|
|
4687
4702
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
4688
4703
|
/**
|
|
4689
4704
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
4690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-dataset.md
|
|
4691
4706
|
*/
|
|
4692
4707
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
4693
4708
|
/**
|
|
4694
4709
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
4695
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-remove.md
|
|
4696
4711
|
*/
|
|
4697
4712
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
4698
4713
|
/**
|
|
4699
4714
|
* Prefer `.textContent` over `.innerText`.
|
|
4700
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-text-content.md
|
|
4701
4716
|
*/
|
|
4702
4717
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
4703
4718
|
/**
|
|
4704
4719
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
4705
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-event-target.md
|
|
4706
4721
|
*/
|
|
4707
4722
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
4708
4723
|
/**
|
|
4709
4724
|
* Prefer `export…from` when re-exporting.
|
|
4710
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-export-from.md
|
|
4711
4726
|
*/
|
|
4712
4727
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
4713
4728
|
/**
|
|
4714
4729
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
4715
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-global-this.md
|
|
4716
4731
|
*/
|
|
4717
4732
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
4718
4733
|
/**
|
|
4719
4734
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
4720
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-import-meta-properties.md
|
|
4721
4736
|
*/
|
|
4722
4737
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
4723
4738
|
/**
|
|
4724
4739
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
4725
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-includes.md
|
|
4726
4741
|
*/
|
|
4727
4742
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
4728
4743
|
/**
|
|
4729
4744
|
* Prefer reading a JSON file as a buffer.
|
|
4730
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-json-parse-buffer.md
|
|
4731
4746
|
*/
|
|
4732
4747
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
4733
4748
|
/**
|
|
4734
4749
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
4735
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-keyboard-event-key.md
|
|
4736
4751
|
*/
|
|
4737
4752
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
4738
4753
|
/**
|
|
4739
4754
|
* Prefer using a logical operator over a ternary.
|
|
4740
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-logical-operator-over-ternary.md
|
|
4741
4756
|
*/
|
|
4742
4757
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
4743
4758
|
/**
|
|
4744
4759
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
4745
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-math-min-max.md
|
|
4746
4761
|
*/
|
|
4747
4762
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
4748
4763
|
/**
|
|
4749
4764
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
4750
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-math-trunc.md
|
|
4751
4766
|
*/
|
|
4752
4767
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
4753
4768
|
/**
|
|
4754
4769
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
4755
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-modern-dom-apis.md
|
|
4756
4771
|
*/
|
|
4757
4772
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
4758
4773
|
/**
|
|
4759
4774
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
4760
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-modern-math-apis.md
|
|
4761
4776
|
*/
|
|
4762
4777
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
4763
4778
|
/**
|
|
4764
4779
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
4765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-module.md
|
|
4766
4781
|
*/
|
|
4767
4782
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
4768
4783
|
/**
|
|
4769
4784
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
4770
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-native-coercion-functions.md
|
|
4771
4786
|
*/
|
|
4772
4787
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
4773
4788
|
/**
|
|
4774
4789
|
* Prefer negative index over `.length - index` when possible.
|
|
4775
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-negative-index.md
|
|
4776
4791
|
*/
|
|
4777
4792
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
4778
4793
|
/**
|
|
4779
4794
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
4780
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-node-protocol.md
|
|
4781
4796
|
*/
|
|
4782
4797
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
4783
4798
|
/**
|
|
4784
4799
|
* Prefer `Number` static properties over global ones.
|
|
4785
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-number-properties.md
|
|
4786
4801
|
*/
|
|
4787
4802
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
4788
4803
|
/**
|
|
4789
4804
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
4790
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-object-from-entries.md
|
|
4791
4806
|
*/
|
|
4792
4807
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
4793
4808
|
/**
|
|
4794
4809
|
* Prefer omitting the `catch` binding parameter.
|
|
4795
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4810
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-optional-catch-binding.md
|
|
4796
4811
|
*/
|
|
4797
4812
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
4798
4813
|
/**
|
|
4799
4814
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
4800
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4815
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-prototype-methods.md
|
|
4801
4816
|
*/
|
|
4802
4817
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
4803
4818
|
/**
|
|
4804
4819
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
4805
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4820
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-query-selector.md
|
|
4806
4821
|
*/
|
|
4807
4822
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>
|
|
4808
4823
|
/**
|
|
4809
4824
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
4810
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4825
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-reflect-apply.md
|
|
4811
4826
|
*/
|
|
4812
4827
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
4813
4828
|
/**
|
|
4814
4829
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
4815
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4830
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-regexp-test.md
|
|
4816
4831
|
*/
|
|
4817
4832
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
4818
4833
|
/**
|
|
4819
4834
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
4820
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4835
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-set-has.md
|
|
4821
4836
|
*/
|
|
4822
4837
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>
|
|
4823
4838
|
/**
|
|
4824
4839
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
4825
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4840
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-set-size.md
|
|
4826
4841
|
*/
|
|
4827
4842
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
4828
4843
|
/**
|
|
4829
4844
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
4830
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4845
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-single-call.md
|
|
4831
4846
|
*/
|
|
4832
4847
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
4833
4848
|
/**
|
|
4834
4849
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
4835
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-spread.md
|
|
4836
4851
|
*/
|
|
4837
4852
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
4838
4853
|
/**
|
|
4839
4854
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
4840
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4855
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-raw.md
|
|
4841
4856
|
*/
|
|
4842
4857
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
4843
4858
|
/**
|
|
4844
4859
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
4845
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4860
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-replace-all.md
|
|
4846
4861
|
*/
|
|
4847
4862
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
4848
4863
|
/**
|
|
4849
4864
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
4850
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4865
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-slice.md
|
|
4851
4866
|
*/
|
|
4852
4867
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
4853
4868
|
/**
|
|
4854
4869
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
4855
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4870
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-starts-ends-with.md
|
|
4856
4871
|
*/
|
|
4857
4872
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
4858
4873
|
/**
|
|
4859
4874
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
4860
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4875
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-trim-start-end.md
|
|
4861
4876
|
*/
|
|
4862
4877
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
4863
4878
|
/**
|
|
4864
4879
|
* Prefer using `structuredClone` to create a deep clone.
|
|
4865
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4880
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-structured-clone.md
|
|
4866
4881
|
*/
|
|
4867
4882
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
4868
4883
|
/**
|
|
4869
4884
|
* Prefer `switch` over multiple `else-if`.
|
|
4870
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4885
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-switch.md
|
|
4871
4886
|
*/
|
|
4872
4887
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
4873
4888
|
/**
|
|
4874
4889
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
4875
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4890
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-ternary.md
|
|
4876
4891
|
*/
|
|
4877
4892
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
4878
4893
|
/**
|
|
4879
4894
|
* Prefer top-level await over top-level promises and async function calls.
|
|
4880
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4895
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-top-level-await.md
|
|
4881
4896
|
*/
|
|
4882
4897
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
4883
4898
|
/**
|
|
4884
4899
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
4885
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4900
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-type-error.md
|
|
4886
4901
|
*/
|
|
4887
4902
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
4888
4903
|
/**
|
|
4889
4904
|
* Prevent abbreviations.
|
|
4890
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4905
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prevent-abbreviations.md
|
|
4891
4906
|
*/
|
|
4892
4907
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
4893
4908
|
/**
|
|
4894
4909
|
* Enforce consistent relative URL style.
|
|
4895
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4910
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/relative-url-style.md
|
|
4896
4911
|
*/
|
|
4897
4912
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
4898
4913
|
/**
|
|
4899
4914
|
* Enforce using the separator argument with `Array#join()`.
|
|
4900
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4915
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-array-join-separator.md
|
|
4901
4916
|
*/
|
|
4902
4917
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
4918
|
+
/**
|
|
4919
|
+
* Require non-empty module attributes for imports and exports
|
|
4920
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-module-attributes.md
|
|
4921
|
+
*/
|
|
4922
|
+
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>
|
|
4903
4923
|
/**
|
|
4904
4924
|
* Require non-empty specifier list in import and export statements.
|
|
4905
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4925
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-module-specifiers.md
|
|
4906
4926
|
*/
|
|
4907
4927
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
4908
4928
|
/**
|
|
4909
4929
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
4910
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4930
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-number-to-fixed-digits-argument.md
|
|
4911
4931
|
*/
|
|
4912
4932
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
4913
4933
|
/**
|
|
4914
4934
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
4915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4935
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-post-message-target-origin.md
|
|
4916
4936
|
*/
|
|
4917
4937
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
4918
4938
|
/**
|
|
4919
4939
|
* Enforce better string content.
|
|
4920
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4940
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/string-content.md
|
|
4921
4941
|
*/
|
|
4922
4942
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
4923
4943
|
/**
|
|
4924
4944
|
* Enforce consistent brace style for `case` clauses.
|
|
4925
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4945
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/switch-case-braces.md
|
|
4926
4946
|
*/
|
|
4927
4947
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
4928
4948
|
/**
|
|
4929
4949
|
* Fix whitespace-insensitive template indentation.
|
|
4930
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4950
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/template-indent.md
|
|
4931
4951
|
*/
|
|
4932
4952
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
4933
4953
|
/**
|
|
4934
4954
|
* Enforce consistent case for text encoding identifiers.
|
|
4935
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4955
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/text-encoding-identifier-case.md
|
|
4936
4956
|
*/
|
|
4937
4957
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>
|
|
4938
4958
|
/**
|
|
4939
4959
|
* Require `new` when creating an error.
|
|
4940
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
4960
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/throw-new-error.md
|
|
4941
4961
|
*/
|
|
4942
4962
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
4943
4963
|
/**
|
|
@@ -12789,6 +12809,10 @@ type UnicornNoArrayReduce = []|[{
|
|
|
12789
12809
|
type UnicornNoArrayReverse = []|[{
|
|
12790
12810
|
allowExpressionStatement?: boolean
|
|
12791
12811
|
}]
|
|
12812
|
+
// ----- unicorn/no-array-sort -----
|
|
12813
|
+
type UnicornNoArraySort = []|[{
|
|
12814
|
+
allowExpressionStatement?: boolean
|
|
12815
|
+
}]
|
|
12792
12816
|
// ----- unicorn/no-instanceof-builtins -----
|
|
12793
12817
|
type UnicornNoInstanceofBuiltins = []|[{
|
|
12794
12818
|
useErrorIsError?: boolean
|
|
@@ -13365,6 +13389,15 @@ type ConfigNames =
|
|
|
13365
13389
|
| '@bfra.me/jsonc/json-schema/unnamed2'
|
|
13366
13390
|
| '@bfra.me/jsonc/json-schema'
|
|
13367
13391
|
| '@bfra.me/jsonc'
|
|
13392
|
+
| '@bfra.me/sort/package-json'
|
|
13393
|
+
| '@bfra.me/sort/renovate-config'
|
|
13394
|
+
| '@bfra.me/renovate-config/json-schema/plugins'
|
|
13395
|
+
| '@bfra.me/renovate-config/json-schema/unnamed1'
|
|
13396
|
+
| '@bfra.me/renovate-config/json-schema'
|
|
13397
|
+
| '@bfra.me/sort/tsconfig'
|
|
13398
|
+
| '@bfra.me/tsconfig/json-schema/plugins'
|
|
13399
|
+
| '@bfra.me/tsconfig/json-schema/unnamed1'
|
|
13400
|
+
| '@bfra.me/tsconfig/json-schema'
|
|
13368
13401
|
| '@bfra.me/pnpm/package-json'
|
|
13369
13402
|
| '@bfra.me/pnpm/pnpm-workspace-yaml'
|
|
13370
13403
|
| '@bfra.me/toml/plugins'
|
|
@@ -13518,6 +13551,48 @@ type RegexpOptions = OptionsOverrides;
|
|
|
13518
13551
|
*/
|
|
13519
13552
|
declare function regexp(options?: RegexpOptions): Promise<Config[]>;
|
|
13520
13553
|
|
|
13554
|
+
/**
|
|
13555
|
+
* Creates an ESLint configuration for sorting package.json files.
|
|
13556
|
+
*
|
|
13557
|
+
* This function returns a configuration that enforces consistent ordering of:
|
|
13558
|
+
* - Array values in the `files` field (ascending order)
|
|
13559
|
+
* - Object keys at the root level using a custom sort order
|
|
13560
|
+
* - Dependencies sections (dependencies, devDependencies, etc.) in alphabetical order
|
|
13561
|
+
* - Package manager overrides (resolutions, overrides, pnpm.overrides) in alphabetical order
|
|
13562
|
+
* - Workspace catalog entries in alphabetical order
|
|
13563
|
+
* - Export conditions in a specific order (types, import, require, default)
|
|
13564
|
+
* - Git hooks in execution order for client-side hooks
|
|
13565
|
+
*
|
|
13566
|
+
* @returns An array containing a single ESLint configuration object for package.json files
|
|
13567
|
+
*/
|
|
13568
|
+
declare function sortPackageJson(): Config[];
|
|
13569
|
+
/**
|
|
13570
|
+
* Creates ESLint configuration for sorting Renovate configuration files.
|
|
13571
|
+
*
|
|
13572
|
+
* This function returns an array of ESLint configurations that enforce sorting rules
|
|
13573
|
+
* for Renovate config files, including:
|
|
13574
|
+
* - Sorting array values in ascending order (except for 'extends' arrays where order matters)
|
|
13575
|
+
* - Sorting object keys according to Renovate's recommended structure
|
|
13576
|
+
*
|
|
13577
|
+
* The key sorting order follows the pattern defined in the Sanity.io renovate-config
|
|
13578
|
+
* repository for consistent configuration structure.
|
|
13579
|
+
*
|
|
13580
|
+
* @returns A promise that resolves to an array of ESLint configurations for Renovate files
|
|
13581
|
+
*/
|
|
13582
|
+
declare function sortRenovateConfig(): Promise<Config[]>;
|
|
13583
|
+
/**
|
|
13584
|
+
* Creates ESLint configuration for sorting TypeScript configuration files.
|
|
13585
|
+
*
|
|
13586
|
+
* This function generates rules to enforce a specific order of properties in tsconfig.json files:
|
|
13587
|
+
* - Root level properties are ordered: extends, compilerOptions, references, files, include, exclude
|
|
13588
|
+
* - CompilerOptions properties are grouped and ordered by TypeScript compiler categories:
|
|
13589
|
+
* Projects, Language and Environment, Modules, JavaScript Support, Type Checking,
|
|
13590
|
+
* Emit, Interop Constraints, and Completeness
|
|
13591
|
+
*
|
|
13592
|
+
* @returns A promise that resolves to an array of ESLint configurations for tsconfig files
|
|
13593
|
+
*/
|
|
13594
|
+
declare function sortTsconfig(): Promise<Config[]>;
|
|
13595
|
+
|
|
13521
13596
|
/**
|
|
13522
13597
|
* Represents the options for configuring TOML files in the ESLint configuration.
|
|
13523
13598
|
*/
|
|
@@ -13871,9 +13946,11 @@ declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
|
13871
13946
|
declare const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
13872
13947
|
declare const GLOB_ASTRO = "**/*.astro";
|
|
13873
13948
|
declare const GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
13949
|
+
declare const GLOB_RENOVATE_CONFIG: string[];
|
|
13950
|
+
declare const GLOB_TS_CONFIG: string[];
|
|
13874
13951
|
declare const GLOB_TESTS: string[];
|
|
13875
13952
|
declare const GLOB_EXCLUDE: string[];
|
|
13876
13953
|
|
|
13877
13954
|
declare const config: eslint_flat_config_utils.FlatConfigComposer<Config, ConfigNames>;
|
|
13878
13955
|
|
|
13879
|
-
export { type AstroOptions, type Config, type ConfigNames, type FallbackOptions, type Flatten, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_EXCLUDE, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type JavaScriptOptions, type JsoncOptions, type MarkdownOptions, type Options, type OptionsFiles, type OptionsIsInEditor, type OptionsOverrides, type OptionsPerfectionist, type OptionsTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PackageJsonOptions, type PerfectionistOptions, type PrettierOptions, type RegexpOptions, type Rules, type TomlOptions, type TypeScriptOptions, type UnicornOptions, type VitestOptions, type YamlOptions, astro, codeInMdFiles, command, composeConfig, config, config as default, defineConfig, epilogue, eslintComments, extInMdFiles, fallback, ignores, imports, isInEditor, isInGitLifecycle, javascript, jsdoc, jsonc, jsoncFiles, markdown, mdFiles, node, packageJson, packageJsonFiles, perfectionist, pnpm, prettier, regexp, toml, tomlFiles, typescript, unicorn, vitest, yaml, yamlFiles };
|
|
13956
|
+
export { type AstroOptions, type Config, type ConfigNames, type FallbackOptions, type Flatten, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_EXCLUDE, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_RENOVATE_CONFIG, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_TS_CONFIG, GLOB_YAML, type JavaScriptOptions, type JsoncOptions, type MarkdownOptions, type Options, type OptionsFiles, type OptionsIsInEditor, type OptionsOverrides, type OptionsPerfectionist, type OptionsTypeScript, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PackageJsonOptions, type PerfectionistOptions, type PrettierOptions, type RegexpOptions, type Rules, type TomlOptions, type TypeScriptOptions, type UnicornOptions, type VitestOptions, type YamlOptions, astro, codeInMdFiles, command, composeConfig, config, config as default, defineConfig, epilogue, eslintComments, extInMdFiles, fallback, ignores, imports, isInEditor, isInGitLifecycle, javascript, jsdoc, jsonc, jsoncFiles, markdown, mdFiles, node, packageJson, packageJsonFiles, perfectionist, pnpm, prettier, regexp, sortPackageJson, sortRenovateConfig, sortTsconfig, toml, tomlFiles, typescript, unicorn, vitest, yaml, yamlFiles };
|