@bfra.me/eslint-config 0.28.2 → 0.29.0
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 +233 -140
- package/lib/index.js +276 -34
- package/package.json +15 -14
- package/src/config.d.ts +10 -1
- package/src/configs/index.ts +1 -0
- package/src/configs/sort.ts +271 -0
- package/src/configs/typescript.ts +38 -31
- package/src/define-config.ts +9 -1
- package/src/globs.ts +10 -0
- package/src/rules.d.ts +178 -138
package/lib/index.d.ts
CHANGED
|
@@ -1522,7 +1522,7 @@ interface Rules {
|
|
|
1522
1522
|
* Reports invalid alignment of JSDoc block asterisks.
|
|
1523
1523
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-alignment.md#repos-sticky-header
|
|
1524
1524
|
*/
|
|
1525
|
-
'jsdoc/check-alignment'?: Linter.RuleEntry<
|
|
1525
|
+
'jsdoc/check-alignment'?: Linter.RuleEntry<JsdocCheckAlignment>
|
|
1526
1526
|
/**
|
|
1527
1527
|
* Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
|
|
1528
1528
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-examples.md#repos-sticky-header
|
|
@@ -3577,6 +3577,11 @@ interface Rules {
|
|
|
3577
3577
|
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
3578
3578
|
*/
|
|
3579
3579
|
'prefer-template'?: Linter.RuleEntry<[]>
|
|
3580
|
+
/**
|
|
3581
|
+
* Disallow losing originally caught error when re-throwing custom errors
|
|
3582
|
+
* @see https://eslint.org/docs/latest/rules/preserve-caught-error
|
|
3583
|
+
*/
|
|
3584
|
+
'preserve-caught-error'?: Linter.RuleEntry<PreserveCaughtError>
|
|
3580
3585
|
/**
|
|
3581
3586
|
* @see https://github.com/prettier/eslint-plugin-prettier#options
|
|
3582
3587
|
*/
|
|
@@ -4249,690 +4254,710 @@ interface Rules {
|
|
|
4249
4254
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>
|
|
4250
4255
|
/**
|
|
4251
4256
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
4252
|
-
* @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
|
|
4253
4258
|
*/
|
|
4254
4259
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>
|
|
4255
4260
|
/**
|
|
4256
4261
|
* Enforce a specific parameter name in catch clauses.
|
|
4257
|
-
* @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
|
|
4258
4263
|
*/
|
|
4259
4264
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
4260
4265
|
/**
|
|
4261
4266
|
* Enforce consistent assertion style with `node:assert`.
|
|
4262
|
-
* @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
|
|
4263
4268
|
*/
|
|
4264
4269
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
4265
4270
|
/**
|
|
4266
4271
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
4267
|
-
* @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
|
|
4268
4273
|
*/
|
|
4269
4274
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
4270
4275
|
/**
|
|
4271
4276
|
* Use destructured variables over properties.
|
|
4272
|
-
* @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
|
|
4273
4278
|
*/
|
|
4274
4279
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
4275
4280
|
/**
|
|
4276
4281
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
4277
|
-
* @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
|
|
4278
4283
|
*/
|
|
4279
4284
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
4280
4285
|
/**
|
|
4281
4286
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
4282
|
-
* @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
|
|
4283
4288
|
*/
|
|
4284
4289
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
4285
4290
|
/**
|
|
4286
4291
|
* Move function definitions to the highest possible scope.
|
|
4287
|
-
* @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
|
|
4288
4293
|
*/
|
|
4289
4294
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
4290
4295
|
/**
|
|
4291
4296
|
* Enforce correct `Error` subclassing.
|
|
4292
|
-
* @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
|
|
4293
4298
|
*/
|
|
4294
4299
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
4295
4300
|
/**
|
|
4296
4301
|
* Enforce no spaces between braces.
|
|
4297
|
-
* @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
|
|
4298
4303
|
*/
|
|
4299
4304
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
4300
4305
|
/**
|
|
4301
4306
|
* Enforce passing a `message` value when creating a built-in error.
|
|
4302
|
-
* @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
|
|
4303
4308
|
*/
|
|
4304
4309
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
4305
4310
|
/**
|
|
4306
4311
|
* Require escape sequences to use uppercase or lowercase values.
|
|
4307
|
-
* @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
|
|
4308
4313
|
*/
|
|
4309
4314
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
4310
4315
|
/**
|
|
4311
4316
|
* Add expiration conditions to TODO comments.
|
|
4312
|
-
* @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
|
|
4313
4318
|
*/
|
|
4314
4319
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
4315
4320
|
/**
|
|
4316
4321
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
4317
|
-
* @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
|
|
4318
4323
|
*/
|
|
4319
4324
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
4320
4325
|
/**
|
|
4321
4326
|
* Enforce a case style for filenames.
|
|
4322
|
-
* @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
|
|
4323
4328
|
*/
|
|
4324
4329
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
4325
4330
|
/**
|
|
4326
4331
|
* Enforce specific import styles per module.
|
|
4327
|
-
* @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
|
|
4328
4333
|
*/
|
|
4329
4334
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
4330
4335
|
/**
|
|
4331
4336
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
4332
|
-
* @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
|
|
4333
4338
|
*/
|
|
4334
4339
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
4335
4340
|
/**
|
|
4336
4341
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
4337
|
-
* @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
|
|
4338
4343
|
*/
|
|
4339
4344
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
4340
4345
|
/**
|
|
4341
4346
|
* Disallow recursive access to `this` within getters and setters.
|
|
4342
|
-
* @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
|
|
4343
4348
|
*/
|
|
4344
4349
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
4345
4350
|
/**
|
|
4346
4351
|
* Disallow anonymous functions and classes as the default export.
|
|
4347
|
-
* @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
|
|
4348
4353
|
*/
|
|
4349
4354
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
4350
4355
|
/**
|
|
4351
4356
|
* Prevent passing a function reference directly to iterator methods.
|
|
4352
|
-
* @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
|
|
4353
4358
|
*/
|
|
4354
4359
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>
|
|
4355
4360
|
/**
|
|
4356
4361
|
* Prefer `for…of` over the `forEach` method.
|
|
4357
|
-
* @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
|
|
4358
4363
|
*/
|
|
4359
4364
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
4360
4365
|
/**
|
|
4361
4366
|
* Disallow using the `this` argument in array methods.
|
|
4362
|
-
* @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
|
|
4363
4368
|
*/
|
|
4364
4369
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
4365
4370
|
/**
|
|
4366
4371
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
4367
|
-
* @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
|
|
4368
4373
|
* @deprecated
|
|
4369
4374
|
*/
|
|
4370
4375
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
4371
4376
|
/**
|
|
4372
4377
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
4373
|
-
* @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
|
|
4374
4379
|
*/
|
|
4375
4380
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
4376
4381
|
/**
|
|
4377
4382
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
4378
|
-
* @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
|
|
4379
4384
|
*/
|
|
4380
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>
|
|
4381
4391
|
/**
|
|
4382
4392
|
* Disallow member access from await expression.
|
|
4383
|
-
* @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
|
|
4384
4394
|
*/
|
|
4385
4395
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
4386
4396
|
/**
|
|
4387
4397
|
* Disallow using `await` in `Promise` method parameters.
|
|
4388
|
-
* @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
|
|
4389
4399
|
*/
|
|
4390
4400
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
4391
4401
|
/**
|
|
4392
4402
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
4393
|
-
* @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
|
|
4394
4404
|
*/
|
|
4395
4405
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
4396
4406
|
/**
|
|
4397
4407
|
* Do not use `document.cookie` directly.
|
|
4398
|
-
* @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
|
|
4399
4409
|
*/
|
|
4400
4410
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
4401
4411
|
/**
|
|
4402
4412
|
* Disallow empty files.
|
|
4403
|
-
* @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
|
|
4404
4414
|
*/
|
|
4405
4415
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>
|
|
4406
4416
|
/**
|
|
4407
4417
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
4408
|
-
* @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
|
|
4409
4419
|
*/
|
|
4410
4420
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
4411
4421
|
/**
|
|
4412
4422
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
4413
|
-
* @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
|
|
4414
4424
|
*/
|
|
4415
4425
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
4416
4426
|
/**
|
|
4417
4427
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
4418
|
-
* @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
|
|
4419
4429
|
* @deprecated
|
|
4420
4430
|
*/
|
|
4421
4431
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
4422
4432
|
/**
|
|
4423
4433
|
* Disallow `instanceof` with built-in objects
|
|
4424
|
-
* @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
|
|
4425
4435
|
*/
|
|
4426
4436
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
4427
4437
|
/**
|
|
4428
4438
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
4429
|
-
* @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
|
|
4430
4440
|
*/
|
|
4431
4441
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
4432
4442
|
/**
|
|
4433
4443
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
4434
|
-
* @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
|
|
4435
4445
|
*/
|
|
4436
4446
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
4437
4447
|
/**
|
|
4438
4448
|
* Disallow identifiers starting with `new` or `class`.
|
|
4439
|
-
* @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
|
|
4440
4450
|
*/
|
|
4441
4451
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
4442
4452
|
/**
|
|
4443
4453
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
4444
|
-
* @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
|
|
4445
4455
|
* @deprecated
|
|
4446
4456
|
*/
|
|
4447
4457
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
4448
4458
|
/**
|
|
4449
4459
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
4450
|
-
* @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
|
|
4451
4461
|
*/
|
|
4452
4462
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
4453
4463
|
/**
|
|
4454
4464
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
4455
|
-
* @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
|
|
4456
4466
|
*/
|
|
4457
4467
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
4458
4468
|
/**
|
|
4459
4469
|
* Disallow named usage of default import and export.
|
|
4460
|
-
* @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
|
|
4461
4471
|
*/
|
|
4462
4472
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
4463
4473
|
/**
|
|
4464
4474
|
* Disallow negated conditions.
|
|
4465
|
-
* @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
|
|
4466
4476
|
*/
|
|
4467
4477
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
4468
4478
|
/**
|
|
4469
4479
|
* Disallow negated expression in equality check.
|
|
4470
|
-
* @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
|
|
4471
4481
|
*/
|
|
4472
4482
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
4473
4483
|
/**
|
|
4474
4484
|
* Disallow nested ternary expressions.
|
|
4475
|
-
* @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
|
|
4476
4486
|
*/
|
|
4477
4487
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
4478
4488
|
/**
|
|
4479
4489
|
* Disallow `new Array()`.
|
|
4480
|
-
* @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
|
|
4481
4491
|
*/
|
|
4482
4492
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
4483
4493
|
/**
|
|
4484
4494
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
4485
|
-
* @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
|
|
4486
4496
|
*/
|
|
4487
4497
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
4488
4498
|
/**
|
|
4489
4499
|
* Disallow the use of the `null` literal.
|
|
4490
|
-
* @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
|
|
4491
4501
|
*/
|
|
4492
4502
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
4493
4503
|
/**
|
|
4494
4504
|
* Disallow the use of objects as default parameters.
|
|
4495
|
-
* @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
|
|
4496
4506
|
*/
|
|
4497
4507
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
4498
4508
|
/**
|
|
4499
4509
|
* Disallow `process.exit()`.
|
|
4500
|
-
* @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
|
|
4501
4511
|
*/
|
|
4502
4512
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
4503
4513
|
/**
|
|
4504
4514
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
4505
|
-
* @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
|
|
4506
4516
|
*/
|
|
4507
4517
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
4508
4518
|
/**
|
|
4509
4519
|
* Disallow classes that only have static members.
|
|
4510
|
-
* @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
|
|
4511
4521
|
*/
|
|
4512
4522
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
4513
4523
|
/**
|
|
4514
4524
|
* Disallow `then` property.
|
|
4515
|
-
* @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
|
|
4516
4526
|
*/
|
|
4517
4527
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
4518
4528
|
/**
|
|
4519
4529
|
* Disallow assigning `this` to a variable.
|
|
4520
|
-
* @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
|
|
4521
4531
|
*/
|
|
4522
4532
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
4523
4533
|
/**
|
|
4524
4534
|
* Disallow comparing `undefined` using `typeof`.
|
|
4525
|
-
* @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
|
|
4526
4536
|
*/
|
|
4527
4537
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
4528
4538
|
/**
|
|
4529
4539
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
4530
|
-
* @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
|
|
4531
4541
|
*/
|
|
4532
4542
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
4533
4543
|
/**
|
|
4534
4544
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
4535
|
-
* @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
|
|
4536
4546
|
*/
|
|
4537
4547
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
4538
4548
|
/**
|
|
4539
4549
|
* Disallow awaiting non-promise values.
|
|
4540
|
-
* @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
|
|
4541
4551
|
*/
|
|
4542
4552
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
4543
4553
|
/**
|
|
4544
4554
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
4545
|
-
* @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
|
|
4546
4556
|
*/
|
|
4547
4557
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
4548
4558
|
/**
|
|
4549
4559
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
4550
|
-
* @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
|
|
4551
4561
|
*/
|
|
4552
4562
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
4553
4563
|
/**
|
|
4554
4564
|
* Disallow unreadable array destructuring.
|
|
4555
|
-
* @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
|
|
4556
4566
|
*/
|
|
4557
4567
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
4558
4568
|
/**
|
|
4559
4569
|
* Disallow unreadable IIFEs.
|
|
4560
|
-
* @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
|
|
4561
4571
|
*/
|
|
4562
4572
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
4563
4573
|
/**
|
|
4564
4574
|
* Disallow unused object properties.
|
|
4565
|
-
* @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
|
|
4566
4576
|
*/
|
|
4567
4577
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
4568
4578
|
/**
|
|
4569
4579
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
4570
|
-
* @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
|
|
4571
4581
|
*/
|
|
4572
4582
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
4573
4583
|
/**
|
|
4574
4584
|
* Disallow useless fallback when spreading in object literals.
|
|
4575
|
-
* @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
|
|
4576
4586
|
*/
|
|
4577
4587
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
4578
4588
|
/**
|
|
4579
4589
|
* Disallow useless array length check.
|
|
4580
|
-
* @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
|
|
4581
4591
|
*/
|
|
4582
4592
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
4583
4593
|
/**
|
|
4584
4594
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
4585
|
-
* @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
|
|
4586
4596
|
*/
|
|
4587
4597
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
4588
4598
|
/**
|
|
4589
4599
|
* Disallow unnecessary spread.
|
|
4590
|
-
* @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
|
|
4591
4601
|
*/
|
|
4592
4602
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
4593
4603
|
/**
|
|
4594
4604
|
* Disallow useless case in switch statements.
|
|
4595
|
-
* @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
|
|
4596
4606
|
*/
|
|
4597
4607
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
4598
4608
|
/**
|
|
4599
4609
|
* Disallow useless `undefined`.
|
|
4600
|
-
* @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
|
|
4601
4611
|
*/
|
|
4602
4612
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
4603
4613
|
/**
|
|
4604
4614
|
* Disallow number literals with zero fractions or dangling dots.
|
|
4605
|
-
* @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
|
|
4606
4616
|
*/
|
|
4607
4617
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
4608
4618
|
/**
|
|
4609
4619
|
* Enforce proper case for numeric literals.
|
|
4610
|
-
* @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
|
|
4611
4621
|
*/
|
|
4612
4622
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
4613
4623
|
/**
|
|
4614
4624
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
4615
|
-
* @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
|
|
4616
4626
|
*/
|
|
4617
4627
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
4618
4628
|
/**
|
|
4619
4629
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
4620
|
-
* @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
|
|
4621
4631
|
*/
|
|
4622
4632
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
4623
4633
|
/**
|
|
4624
4634
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
4625
|
-
* @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
|
|
4626
4636
|
*/
|
|
4627
4637
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
4628
4638
|
/**
|
|
4629
4639
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
4630
|
-
* @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
|
|
4631
4641
|
*/
|
|
4632
4642
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
4633
4643
|
/**
|
|
4634
4644
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
4635
|
-
* @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
|
|
4636
4646
|
*/
|
|
4637
4647
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
4638
4648
|
/**
|
|
4639
4649
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
4640
|
-
* @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
|
|
4641
4651
|
*/
|
|
4642
4652
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
4643
4653
|
/**
|
|
4644
4654
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
4645
|
-
* @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
|
|
4646
4656
|
*/
|
|
4647
4657
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
4648
4658
|
/**
|
|
4649
4659
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
4650
|
-
* @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
|
|
4651
4661
|
*/
|
|
4652
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<[]>
|
|
4653
4668
|
/**
|
|
4654
4669
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
4655
|
-
* @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
|
|
4656
4671
|
*/
|
|
4657
4672
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
4658
4673
|
/**
|
|
4659
4674
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
4660
|
-
* @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
|
|
4661
4676
|
*/
|
|
4662
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<[]>
|
|
4663
4683
|
/**
|
|
4664
4684
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
4665
|
-
* @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
|
|
4666
4686
|
*/
|
|
4667
4687
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
4668
4688
|
/**
|
|
4669
4689
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
4670
|
-
* @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
|
|
4671
4691
|
*/
|
|
4672
4692
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
4673
4693
|
/**
|
|
4674
4694
|
* Prefer default parameters over reassignment.
|
|
4675
|
-
* @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
|
|
4676
4696
|
*/
|
|
4677
4697
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
4678
4698
|
/**
|
|
4679
4699
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
4680
|
-
* @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
|
|
4681
4701
|
*/
|
|
4682
4702
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
4683
4703
|
/**
|
|
4684
4704
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
4685
|
-
* @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
|
|
4686
4706
|
*/
|
|
4687
4707
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
4688
4708
|
/**
|
|
4689
4709
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
4690
|
-
* @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
|
|
4691
4711
|
*/
|
|
4692
4712
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
4693
4713
|
/**
|
|
4694
4714
|
* Prefer `.textContent` over `.innerText`.
|
|
4695
|
-
* @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
|
|
4696
4716
|
*/
|
|
4697
4717
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
4698
4718
|
/**
|
|
4699
4719
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
4700
|
-
* @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
|
|
4701
4721
|
*/
|
|
4702
4722
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
4703
4723
|
/**
|
|
4704
4724
|
* Prefer `export…from` when re-exporting.
|
|
4705
|
-
* @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
|
|
4706
4726
|
*/
|
|
4707
4727
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
4708
4728
|
/**
|
|
4709
4729
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
4710
|
-
* @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
|
|
4711
4731
|
*/
|
|
4712
4732
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
4713
4733
|
/**
|
|
4714
4734
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
4715
|
-
* @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
|
|
4716
4736
|
*/
|
|
4717
4737
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
4718
4738
|
/**
|
|
4719
4739
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
4720
|
-
* @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
|
|
4721
4741
|
*/
|
|
4722
4742
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
4723
4743
|
/**
|
|
4724
4744
|
* Prefer reading a JSON file as a buffer.
|
|
4725
|
-
* @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
|
|
4726
4746
|
*/
|
|
4727
4747
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
4728
4748
|
/**
|
|
4729
4749
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
4730
|
-
* @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
|
|
4731
4751
|
*/
|
|
4732
4752
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
4733
4753
|
/**
|
|
4734
4754
|
* Prefer using a logical operator over a ternary.
|
|
4735
|
-
* @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
|
|
4736
4756
|
*/
|
|
4737
4757
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
4738
4758
|
/**
|
|
4739
4759
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
4740
|
-
* @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
|
|
4741
4761
|
*/
|
|
4742
4762
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
4743
4763
|
/**
|
|
4744
4764
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
4745
|
-
* @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
|
|
4746
4766
|
*/
|
|
4747
4767
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
4748
4768
|
/**
|
|
4749
4769
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
4750
|
-
* @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
|
|
4751
4771
|
*/
|
|
4752
4772
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
4753
4773
|
/**
|
|
4754
4774
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
4755
|
-
* @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
|
|
4756
4776
|
*/
|
|
4757
4777
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
4758
4778
|
/**
|
|
4759
4779
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
4760
|
-
* @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
|
|
4761
4781
|
*/
|
|
4762
4782
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
4763
4783
|
/**
|
|
4764
4784
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
4765
|
-
* @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
|
|
4766
4786
|
*/
|
|
4767
4787
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
4768
4788
|
/**
|
|
4769
4789
|
* Prefer negative index over `.length - index` when possible.
|
|
4770
|
-
* @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
|
|
4771
4791
|
*/
|
|
4772
4792
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
4773
4793
|
/**
|
|
4774
4794
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
4775
|
-
* @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
|
|
4776
4796
|
*/
|
|
4777
4797
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
4778
4798
|
/**
|
|
4779
4799
|
* Prefer `Number` static properties over global ones.
|
|
4780
|
-
* @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
|
|
4781
4801
|
*/
|
|
4782
4802
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
4783
4803
|
/**
|
|
4784
4804
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
4785
|
-
* @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
|
|
4786
4806
|
*/
|
|
4787
4807
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
4788
4808
|
/**
|
|
4789
4809
|
* Prefer omitting the `catch` binding parameter.
|
|
4790
|
-
* @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
|
|
4791
4811
|
*/
|
|
4792
4812
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
4793
4813
|
/**
|
|
4794
4814
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
4795
|
-
* @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
|
|
4796
4816
|
*/
|
|
4797
4817
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
4798
4818
|
/**
|
|
4799
4819
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
4800
|
-
* @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
|
|
4801
4821
|
*/
|
|
4802
4822
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>
|
|
4803
4823
|
/**
|
|
4804
4824
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
4805
|
-
* @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
|
|
4806
4826
|
*/
|
|
4807
4827
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
4808
4828
|
/**
|
|
4809
4829
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
4810
|
-
* @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
|
|
4811
4831
|
*/
|
|
4812
4832
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
4813
4833
|
/**
|
|
4814
4834
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
4815
|
-
* @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
|
|
4816
4836
|
*/
|
|
4817
4837
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>
|
|
4818
4838
|
/**
|
|
4819
4839
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
4820
|
-
* @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
|
|
4821
4841
|
*/
|
|
4822
4842
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
4823
4843
|
/**
|
|
4824
4844
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
4825
|
-
* @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
|
|
4826
4846
|
*/
|
|
4827
4847
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
4828
4848
|
/**
|
|
4829
4849
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
4830
|
-
* @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
|
|
4831
4851
|
*/
|
|
4832
4852
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
4833
4853
|
/**
|
|
4834
4854
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
4835
|
-
* @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
|
|
4836
4856
|
*/
|
|
4837
4857
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
4838
4858
|
/**
|
|
4839
4859
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
4840
|
-
* @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
|
|
4841
4861
|
*/
|
|
4842
4862
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
4843
4863
|
/**
|
|
4844
4864
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
4845
|
-
* @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
|
|
4846
4866
|
*/
|
|
4847
4867
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
4848
4868
|
/**
|
|
4849
4869
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
4850
|
-
* @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
|
|
4851
4871
|
*/
|
|
4852
4872
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
4853
4873
|
/**
|
|
4854
4874
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
4855
|
-
* @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
|
|
4856
4876
|
*/
|
|
4857
4877
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
4858
4878
|
/**
|
|
4859
4879
|
* Prefer using `structuredClone` to create a deep clone.
|
|
4860
|
-
* @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
|
|
4861
4881
|
*/
|
|
4862
4882
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
4863
4883
|
/**
|
|
4864
4884
|
* Prefer `switch` over multiple `else-if`.
|
|
4865
|
-
* @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
|
|
4866
4886
|
*/
|
|
4867
4887
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
4868
4888
|
/**
|
|
4869
4889
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
4870
|
-
* @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
|
|
4871
4891
|
*/
|
|
4872
4892
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
4873
4893
|
/**
|
|
4874
4894
|
* Prefer top-level await over top-level promises and async function calls.
|
|
4875
|
-
* @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
|
|
4876
4896
|
*/
|
|
4877
4897
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
4878
4898
|
/**
|
|
4879
4899
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
4880
|
-
* @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
|
|
4881
4901
|
*/
|
|
4882
4902
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
4883
4903
|
/**
|
|
4884
4904
|
* Prevent abbreviations.
|
|
4885
|
-
* @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
|
|
4886
4906
|
*/
|
|
4887
4907
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
4888
4908
|
/**
|
|
4889
4909
|
* Enforce consistent relative URL style.
|
|
4890
|
-
* @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
|
|
4891
4911
|
*/
|
|
4892
4912
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
4893
4913
|
/**
|
|
4894
4914
|
* Enforce using the separator argument with `Array#join()`.
|
|
4895
|
-
* @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
|
|
4896
4916
|
*/
|
|
4897
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<[]>
|
|
4898
4923
|
/**
|
|
4899
4924
|
* Require non-empty specifier list in import and export statements.
|
|
4900
|
-
* @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
|
|
4901
4926
|
*/
|
|
4902
4927
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
4903
4928
|
/**
|
|
4904
4929
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
4905
|
-
* @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
|
|
4906
4931
|
*/
|
|
4907
4932
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
4908
4933
|
/**
|
|
4909
4934
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
4910
|
-
* @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
|
|
4911
4936
|
*/
|
|
4912
4937
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
4913
4938
|
/**
|
|
4914
4939
|
* Enforce better string content.
|
|
4915
|
-
* @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
|
|
4916
4941
|
*/
|
|
4917
4942
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
4918
4943
|
/**
|
|
4919
4944
|
* Enforce consistent brace style for `case` clauses.
|
|
4920
|
-
* @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
|
|
4921
4946
|
*/
|
|
4922
4947
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
4923
4948
|
/**
|
|
4924
4949
|
* Fix whitespace-insensitive template indentation.
|
|
4925
|
-
* @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
|
|
4926
4951
|
*/
|
|
4927
4952
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
4928
4953
|
/**
|
|
4929
4954
|
* Enforce consistent case for text encoding identifiers.
|
|
4930
|
-
* @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
|
|
4931
4956
|
*/
|
|
4932
4957
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>
|
|
4933
4958
|
/**
|
|
4934
4959
|
* Require `new` when creating an error.
|
|
4935
|
-
* @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
|
|
4936
4961
|
*/
|
|
4937
4962
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
4938
4963
|
/**
|
|
@@ -7248,6 +7273,10 @@ type IndentLegacy = []|[("tab" | number)]|[("tab" | number), {
|
|
|
7248
7273
|
type InitDeclarations = ([]|["always"] | []|["never"]|["never", {
|
|
7249
7274
|
ignoreForLoopInit?: boolean
|
|
7250
7275
|
}])
|
|
7276
|
+
// ----- jsdoc/check-alignment -----
|
|
7277
|
+
type JsdocCheckAlignment = []|[{
|
|
7278
|
+
innerIndent?: number
|
|
7279
|
+
}]
|
|
7251
7280
|
// ----- jsdoc/check-examples -----
|
|
7252
7281
|
type JsdocCheckExamples = []|[{
|
|
7253
7282
|
allowInlineConfig?: boolean
|
|
@@ -7537,6 +7566,7 @@ type JsdocRequireJsdoc = []|[{
|
|
|
7537
7566
|
enableFixer?: boolean
|
|
7538
7567
|
exemptEmptyConstructors?: boolean
|
|
7539
7568
|
exemptEmptyFunctions?: boolean
|
|
7569
|
+
exemptOverloadedImplementations?: boolean
|
|
7540
7570
|
fixerMessage?: string
|
|
7541
7571
|
minLineCount?: number
|
|
7542
7572
|
publicOnly?: (boolean | {
|
|
@@ -7553,6 +7583,7 @@ type JsdocRequireJsdoc = []|[{
|
|
|
7553
7583
|
FunctionExpression?: boolean
|
|
7554
7584
|
MethodDefinition?: boolean
|
|
7555
7585
|
}
|
|
7586
|
+
skipInterveningOverloadedDeclarations?: boolean
|
|
7556
7587
|
}]
|
|
7557
7588
|
// ----- jsdoc/require-param -----
|
|
7558
7589
|
type JsdocRequireParam = []|[{
|
|
@@ -12337,6 +12368,11 @@ type PreferReflect = []|[{
|
|
|
12337
12368
|
type PreferRegexLiterals = []|[{
|
|
12338
12369
|
disallowRedundantWrapping?: boolean
|
|
12339
12370
|
}]
|
|
12371
|
+
// ----- preserve-caught-error -----
|
|
12372
|
+
type PreserveCaughtError = []|[{
|
|
12373
|
+
|
|
12374
|
+
requireCatchParameter?: boolean
|
|
12375
|
+
}]
|
|
12340
12376
|
// ----- prettier/prettier -----
|
|
12341
12377
|
type PrettierPrettier = []|[{
|
|
12342
12378
|
[k: string]: unknown | undefined
|
|
@@ -12773,6 +12809,10 @@ type UnicornNoArrayReduce = []|[{
|
|
|
12773
12809
|
type UnicornNoArrayReverse = []|[{
|
|
12774
12810
|
allowExpressionStatement?: boolean
|
|
12775
12811
|
}]
|
|
12812
|
+
// ----- unicorn/no-array-sort -----
|
|
12813
|
+
type UnicornNoArraySort = []|[{
|
|
12814
|
+
allowExpressionStatement?: boolean
|
|
12815
|
+
}]
|
|
12776
12816
|
// ----- unicorn/no-instanceof-builtins -----
|
|
12777
12817
|
type UnicornNoInstanceofBuiltins = []|[{
|
|
12778
12818
|
useErrorIsError?: boolean
|
|
@@ -13333,8 +13373,8 @@ type ConfigNames =
|
|
|
13333
13373
|
| '@bfra.me/perfectionist'
|
|
13334
13374
|
| '@bfra.me/unicorn'
|
|
13335
13375
|
| '@bfra.me/typescript/plugins'
|
|
13336
|
-
| '@bfra.me/typescript/parser'
|
|
13337
13376
|
| '@bfra.me/typescript/type-aware-parser'
|
|
13377
|
+
| '@bfra.me/typescript/parser'
|
|
13338
13378
|
| '@bfra.me/typescript/rules'
|
|
13339
13379
|
| '@bfra.me/typescript/type-aware-rules'
|
|
13340
13380
|
| '@bfra.me/regexp'
|
|
@@ -13349,6 +13389,15 @@ type ConfigNames =
|
|
|
13349
13389
|
| '@bfra.me/jsonc/json-schema/unnamed2'
|
|
13350
13390
|
| '@bfra.me/jsonc/json-schema'
|
|
13351
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'
|
|
13352
13401
|
| '@bfra.me/pnpm/package-json'
|
|
13353
13402
|
| '@bfra.me/pnpm/pnpm-workspace-yaml'
|
|
13354
13403
|
| '@bfra.me/toml/plugins'
|
|
@@ -13502,6 +13551,48 @@ type RegexpOptions = OptionsOverrides;
|
|
|
13502
13551
|
*/
|
|
13503
13552
|
declare function regexp(options?: RegexpOptions): Promise<Config[]>;
|
|
13504
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
|
+
|
|
13505
13596
|
/**
|
|
13506
13597
|
* Represents the options for configuring TOML files in the ESLint configuration.
|
|
13507
13598
|
*/
|
|
@@ -13855,9 +13946,11 @@ declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
|
13855
13946
|
declare const GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
13856
13947
|
declare const GLOB_ASTRO = "**/*.astro";
|
|
13857
13948
|
declare const GLOB_ASTRO_TS = "**/*.astro/*.ts";
|
|
13949
|
+
declare const GLOB_RENOVATE_CONFIG: string[];
|
|
13950
|
+
declare const GLOB_TS_CONFIG: string[];
|
|
13858
13951
|
declare const GLOB_TESTS: string[];
|
|
13859
13952
|
declare const GLOB_EXCLUDE: string[];
|
|
13860
13953
|
|
|
13861
13954
|
declare const config: eslint_flat_config_utils.FlatConfigComposer<Config, ConfigNames>;
|
|
13862
13955
|
|
|
13863
|
-
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 };
|