@ntnyq/eslint-config 7.0.0-beta.2 → 7.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +399 -174
- package/dist/index.mjs +21 -6
- package/package.json +9 -9
package/dist/index.d.mts
CHANGED
|
@@ -515,6 +515,10 @@ declare const configImportX: (options?: ConfigImportXOptions) => TypedConfigItem
|
|
|
515
515
|
* Built-in presets of `eslint-plugin-unicorn`
|
|
516
516
|
*/
|
|
517
517
|
declare const PLUGIN_UNICORN_PRESET: readonly ['all', 'recommended', 'unopinionated'];
|
|
518
|
+
/**
|
|
519
|
+
* Type of built-in presets of `eslint-plugin-unicorn`
|
|
520
|
+
*/
|
|
521
|
+
type UnicornPreset = (typeof PLUGIN_UNICORN_PRESET)[number];
|
|
518
522
|
/**
|
|
519
523
|
* Options type of {@link configUnicorn}
|
|
520
524
|
*/
|
|
@@ -522,7 +526,7 @@ type ConfigUnicornOptions = OptionsOverrides & {
|
|
|
522
526
|
/**
|
|
523
527
|
* Use a built-in preset
|
|
524
528
|
*/
|
|
525
|
-
preset?:
|
|
529
|
+
preset?: UnicornPreset;
|
|
526
530
|
};
|
|
527
531
|
/**
|
|
528
532
|
* Config for powerful rules
|
|
@@ -6368,753 +6372,921 @@ interface RuleOptions {
|
|
|
6368
6372
|
*/
|
|
6369
6373
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
6370
6374
|
/**
|
|
6371
|
-
*
|
|
6372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6375
|
+
* Prefer better DOM traversal APIs.
|
|
6376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/better-dom-traversing.md
|
|
6377
|
+
*/
|
|
6378
|
+
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
6379
|
+
/**
|
|
6380
|
+
* Removed. Prefer `eslint-plugin-regexp`
|
|
6381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#better-regex
|
|
6382
|
+
* @deprecated
|
|
6373
6383
|
*/
|
|
6374
|
-
'unicorn/better-regex'?: Linter.RuleEntry<
|
|
6384
|
+
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
6375
6385
|
/**
|
|
6376
6386
|
* Enforce a specific parameter name in catch clauses.
|
|
6377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6387
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/catch-error-name.md
|
|
6378
6388
|
*/
|
|
6379
6389
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
6380
6390
|
/**
|
|
6381
6391
|
* Enforce consistent assertion style with `node:assert`.
|
|
6382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6392
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-assert.md
|
|
6383
6393
|
*/
|
|
6384
6394
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
6395
|
+
/**
|
|
6396
|
+
* Enforce consistent spelling of compound words in identifiers.
|
|
6397
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-compound-words.md
|
|
6398
|
+
*/
|
|
6399
|
+
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
6385
6400
|
/**
|
|
6386
6401
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6402
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-date-clone.md
|
|
6388
6403
|
*/
|
|
6389
6404
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
6390
6405
|
/**
|
|
6391
6406
|
* Use destructured variables over properties.
|
|
6392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6407
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-destructuring.md
|
|
6393
6408
|
*/
|
|
6394
6409
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
6395
6410
|
/**
|
|
6396
6411
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6412
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-empty-array-spread.md
|
|
6398
6413
|
*/
|
|
6399
6414
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
6400
6415
|
/**
|
|
6401
6416
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6417
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-existence-index-check.md
|
|
6403
6418
|
*/
|
|
6404
6419
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
6405
6420
|
/**
|
|
6406
6421
|
* Move function definitions to the highest possible scope.
|
|
6407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6422
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-function-scoping.md
|
|
6408
6423
|
*/
|
|
6409
6424
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
6425
|
+
/**
|
|
6426
|
+
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
6427
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-json-file-read.md
|
|
6428
|
+
*/
|
|
6429
|
+
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
6410
6430
|
/**
|
|
6411
6431
|
* Enforce consistent style for escaping `${` in template literals.
|
|
6412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6432
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-template-literal-escape.md
|
|
6413
6433
|
*/
|
|
6414
6434
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
6415
6435
|
/**
|
|
6416
6436
|
* Enforce correct `Error` subclassing.
|
|
6417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6437
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/custom-error-definition.md
|
|
6418
6438
|
*/
|
|
6419
6439
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
6440
|
+
/**
|
|
6441
|
+
* Enforce consistent style for DOM element dataset access.
|
|
6442
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/dom-node-dataset.md
|
|
6443
|
+
*/
|
|
6444
|
+
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
6420
6445
|
/**
|
|
6421
6446
|
* Enforce no spaces between braces.
|
|
6422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6447
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/empty-brace-spaces.md
|
|
6423
6448
|
*/
|
|
6424
6449
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
6425
6450
|
/**
|
|
6426
6451
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6452
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/error-message.md
|
|
6428
6453
|
*/
|
|
6429
6454
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
6430
6455
|
/**
|
|
6431
6456
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6457
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/escape-case.md
|
|
6433
6458
|
*/
|
|
6434
6459
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
6435
6460
|
/**
|
|
6436
6461
|
* Add expiration conditions to TODO comments.
|
|
6437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6462
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/expiring-todo-comments.md
|
|
6438
6463
|
*/
|
|
6439
6464
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
6440
6465
|
/**
|
|
6441
6466
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6467
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/explicit-length-check.md
|
|
6443
6468
|
*/
|
|
6444
6469
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
6445
6470
|
/**
|
|
6446
|
-
* Enforce a case style for filenames.
|
|
6447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6471
|
+
* Enforce a case style for filenames and directory names.
|
|
6472
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/filename-case.md
|
|
6448
6473
|
*/
|
|
6449
6474
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
6450
6475
|
/**
|
|
6451
6476
|
* Enforce specific import styles per module.
|
|
6452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6477
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/import-style.md
|
|
6453
6478
|
*/
|
|
6454
6479
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
6455
6480
|
/**
|
|
6456
6481
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
6457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6482
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/isolated-functions.md
|
|
6458
6483
|
*/
|
|
6459
6484
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
6460
6485
|
/**
|
|
6461
6486
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6487
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/new-for-builtins.md
|
|
6463
6488
|
*/
|
|
6464
6489
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
6465
6490
|
/**
|
|
6466
6491
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6492
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-abusive-eslint-disable.md
|
|
6468
6493
|
*/
|
|
6469
6494
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
6470
6495
|
/**
|
|
6471
6496
|
* Disallow recursive access to `this` within getters and setters.
|
|
6472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6497
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-accessor-recursion.md
|
|
6473
6498
|
*/
|
|
6474
6499
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
6475
6500
|
/**
|
|
6476
6501
|
* Disallow anonymous functions and classes as the default export.
|
|
6477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6502
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-anonymous-default-export.md
|
|
6478
6503
|
*/
|
|
6479
6504
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
6480
6505
|
/**
|
|
6481
6506
|
* Prevent passing a function reference directly to iterator methods.
|
|
6482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6507
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-callback-reference.md
|
|
6483
6508
|
*/
|
|
6484
|
-
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<
|
|
6509
|
+
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
6510
|
+
/**
|
|
6511
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
6512
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-fill-with-reference-type.md
|
|
6513
|
+
*/
|
|
6514
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
6485
6515
|
/**
|
|
6486
6516
|
* Prefer `for…of` over the `forEach` method.
|
|
6487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6517
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-for-each.md
|
|
6488
6518
|
*/
|
|
6489
6519
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
6520
|
+
/**
|
|
6521
|
+
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
6522
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-from-fill.md
|
|
6523
|
+
*/
|
|
6524
|
+
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
6490
6525
|
/**
|
|
6491
6526
|
* Disallow using the `this` argument in array methods.
|
|
6492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6527
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-method-this-argument.md
|
|
6493
6528
|
*/
|
|
6494
6529
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
6495
6530
|
/**
|
|
6496
6531
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6532
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
6498
6533
|
* @deprecated
|
|
6499
6534
|
*/
|
|
6500
6535
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
6501
6536
|
/**
|
|
6502
6537
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6503
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6538
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reduce.md
|
|
6504
6539
|
*/
|
|
6505
6540
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
6506
6541
|
/**
|
|
6507
6542
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6508
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6543
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reverse.md
|
|
6509
6544
|
*/
|
|
6510
6545
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
6511
6546
|
/**
|
|
6512
6547
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6513
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6548
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-sort.md
|
|
6514
6549
|
*/
|
|
6515
6550
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6516
6551
|
/**
|
|
6517
6552
|
* Disallow member access from await expression.
|
|
6518
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6553
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-expression-member.md
|
|
6519
6554
|
*/
|
|
6520
6555
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
6521
6556
|
/**
|
|
6522
6557
|
* Disallow using `await` in `Promise` method parameters.
|
|
6523
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6558
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-in-promise-methods.md
|
|
6524
6559
|
*/
|
|
6525
6560
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6561
|
+
/**
|
|
6562
|
+
* Disallow unnecessary `Blob` to `File` conversion.
|
|
6563
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-blob-to-file.md
|
|
6564
|
+
*/
|
|
6565
|
+
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
6566
|
+
/**
|
|
6567
|
+
* Prefer drawing canvases directly instead of converting them to images.
|
|
6568
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-canvas-to-image.md
|
|
6569
|
+
*/
|
|
6570
|
+
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
6571
|
+
/**
|
|
6572
|
+
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
6573
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-confusing-array-splice.md
|
|
6574
|
+
*/
|
|
6575
|
+
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
6526
6576
|
/**
|
|
6527
6577
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
6528
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6578
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-console-spaces.md
|
|
6529
6579
|
*/
|
|
6530
6580
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6531
6581
|
/**
|
|
6532
6582
|
* Do not use `document.cookie` directly.
|
|
6533
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6583
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-document-cookie.md
|
|
6534
6584
|
*/
|
|
6535
6585
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6586
|
+
/**
|
|
6587
|
+
* Disallow duplicate values in `Set` constructor array literals.
|
|
6588
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-duplicate-set-values.md
|
|
6589
|
+
*/
|
|
6590
|
+
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
6536
6591
|
/**
|
|
6537
6592
|
* Disallow empty files.
|
|
6538
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6593
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-empty-file.md
|
|
6539
6594
|
*/
|
|
6540
|
-
'unicorn/no-empty-file'?: Linter.RuleEntry<
|
|
6595
|
+
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
6596
|
+
/**
|
|
6597
|
+
* Disallow exports in scripts.
|
|
6598
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-exports-in-scripts.md
|
|
6599
|
+
*/
|
|
6600
|
+
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
6541
6601
|
/**
|
|
6542
6602
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
6543
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6603
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-for-loop.md
|
|
6544
6604
|
*/
|
|
6545
6605
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
6546
6606
|
/**
|
|
6547
6607
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
6548
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6608
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-hex-escape.md
|
|
6549
6609
|
*/
|
|
6550
6610
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
6551
6611
|
/**
|
|
6552
6612
|
* Disallow immediate mutation after variable assignment.
|
|
6553
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6613
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-immediate-mutation.md
|
|
6554
6614
|
*/
|
|
6555
6615
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
6616
|
+
/**
|
|
6617
|
+
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
6618
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-incorrect-query-selector.md
|
|
6619
|
+
*/
|
|
6620
|
+
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
6556
6621
|
/**
|
|
6557
6622
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
6558
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6623
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
6559
6624
|
* @deprecated
|
|
6560
6625
|
*/
|
|
6561
6626
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
6562
6627
|
/**
|
|
6563
6628
|
* Disallow `instanceof` with built-in objects
|
|
6564
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6629
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-instanceof-builtins.md
|
|
6565
6630
|
*/
|
|
6566
6631
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6567
6632
|
/**
|
|
6568
6633
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6569
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6634
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-fetch-options.md
|
|
6570
6635
|
*/
|
|
6571
6636
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6637
|
+
/**
|
|
6638
|
+
* Disallow invalid `accept` values on file inputs.
|
|
6639
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-file-input-accept.md
|
|
6640
|
+
*/
|
|
6641
|
+
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
6572
6642
|
/**
|
|
6573
6643
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6644
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-remove-event-listener.md
|
|
6575
6645
|
*/
|
|
6576
6646
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6577
6647
|
/**
|
|
6578
6648
|
* Disallow identifiers starting with `new` or `class`.
|
|
6579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6649
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-keyword-prefix.md
|
|
6580
6650
|
*/
|
|
6581
6651
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6652
|
+
/**
|
|
6653
|
+
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
6654
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-late-current-target-access.md
|
|
6655
|
+
*/
|
|
6656
|
+
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
6582
6657
|
/**
|
|
6583
6658
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6659
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
6585
6660
|
* @deprecated
|
|
6586
6661
|
*/
|
|
6587
6662
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6588
6663
|
/**
|
|
6589
6664
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6590
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-lonely-if.md
|
|
6591
6666
|
*/
|
|
6592
6667
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6593
6668
|
/**
|
|
6594
6669
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6595
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-magic-array-flat-depth.md
|
|
6596
6671
|
*/
|
|
6597
6672
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6673
|
+
/**
|
|
6674
|
+
* Disallow manually wrapped comments.
|
|
6675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-manually-wrapped-comments.md
|
|
6676
|
+
*/
|
|
6677
|
+
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
6598
6678
|
/**
|
|
6599
6679
|
* Disallow named usage of default import and export.
|
|
6600
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-named-default.md
|
|
6601
6681
|
*/
|
|
6602
6682
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6603
6683
|
/**
|
|
6604
6684
|
* Disallow negated conditions.
|
|
6605
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negated-condition.md
|
|
6606
6686
|
*/
|
|
6607
6687
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6608
6688
|
/**
|
|
6609
6689
|
* Disallow negated expression in equality check.
|
|
6610
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negation-in-equality-check.md
|
|
6611
6691
|
*/
|
|
6612
6692
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6613
6693
|
/**
|
|
6614
6694
|
* Disallow nested ternary expressions.
|
|
6615
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-nested-ternary.md
|
|
6616
6696
|
*/
|
|
6617
6697
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6618
6698
|
/**
|
|
6619
6699
|
* Disallow `new Array()`.
|
|
6620
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-array.md
|
|
6621
6701
|
*/
|
|
6622
6702
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6623
6703
|
/**
|
|
6624
6704
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6625
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-buffer.md
|
|
6626
6706
|
*/
|
|
6627
6707
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6628
6708
|
/**
|
|
6629
6709
|
* Disallow the use of the `null` literal.
|
|
6630
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-null.md
|
|
6631
6711
|
*/
|
|
6632
6712
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6633
6713
|
/**
|
|
6634
6714
|
* Disallow the use of objects as default parameters.
|
|
6635
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-object-as-default-parameter.md
|
|
6636
6716
|
*/
|
|
6637
6717
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6638
6718
|
/**
|
|
6639
6719
|
* Disallow `process.exit()`.
|
|
6640
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-process-exit.md
|
|
6641
6721
|
*/
|
|
6642
6722
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6643
6723
|
/**
|
|
6644
6724
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6645
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-single-promise-in-promise-methods.md
|
|
6646
6726
|
*/
|
|
6647
6727
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6648
6728
|
/**
|
|
6649
6729
|
* Disallow classes that only have static members.
|
|
6650
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-static-only-class.md
|
|
6651
6731
|
*/
|
|
6652
6732
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6653
6733
|
/**
|
|
6654
6734
|
* Disallow `then` property.
|
|
6655
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-thenable.md
|
|
6656
6736
|
*/
|
|
6657
6737
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6658
6738
|
/**
|
|
6659
6739
|
* Disallow assigning `this` to a variable.
|
|
6660
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-assignment.md
|
|
6661
6741
|
*/
|
|
6662
6742
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6743
|
+
/**
|
|
6744
|
+
* Disallow `this` outside of classes.
|
|
6745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-outside-of-class.md
|
|
6746
|
+
*/
|
|
6747
|
+
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
6663
6748
|
/**
|
|
6664
6749
|
* Disallow comparing `undefined` using `typeof`.
|
|
6665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-typeof-undefined.md
|
|
6666
6751
|
*/
|
|
6667
6752
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6668
6753
|
/**
|
|
6669
6754
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6671
6756
|
*/
|
|
6672
6757
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6673
6758
|
/**
|
|
6674
6759
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-splice-count.md
|
|
6676
6761
|
*/
|
|
6677
6762
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6678
6763
|
/**
|
|
6679
6764
|
* Disallow awaiting non-promise values.
|
|
6680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-await.md
|
|
6681
6766
|
*/
|
|
6682
6767
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6768
|
+
/**
|
|
6769
|
+
* Disallow unnecessary nested ternary expressions.
|
|
6770
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-nested-ternary.md
|
|
6771
|
+
*/
|
|
6772
|
+
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6683
6773
|
/**
|
|
6684
6774
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-polyfills.md
|
|
6686
6776
|
*/
|
|
6687
6777
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6688
6778
|
/**
|
|
6689
6779
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-slice-end.md
|
|
6691
6781
|
*/
|
|
6692
6782
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6693
6783
|
/**
|
|
6694
6784
|
* Disallow unreadable array destructuring.
|
|
6695
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-array-destructuring.md
|
|
6696
6786
|
*/
|
|
6697
6787
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
6698
6788
|
/**
|
|
6699
6789
|
* Disallow unreadable IIFEs.
|
|
6700
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-iife.md
|
|
6701
6791
|
*/
|
|
6702
6792
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6793
|
+
/**
|
|
6794
|
+
* Disallow ignoring the return value of selected array methods.
|
|
6795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-array-method-return.md
|
|
6796
|
+
*/
|
|
6797
|
+
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
6703
6798
|
/**
|
|
6704
6799
|
* Disallow unused object properties.
|
|
6705
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-properties.md
|
|
6706
6801
|
*/
|
|
6707
6802
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6708
6803
|
/**
|
|
6709
6804
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
6710
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-collection-argument.md
|
|
6711
6806
|
*/
|
|
6712
6807
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
6713
6808
|
/**
|
|
6714
6809
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6715
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6810
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6716
6811
|
*/
|
|
6717
6812
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6718
6813
|
/**
|
|
6719
6814
|
* Disallow useless fallback when spreading in object literals.
|
|
6720
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6815
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-fallback-in-spread.md
|
|
6721
6816
|
*/
|
|
6722
6817
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6723
6818
|
/**
|
|
6724
6819
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
6725
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6820
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-iterator-to-array.md
|
|
6726
6821
|
*/
|
|
6727
6822
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
6728
6823
|
/**
|
|
6729
6824
|
* Disallow useless array length check.
|
|
6730
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6825
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-length-check.md
|
|
6731
6826
|
*/
|
|
6732
6827
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6733
6828
|
/**
|
|
6734
6829
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6735
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6830
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-promise-resolve-reject.md
|
|
6736
6831
|
*/
|
|
6737
6832
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6738
6833
|
/**
|
|
6739
6834
|
* Disallow unnecessary spread.
|
|
6740
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6835
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-spread.md
|
|
6741
6836
|
*/
|
|
6742
6837
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6743
6838
|
/**
|
|
6744
6839
|
* Disallow useless case in switch statements.
|
|
6745
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6840
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-switch-case.md
|
|
6746
6841
|
*/
|
|
6747
6842
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6748
6843
|
/**
|
|
6749
6844
|
* Disallow useless `undefined`.
|
|
6750
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6845
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-undefined.md
|
|
6751
6846
|
*/
|
|
6752
6847
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6753
6848
|
/**
|
|
6754
6849
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6755
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-zero-fractions.md
|
|
6756
6851
|
*/
|
|
6757
6852
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6758
6853
|
/**
|
|
6759
6854
|
* Enforce proper case for numeric literals.
|
|
6760
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6855
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/number-literal-case.md
|
|
6761
6856
|
*/
|
|
6762
6857
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6763
6858
|
/**
|
|
6764
6859
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6860
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/numeric-separators-style.md
|
|
6766
6861
|
*/
|
|
6767
6862
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6768
6863
|
/**
|
|
6769
6864
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6770
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6865
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-add-event-listener.md
|
|
6771
6866
|
*/
|
|
6772
6867
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6773
6868
|
/**
|
|
6774
6869
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6775
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6870
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-find.md
|
|
6776
6871
|
*/
|
|
6777
6872
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6778
6873
|
/**
|
|
6779
6874
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6780
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6875
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat.md
|
|
6781
6876
|
*/
|
|
6782
6877
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6783
6878
|
/**
|
|
6784
6879
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6785
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6880
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat-map.md
|
|
6786
6881
|
*/
|
|
6787
6882
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6788
6883
|
/**
|
|
6789
6884
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6790
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6885
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-index-of.md
|
|
6791
6886
|
*/
|
|
6792
6887
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6888
|
+
/**
|
|
6889
|
+
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
6890
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-last-methods.md
|
|
6891
|
+
*/
|
|
6892
|
+
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
6793
6893
|
/**
|
|
6794
6894
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6795
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6895
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-some.md
|
|
6796
6896
|
*/
|
|
6797
6897
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6798
6898
|
/**
|
|
6799
6899
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6800
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6900
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-at.md
|
|
6801
6901
|
*/
|
|
6802
6902
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6803
6903
|
/**
|
|
6804
6904
|
* Prefer `BigInt` literals over the constructor.
|
|
6805
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6905
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-bigint-literals.md
|
|
6806
6906
|
*/
|
|
6807
6907
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6808
6908
|
/**
|
|
6809
6909
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6810
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6910
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-blob-reading-methods.md
|
|
6811
6911
|
*/
|
|
6812
6912
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6813
6913
|
/**
|
|
6814
6914
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6815
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6915
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-class-fields.md
|
|
6816
6916
|
*/
|
|
6817
6917
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6818
6918
|
/**
|
|
6819
6919
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6820
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6920
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-classlist-toggle.md
|
|
6821
6921
|
*/
|
|
6822
6922
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6823
6923
|
/**
|
|
6824
6924
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6825
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6925
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-code-point.md
|
|
6826
6926
|
*/
|
|
6827
6927
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6828
6928
|
/**
|
|
6829
6929
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6830
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6930
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-date-now.md
|
|
6831
6931
|
*/
|
|
6832
6932
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6833
6933
|
/**
|
|
6834
6934
|
* Prefer default parameters over reassignment.
|
|
6835
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6935
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-default-parameters.md
|
|
6836
6936
|
*/
|
|
6837
6937
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6838
6938
|
/**
|
|
6839
|
-
* Prefer `
|
|
6840
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6939
|
+
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
6940
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-append.md
|
|
6841
6941
|
*/
|
|
6842
6942
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6843
6943
|
/**
|
|
6844
|
-
*
|
|
6845
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6944
|
+
* Renamed to `unicorn/dom-node-dataset`.
|
|
6945
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
6946
|
+
* @deprecated
|
|
6846
6947
|
*/
|
|
6847
6948
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6848
6949
|
/**
|
|
6849
6950
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6850
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6951
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-remove.md
|
|
6851
6952
|
*/
|
|
6852
6953
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6853
6954
|
/**
|
|
6854
6955
|
* Prefer `.textContent` over `.innerText`.
|
|
6855
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6956
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-text-content.md
|
|
6856
6957
|
*/
|
|
6857
6958
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6858
6959
|
/**
|
|
6859
6960
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6860
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6961
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-event-target.md
|
|
6861
6962
|
*/
|
|
6862
6963
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6863
6964
|
/**
|
|
6864
6965
|
* Prefer `export…from` when re-exporting.
|
|
6865
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6966
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-export-from.md
|
|
6866
6967
|
*/
|
|
6867
6968
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6969
|
+
/**
|
|
6970
|
+
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
6971
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-get-or-insert-computed.md
|
|
6972
|
+
*/
|
|
6973
|
+
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
6868
6974
|
/**
|
|
6869
6975
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6870
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6976
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-global-this.md
|
|
6871
6977
|
*/
|
|
6872
6978
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6979
|
+
/**
|
|
6980
|
+
* Prefer HTTPS over HTTP.
|
|
6981
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-https.md
|
|
6982
|
+
*/
|
|
6983
|
+
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
6873
6984
|
/**
|
|
6874
6985
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6875
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6986
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-import-meta-properties.md
|
|
6876
6987
|
*/
|
|
6877
6988
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6878
6989
|
/**
|
|
6879
6990
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6880
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6991
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes.md
|
|
6881
6992
|
*/
|
|
6882
6993
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6883
6994
|
/**
|
|
6884
|
-
* Prefer
|
|
6885
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6995
|
+
* Prefer `.includes()` over repeated equality comparisons.
|
|
6996
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
6997
|
+
*/
|
|
6998
|
+
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
6999
|
+
/**
|
|
7000
|
+
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
7001
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-concat.md
|
|
7002
|
+
*/
|
|
7003
|
+
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
7004
|
+
/**
|
|
7005
|
+
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
7006
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-to-array-at-end.md
|
|
7007
|
+
*/
|
|
7008
|
+
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
7009
|
+
/**
|
|
7010
|
+
* Renamed to `unicorn/consistent-json-file-read`.
|
|
7011
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
7012
|
+
* @deprecated
|
|
6886
7013
|
*/
|
|
6887
7014
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6888
7015
|
/**
|
|
6889
|
-
* Prefer `KeyboardEvent#key` over
|
|
6890
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7016
|
+
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
7017
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-keyboard-event-key.md
|
|
6891
7018
|
*/
|
|
6892
7019
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6893
7020
|
/**
|
|
6894
7021
|
* Prefer using a logical operator over a ternary.
|
|
6895
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7022
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6896
7023
|
*/
|
|
6897
7024
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
7025
|
+
/**
|
|
7026
|
+
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
7027
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-abs.md
|
|
7028
|
+
*/
|
|
7029
|
+
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
6898
7030
|
/**
|
|
6899
7031
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6900
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7032
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-min-max.md
|
|
6901
7033
|
*/
|
|
6902
7034
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6903
7035
|
/**
|
|
6904
7036
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6905
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7037
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-trunc.md
|
|
6906
7038
|
*/
|
|
6907
7039
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6908
7040
|
/**
|
|
6909
7041
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6910
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7042
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-dom-apis.md
|
|
6911
7043
|
*/
|
|
6912
7044
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6913
7045
|
/**
|
|
6914
7046
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7047
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-math-apis.md
|
|
6916
7048
|
*/
|
|
6917
7049
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6918
7050
|
/**
|
|
6919
7051
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6920
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7052
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-module.md
|
|
6921
7053
|
*/
|
|
6922
7054
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6923
7055
|
/**
|
|
6924
7056
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6925
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7057
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-native-coercion-functions.md
|
|
6926
7058
|
*/
|
|
6927
7059
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6928
7060
|
/**
|
|
6929
7061
|
* Prefer negative index over `.length - index` when possible.
|
|
6930
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7062
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-negative-index.md
|
|
6931
7063
|
*/
|
|
6932
7064
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6933
7065
|
/**
|
|
6934
7066
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6935
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7067
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-node-protocol.md
|
|
6936
7068
|
*/
|
|
6937
7069
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6938
7070
|
/**
|
|
6939
7071
|
* Prefer `Number` static properties over global ones.
|
|
6940
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7072
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-number-properties.md
|
|
6941
7073
|
*/
|
|
6942
7074
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6943
7075
|
/**
|
|
6944
7076
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6945
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7077
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-object-from-entries.md
|
|
6946
7078
|
*/
|
|
6947
7079
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6948
7080
|
/**
|
|
6949
7081
|
* Prefer omitting the `catch` binding parameter.
|
|
6950
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7082
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-optional-catch-binding.md
|
|
6951
7083
|
*/
|
|
6952
7084
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6953
7085
|
/**
|
|
6954
7086
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6955
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7087
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-prototype-methods.md
|
|
6956
7088
|
*/
|
|
6957
7089
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6958
7090
|
/**
|
|
6959
|
-
* Prefer `.querySelector()`
|
|
6960
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7091
|
+
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
7092
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-query-selector.md
|
|
7093
|
+
*/
|
|
7094
|
+
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
7095
|
+
/**
|
|
7096
|
+
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
7097
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-queue-microtask.md
|
|
6961
7098
|
*/
|
|
6962
|
-
'unicorn/prefer-
|
|
7099
|
+
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
6963
7100
|
/**
|
|
6964
7101
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6965
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7102
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-reflect-apply.md
|
|
6966
7103
|
*/
|
|
6967
7104
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6968
7105
|
/**
|
|
6969
7106
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6970
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7107
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-regexp-test.md
|
|
6971
7108
|
*/
|
|
6972
7109
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6973
7110
|
/**
|
|
6974
7111
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6975
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7112
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-response-static-json.md
|
|
6976
7113
|
*/
|
|
6977
7114
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
6978
7115
|
/**
|
|
6979
7116
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6980
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7117
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-has.md
|
|
6981
7118
|
*/
|
|
6982
|
-
'unicorn/prefer-set-has'?: Linter.RuleEntry<
|
|
7119
|
+
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
6983
7120
|
/**
|
|
6984
7121
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6985
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7122
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-size.md
|
|
6986
7123
|
*/
|
|
6987
7124
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6988
7125
|
/**
|
|
6989
7126
|
* Prefer simple conditions first in logical expressions.
|
|
6990
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7127
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-simple-condition-first.md
|
|
6991
7128
|
*/
|
|
6992
7129
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
6993
7130
|
/**
|
|
6994
|
-
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6995
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7131
|
+
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
7132
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-single-call.md
|
|
6996
7133
|
*/
|
|
6997
7134
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
7135
|
+
/**
|
|
7136
|
+
* Prefer `String#split()` with a limit.
|
|
7137
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-split-limit.md
|
|
7138
|
+
*/
|
|
7139
|
+
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
6998
7140
|
/**
|
|
6999
7141
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
7000
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7142
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-spread.md
|
|
7001
7143
|
*/
|
|
7002
7144
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
7145
|
+
/**
|
|
7146
|
+
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
7147
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-match-all.md
|
|
7148
|
+
*/
|
|
7149
|
+
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
7150
|
+
/**
|
|
7151
|
+
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
7152
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-pad-start-end.md
|
|
7153
|
+
*/
|
|
7154
|
+
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
7003
7155
|
/**
|
|
7004
7156
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
7005
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7157
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-raw.md
|
|
7006
7158
|
*/
|
|
7007
7159
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
7008
7160
|
/**
|
|
7009
|
-
* Prefer `String#
|
|
7010
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7161
|
+
* Prefer `String#repeat()` for repeated whitespace.
|
|
7162
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-repeat.md
|
|
7163
|
+
*/
|
|
7164
|
+
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
7165
|
+
/**
|
|
7166
|
+
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
7167
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-replace-all.md
|
|
7011
7168
|
*/
|
|
7012
7169
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
7013
7170
|
/**
|
|
7014
7171
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
7015
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7172
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-slice.md
|
|
7016
7173
|
*/
|
|
7017
7174
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
7018
7175
|
/**
|
|
7019
7176
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
7020
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7177
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-starts-ends-with.md
|
|
7021
7178
|
*/
|
|
7022
7179
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
7023
7180
|
/**
|
|
7024
7181
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
7025
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7182
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-trim-start-end.md
|
|
7026
7183
|
*/
|
|
7027
7184
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
7028
7185
|
/**
|
|
7029
7186
|
* Prefer using `structuredClone` to create a deep clone.
|
|
7030
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7187
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-structured-clone.md
|
|
7031
7188
|
*/
|
|
7032
7189
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
7033
7190
|
/**
|
|
7034
7191
|
* Prefer `switch` over multiple `else-if`.
|
|
7035
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7192
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-switch.md
|
|
7036
7193
|
*/
|
|
7037
7194
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
7038
7195
|
/**
|
|
7039
7196
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
7040
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7197
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-ternary.md
|
|
7041
7198
|
*/
|
|
7042
7199
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
7043
7200
|
/**
|
|
7044
7201
|
* Prefer top-level await over top-level promises and async function calls.
|
|
7045
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7202
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-top-level-await.md
|
|
7046
7203
|
*/
|
|
7047
7204
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
7048
7205
|
/**
|
|
7049
7206
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
7050
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7207
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-type-error.md
|
|
7051
7208
|
*/
|
|
7052
7209
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
7053
7210
|
/**
|
|
7054
7211
|
* Prevent abbreviations.
|
|
7055
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7212
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prevent-abbreviations.md
|
|
7056
7213
|
*/
|
|
7057
7214
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
7058
7215
|
/**
|
|
7059
7216
|
* Enforce consistent relative URL style.
|
|
7060
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7217
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/relative-url-style.md
|
|
7061
7218
|
*/
|
|
7062
7219
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
7063
7220
|
/**
|
|
7064
7221
|
* Enforce using the separator argument with `Array#join()`.
|
|
7065
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7222
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-array-join-separator.md
|
|
7066
7223
|
*/
|
|
7067
7224
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
7225
|
+
/**
|
|
7226
|
+
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
7227
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-css-escape.md
|
|
7228
|
+
*/
|
|
7229
|
+
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
7068
7230
|
/**
|
|
7069
7231
|
* Require non-empty module attributes for imports and exports
|
|
7070
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7232
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-attributes.md
|
|
7071
7233
|
*/
|
|
7072
7234
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
7073
7235
|
/**
|
|
7074
7236
|
* Require non-empty specifier list in import and export statements.
|
|
7075
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7237
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-specifiers.md
|
|
7076
7238
|
*/
|
|
7077
7239
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
7078
7240
|
/**
|
|
7079
7241
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
7080
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7242
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-number-to-fixed-digits-argument.md
|
|
7081
7243
|
*/
|
|
7082
7244
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
7245
|
+
/**
|
|
7246
|
+
* Require passive event listeners for high-frequency events.
|
|
7247
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-passive-events.md
|
|
7248
|
+
*/
|
|
7249
|
+
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
7083
7250
|
/**
|
|
7084
7251
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
7085
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-post-message-target-origin.md
|
|
7086
7253
|
*/
|
|
7087
7254
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
7088
7255
|
/**
|
|
7089
7256
|
* Enforce better string content.
|
|
7090
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/string-content.md
|
|
7091
7258
|
*/
|
|
7092
7259
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
7093
7260
|
/**
|
|
7094
7261
|
* Enforce consistent brace style for `case` clauses.
|
|
7095
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-braces.md
|
|
7096
7263
|
*/
|
|
7097
7264
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
7098
7265
|
/**
|
|
7099
7266
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
7100
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-break-position.md
|
|
7101
7268
|
*/
|
|
7102
7269
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
7103
7270
|
/**
|
|
7104
7271
|
* Fix whitespace-insensitive template indentation.
|
|
7105
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/template-indent.md
|
|
7106
7273
|
*/
|
|
7107
7274
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
7108
7275
|
/**
|
|
7109
7276
|
* Enforce consistent case for text encoding identifiers.
|
|
7110
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/text-encoding-identifier-case.md
|
|
7111
7278
|
*/
|
|
7112
7279
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
7113
7280
|
/**
|
|
7114
7281
|
* Require `new` when creating an error.
|
|
7115
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
7282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/throw-new-error.md
|
|
7116
7283
|
*/
|
|
7117
7284
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
7285
|
+
/**
|
|
7286
|
+
* Limit the complexity of `try` blocks.
|
|
7287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/try-complexity.md
|
|
7288
|
+
*/
|
|
7289
|
+
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
7118
7290
|
/**
|
|
7119
7291
|
* Utilities in UnoCSS blocklist
|
|
7120
7292
|
* @see https://unocss.dev/integrations/eslint#rules
|
|
@@ -9004,6 +9176,7 @@ type EslintCommunityEslintCommentsRequireDescription = [] | [{
|
|
|
9004
9176
|
type HtmlEslintAttrsNewline = [] | [{
|
|
9005
9177
|
closeStyle?: ("newline" | "sameline");
|
|
9006
9178
|
ifAttrsMoreThan?: number;
|
|
9179
|
+
maxLen?: number;
|
|
9007
9180
|
skip?: string[];
|
|
9008
9181
|
inline?: string[];
|
|
9009
9182
|
}]; // ----- @html-eslint/element-newline -----
|
|
@@ -9099,6 +9272,7 @@ type HtmlEslintRequireOpenGraphProtocol = [] | [string[]]; // ----- @html-eslint
|
|
|
9099
9272
|
type HtmlEslintSortAttrs = [] | [{
|
|
9100
9273
|
priority?: (string | {
|
|
9101
9274
|
pattern: string;
|
|
9275
|
+
order?: ("preserve" | "alphabetically");
|
|
9102
9276
|
})[];
|
|
9103
9277
|
}]; // ----- @html-eslint/use-baseline -----
|
|
9104
9278
|
type HtmlEslintUseBaseline = [] | [{
|
|
@@ -16342,23 +16516,40 @@ type TomlSpacedComment = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16342
16516
|
markers?: string[];
|
|
16343
16517
|
}]; // ----- toml/table-bracket-spacing -----
|
|
16344
16518
|
type TomlTableBracketSpacing = [] | [("always" | "never")]; // ----- unicode-bom -----
|
|
16345
|
-
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/
|
|
16346
|
-
type UnicornBetterRegex = [] | [{
|
|
16347
|
-
sortCharacterClasses?: boolean;
|
|
16348
|
-
}]; // ----- unicorn/catch-error-name -----
|
|
16519
|
+
type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/catch-error-name -----
|
|
16349
16520
|
type UnicornCatchErrorName = [] | [{
|
|
16350
16521
|
name?: string;
|
|
16351
16522
|
ignore?: unknown[];
|
|
16352
|
-
}]; // ----- unicorn/consistent-
|
|
16523
|
+
}]; // ----- unicorn/consistent-compound-words -----
|
|
16524
|
+
type UnicornConsistentCompoundWords = [] | [{
|
|
16525
|
+
checkProperties?: boolean;
|
|
16526
|
+
checkVariables?: boolean;
|
|
16527
|
+
checkDefaultAndNamespaceImports?: (boolean | "internal");
|
|
16528
|
+
checkShorthandImports?: (boolean | "internal");
|
|
16529
|
+
checkShorthandProperties?: boolean;
|
|
16530
|
+
extendDefaultReplacements?: boolean;
|
|
16531
|
+
replacements?: _UnicornConsistentCompoundWords_Replacements;
|
|
16532
|
+
allowList?: _UnicornConsistentCompoundWords_TrueObject;
|
|
16533
|
+
}];
|
|
16534
|
+
interface _UnicornConsistentCompoundWords_Replacements {
|
|
16535
|
+
[k: string]: (false | string) | undefined;
|
|
16536
|
+
}
|
|
16537
|
+
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
16538
|
+
[k: string]: true | undefined;
|
|
16539
|
+
} // ----- unicorn/consistent-function-scoping -----
|
|
16353
16540
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
16354
16541
|
checkArrowFunctions?: boolean;
|
|
16542
|
+
}]; // ----- unicorn/consistent-json-file-read -----
|
|
16543
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/dom-node-dataset -----
|
|
16544
|
+
type UnicornDomNodeDataset = [] | [{
|
|
16545
|
+
preferAttributes?: boolean;
|
|
16355
16546
|
}]; // ----- unicorn/escape-case -----
|
|
16356
16547
|
type UnicornEscapeCase = [] | [("uppercase" | "lowercase")]; // ----- unicorn/expiring-todo-comments -----
|
|
16357
16548
|
type UnicornExpiringTodoComments = [] | [{
|
|
16358
16549
|
terms?: string[];
|
|
16359
16550
|
ignore?: unknown[];
|
|
16360
|
-
|
|
16361
|
-
|
|
16551
|
+
checkDates?: boolean;
|
|
16552
|
+
checkDatesOnPullRequests?: boolean;
|
|
16362
16553
|
allowWarningComments?: boolean;
|
|
16363
16554
|
date?: string;
|
|
16364
16555
|
}]; // ----- unicorn/explicit-length-check -----
|
|
@@ -16369,6 +16560,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
16369
16560
|
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
16370
16561
|
ignore?: unknown[];
|
|
16371
16562
|
multipleFileExtensions?: boolean;
|
|
16563
|
+
checkDirectories?: boolean;
|
|
16372
16564
|
} | {
|
|
16373
16565
|
cases?: {
|
|
16374
16566
|
camelCase?: boolean;
|
|
@@ -16378,6 +16570,7 @@ type UnicornFilenameCase = [] | [({
|
|
|
16378
16570
|
};
|
|
16379
16571
|
ignore?: unknown[];
|
|
16380
16572
|
multipleFileExtensions?: boolean;
|
|
16573
|
+
checkDirectories?: boolean;
|
|
16381
16574
|
})]; // ----- unicorn/import-style -----
|
|
16382
16575
|
type UnicornImportStyle = [] | [{
|
|
16383
16576
|
checkImport?: boolean;
|
|
@@ -16401,6 +16594,9 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
16401
16594
|
functions?: string[];
|
|
16402
16595
|
selectors?: string[];
|
|
16403
16596
|
comments?: string[];
|
|
16597
|
+
}]; // ----- unicorn/no-array-callback-reference -----
|
|
16598
|
+
type UnicornNoArrayCallbackReference = [] | [{
|
|
16599
|
+
ignore?: string[];
|
|
16404
16600
|
}]; // ----- unicorn/no-array-reduce -----
|
|
16405
16601
|
type UnicornNoArrayReduce = [] | [{
|
|
16406
16602
|
allowSimpleOperations?: boolean;
|
|
@@ -16410,6 +16606,9 @@ type UnicornNoArrayReverse = [] | [{
|
|
|
16410
16606
|
}]; // ----- unicorn/no-array-sort -----
|
|
16411
16607
|
type UnicornNoArraySort = [] | [{
|
|
16412
16608
|
allowExpressionStatement?: boolean;
|
|
16609
|
+
}]; // ----- unicorn/no-empty-file -----
|
|
16610
|
+
type UnicornNoEmptyFile = [] | [{
|
|
16611
|
+
allowComments?: boolean;
|
|
16413
16612
|
}]; // ----- unicorn/no-instanceof-builtins -----
|
|
16414
16613
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
16415
16614
|
useErrorIsError?: boolean;
|
|
@@ -16423,13 +16622,14 @@ type UnicornNoKeywordPrefix = [] | [{
|
|
|
16423
16622
|
onlyCamelCase?: boolean;
|
|
16424
16623
|
}]; // ----- unicorn/no-null -----
|
|
16425
16624
|
type UnicornNoNull = [] | [{
|
|
16625
|
+
checkArguments?: boolean;
|
|
16426
16626
|
checkStrictEquality?: boolean;
|
|
16427
16627
|
}]; // ----- unicorn/no-typeof-undefined -----
|
|
16428
16628
|
type UnicornNoTypeofUndefined = [] | [{
|
|
16429
16629
|
checkGlobalVariables?: boolean;
|
|
16430
16630
|
}]; // ----- unicorn/no-unnecessary-polyfills -----
|
|
16431
16631
|
type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
16432
|
-
targets
|
|
16632
|
+
targets?: (string | unknown[] | {
|
|
16433
16633
|
[k: string]: unknown | undefined;
|
|
16434
16634
|
});
|
|
16435
16635
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
@@ -16460,6 +16660,7 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
16460
16660
|
onlyIfContainsSeparator?: boolean;
|
|
16461
16661
|
minimumDigits?: number;
|
|
16462
16662
|
groupLength?: number;
|
|
16663
|
+
fractionGroupLength?: number;
|
|
16463
16664
|
};
|
|
16464
16665
|
onlyIfContainsSeparator?: boolean;
|
|
16465
16666
|
}]; // ----- unicorn/prefer-add-event-listener -----
|
|
@@ -16477,7 +16678,10 @@ type UnicornPreferAt = [] | [{
|
|
|
16477
16678
|
checkAllIndexAccess?: boolean;
|
|
16478
16679
|
}]; // ----- unicorn/prefer-export-from -----
|
|
16479
16680
|
type UnicornPreferExportFrom = [] | [{
|
|
16480
|
-
|
|
16681
|
+
checkUsedVariables?: boolean;
|
|
16682
|
+
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
16683
|
+
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
16684
|
+
minimumComparisons?: number;
|
|
16481
16685
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
16482
16686
|
type UnicornPreferNumberProperties = [] | [{
|
|
16483
16687
|
checkInfinity?: boolean;
|
|
@@ -16485,9 +16689,22 @@ type UnicornPreferNumberProperties = [] | [{
|
|
|
16485
16689
|
}]; // ----- unicorn/prefer-object-from-entries -----
|
|
16486
16690
|
type UnicornPreferObjectFromEntries = [] | [{
|
|
16487
16691
|
functions?: unknown[];
|
|
16692
|
+
}]; // ----- unicorn/prefer-query-selector -----
|
|
16693
|
+
type UnicornPreferQuerySelector = [] | [{
|
|
16694
|
+
allowWithVariables?: boolean;
|
|
16695
|
+
}]; // ----- unicorn/prefer-queue-microtask -----
|
|
16696
|
+
type UnicornPreferQueueMicrotask = [] | [{
|
|
16697
|
+
checkSetImmediate?: boolean;
|
|
16698
|
+
checkSetTimeout?: boolean;
|
|
16699
|
+
}]; // ----- unicorn/prefer-set-has -----
|
|
16700
|
+
type UnicornPreferSetHas = [] | [{
|
|
16701
|
+
minimumItems?: number;
|
|
16488
16702
|
}]; // ----- unicorn/prefer-single-call -----
|
|
16489
16703
|
type UnicornPreferSingleCall = [] | [{
|
|
16490
16704
|
ignore?: unknown[];
|
|
16705
|
+
}]; // ----- unicorn/prefer-string-repeat -----
|
|
16706
|
+
type UnicornPreferStringRepeat = [] | [{
|
|
16707
|
+
minimumRepetitions?: number;
|
|
16491
16708
|
}]; // ----- unicorn/prefer-structured-clone -----
|
|
16492
16709
|
type UnicornPreferStructuredClone = [] | [{
|
|
16493
16710
|
functions?: unknown[];
|
|
@@ -16520,15 +16737,20 @@ interface _UnicornPreventAbbreviations_BooleanObject {
|
|
|
16520
16737
|
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
16521
16738
|
[k: string]: boolean | undefined;
|
|
16522
16739
|
} // ----- unicorn/relative-url-style -----
|
|
16523
|
-
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/
|
|
16740
|
+
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
16741
|
+
type UnicornRequireCssEscape = [] | [{
|
|
16742
|
+
checkAllSelectors?: boolean;
|
|
16743
|
+
}]; // ----- unicorn/string-content -----
|
|
16524
16744
|
type UnicornStringContent = [] | [{
|
|
16525
16745
|
patterns?: {
|
|
16526
16746
|
[k: string]: (string | {
|
|
16527
16747
|
suggest: string;
|
|
16528
16748
|
fix?: boolean;
|
|
16749
|
+
caseSensitive?: boolean;
|
|
16529
16750
|
message?: string;
|
|
16530
16751
|
}) | undefined;
|
|
16531
16752
|
};
|
|
16753
|
+
selectors?: string[];
|
|
16532
16754
|
}]; // ----- unicorn/switch-case-braces -----
|
|
16533
16755
|
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
16534
16756
|
type UnicornTemplateIndent = [] | [{
|
|
@@ -16540,6 +16762,9 @@ type UnicornTemplateIndent = [] | [{
|
|
|
16540
16762
|
}]; // ----- unicorn/text-encoding-identifier-case -----
|
|
16541
16763
|
type UnicornTextEncodingIdentifierCase = [] | [{
|
|
16542
16764
|
withDash?: boolean;
|
|
16765
|
+
}]; // ----- unicorn/try-complexity -----
|
|
16766
|
+
type UnicornTryComplexity = [] | [{
|
|
16767
|
+
max?: number;
|
|
16543
16768
|
}]; // ----- unocss/enforce-class-compile -----
|
|
16544
16769
|
type UnocssEnforceClassCompile = [] | [{
|
|
16545
16770
|
prefix?: string;
|