@eienjs/eslint-config 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.mjs +3 -0
- package/dist/cli/{constants.js → constants.mjs} +3 -0
- package/dist/cli/{constants_generated.js → constants_generated.mjs} +6 -3
- package/dist/cli/index.d.mts +2 -0
- package/dist/cli/{index.js → index.mjs} +5 -2
- package/dist/cli/{run.js → run.mjs} +12 -9
- package/dist/cli/stages/{update_eslint_files.js → update_eslint_files.mjs} +4 -1
- package/dist/cli/stages/{update_package_json.js → update_package_json.mjs} +15 -13
- package/dist/cli/stages/{update_vscode_settings.js → update_vscode_settings.mjs} +5 -2
- package/dist/cli/{utils.js → utils.mjs} +3 -0
- package/dist/config_presets.d.mts +9 -0
- package/dist/{config_presets.js → config_presets.mjs} +3 -0
- package/dist/configs/adonisjs.d.mts +8 -0
- package/dist/configs/{adonisjs.js → adonisjs.mjs} +27 -24
- package/dist/configs/{astro.d.ts → astro.d.mts} +3 -1
- package/dist/configs/{astro.js → astro.mjs} +6 -3
- package/dist/configs/command.d.mts +8 -0
- package/dist/configs/{command.js → command.mjs} +3 -0
- package/dist/configs/comments.d.mts +8 -0
- package/dist/configs/{comments.js → comments.mjs} +4 -1
- package/dist/configs/disables.d.mts +8 -0
- package/dist/configs/{disables.js → disables.mjs} +4 -1
- package/dist/configs/e18e.d.mts +8 -0
- package/dist/configs/{e18e.js → e18e.mjs} +7 -4
- package/dist/configs/{formatters.d.ts → formatters.d.mts} +3 -1
- package/dist/configs/{formatters.js → formatters.mjs} +6 -3
- package/dist/configs/ignores.d.mts +8 -0
- package/dist/configs/{ignores.js → ignores.mjs} +6 -3
- package/dist/configs/{imports.d.ts → imports.d.mts} +3 -1
- package/dist/configs/{imports.js → imports.mjs} +5 -2
- package/dist/configs/index.d.mts +29 -0
- package/dist/configs/index.mjs +30 -0
- package/dist/configs/{javascript.d.ts → javascript.d.mts} +3 -1
- package/dist/configs/{javascript.js → javascript.mjs} +4 -1
- package/dist/configs/{jsdoc.d.ts → jsdoc.d.mts} +3 -1
- package/dist/configs/{jsdoc.js → jsdoc.mjs} +7 -4
- package/dist/configs/{jsonc.d.ts → jsonc.d.mts} +3 -1
- package/dist/configs/{jsonc.js → jsonc.mjs} +7 -4
- package/dist/configs/{markdown.d.ts → markdown.d.mts} +3 -1
- package/dist/configs/{markdown.js → markdown.mjs} +5 -2
- package/dist/configs/node.d.mts +8 -0
- package/dist/configs/{node.js → node.mjs} +5 -2
- package/dist/configs/{nuxt.d.ts → nuxt.d.mts} +3 -1
- package/dist/configs/{nuxt.js → nuxt.mjs} +18 -15
- package/dist/configs/{perfectionist.d.ts → perfectionist.d.mts} +3 -1
- package/dist/configs/{perfectionist.js → perfectionist.mjs} +4 -1
- package/dist/configs/pnpm.d.mts +8 -0
- package/dist/configs/{pnpm.js → pnpm.mjs} +6 -3
- package/dist/configs/{regexp.d.ts → regexp.d.mts} +3 -1
- package/dist/configs/{regexp.js → regexp.mjs} +3 -0
- package/dist/configs/{sort.d.ts → sort.d.mts} +3 -1
- package/dist/configs/{sort.js → sort.mjs} +3 -0
- package/dist/configs/{stylistic.d.ts → stylistic.d.mts} +3 -1
- package/dist/configs/{stylistic.js → stylistic.mjs} +5 -2
- package/dist/configs/{test.d.ts → test.d.mts} +3 -1
- package/dist/configs/{test.js → test.mjs} +5 -2
- package/dist/configs/{toml.d.ts → toml.d.mts} +3 -1
- package/dist/configs/{toml.js → toml.mjs} +7 -4
- package/dist/configs/{typescript.d.ts → typescript.d.mts} +3 -1
- package/dist/configs/{typescript.js → typescript.mjs} +17 -14
- package/dist/configs/unicorn.d.mts +8 -0
- package/dist/configs/unicorn.mjs +63 -0
- package/dist/configs/{vue.d.ts → vue.d.mts} +3 -1
- package/dist/configs/{vue.js → vue.mjs} +7 -4
- package/dist/configs/{yaml.d.ts → yaml.d.mts} +3 -1
- package/dist/configs/{yaml.js → yaml.mjs} +7 -4
- package/dist/{factory.d.ts → factory.d.mts} +4 -2
- package/dist/{factory.js → factory.mjs} +36 -33
- package/dist/{globs.d.ts → globs.d.mts} +2 -0
- package/dist/{globs.js → globs.mjs} +3 -0
- package/dist/{index.d.ts → index.d.mts} +9 -7
- package/dist/{index.js → index.mjs} +7 -4
- package/dist/node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/{index.js → index.mjs} +3 -0
- package/dist/package.mjs +7 -0
- package/dist/{plugins.js → plugins.mjs} +3 -0
- package/dist/{typegen.d.ts → typegen.d.mts} +1043 -232
- package/dist/{types.d.ts → types.d.mts} +14 -4
- package/dist/{utils.d.ts → utils.d.mts} +3 -1
- package/dist/{utils.js → utils.mjs} +4 -1
- package/dist/vendored/{prettier_types.d.ts → prettier_types.d.mts} +3 -1
- package/package.json +39 -36
- package/bin/index.js +0 -3
- package/dist/cli/index.d.ts +0 -1
- package/dist/config_presets.d.ts +0 -7
- package/dist/configs/adonisjs.d.ts +0 -6
- package/dist/configs/command.d.ts +0 -6
- package/dist/configs/comments.d.ts +0 -6
- package/dist/configs/disables.d.ts +0 -6
- package/dist/configs/e18e.d.ts +0 -6
- package/dist/configs/ignores.d.ts +0 -6
- package/dist/configs/index.d.ts +0 -27
- package/dist/configs/index.js +0 -27
- package/dist/configs/node.d.ts +0 -6
- package/dist/configs/pnpm.d.ts +0 -6
- package/dist/configs/unicorn.d.ts +0 -6
- package/dist/configs/unicorn.js +0 -40
- package/dist/package.js +0 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
1
3
|
import { Linter } from "eslint";
|
|
2
4
|
|
|
3
5
|
//#region src/typegen.d.ts
|
|
@@ -1553,6 +1555,11 @@ interface RuleOptions {
|
|
|
1553
1555
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-exports-from-components/
|
|
1554
1556
|
*/
|
|
1555
1557
|
'astro/no-exports-from-components'?: Linter.RuleEntry<[]>;
|
|
1558
|
+
/**
|
|
1559
|
+
* disallow omitted end tags
|
|
1560
|
+
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-omitted-end-tags/
|
|
1561
|
+
*/
|
|
1562
|
+
'astro/no-omitted-end-tags'?: Linter.RuleEntry<[]>;
|
|
1556
1563
|
/**
|
|
1557
1564
|
* disallow `prerender` export outside of pages/ directory
|
|
1558
1565
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-prerender-export-outside-pages/
|
|
@@ -1783,6 +1790,14 @@ interface RuleOptions {
|
|
|
1783
1790
|
* Prefer the exponentiation operator ** over Math.pow()
|
|
1784
1791
|
*/
|
|
1785
1792
|
'e18e/prefer-exponentiation-operator'?: Linter.RuleEntry<[]>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Prefer Array.prototype.flatMap() over .map(fn).flat() to avoid the intermediate array
|
|
1795
|
+
*/
|
|
1796
|
+
'e18e/prefer-flatmap-over-map-flat'?: Linter.RuleEntry<[]>;
|
|
1797
|
+
/**
|
|
1798
|
+
* Prefer `Map.prototype.getOrInsert()` over reading an entry with a default and writing it back
|
|
1799
|
+
*/
|
|
1800
|
+
'e18e/prefer-get-or-insert'?: Linter.RuleEntry<[]>;
|
|
1786
1801
|
/**
|
|
1787
1802
|
* Prefer .includes() over indexOf() comparisons for arrays and strings
|
|
1788
1803
|
*/
|
|
@@ -5301,918 +5316,1620 @@ interface RuleOptions {
|
|
|
5301
5316
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5302
5317
|
/**
|
|
5303
5318
|
* Prefer better DOM traversal APIs.
|
|
5304
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5319
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/better-dom-traversing.md
|
|
5305
5320
|
*/
|
|
5306
5321
|
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>;
|
|
5307
5322
|
/**
|
|
5308
5323
|
* Removed. Prefer `eslint-plugin-regexp`
|
|
5309
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5324
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#better-regex
|
|
5310
5325
|
* @deprecated
|
|
5311
5326
|
*/
|
|
5312
5327
|
'unicorn/better-regex'?: Linter.RuleEntry<[]>;
|
|
5313
5328
|
/**
|
|
5314
5329
|
* Enforce a specific parameter name in catch clauses.
|
|
5315
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5330
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/catch-error-name.md
|
|
5316
5331
|
*/
|
|
5317
5332
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5333
|
+
/**
|
|
5334
|
+
* Enforce consistent class references in static methods.
|
|
5335
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/class-reference-in-static-methods.md
|
|
5336
|
+
*/
|
|
5337
|
+
'unicorn/class-reference-in-static-methods'?: Linter.RuleEntry<UnicornClassReferenceInStaticMethods>;
|
|
5338
|
+
/**
|
|
5339
|
+
* Enforce better comment content.
|
|
5340
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/comment-content.md
|
|
5341
|
+
*/
|
|
5342
|
+
'unicorn/comment-content'?: Linter.RuleEntry<UnicornCommentContent>;
|
|
5318
5343
|
/**
|
|
5319
5344
|
* Enforce consistent assertion style with `node:assert`.
|
|
5320
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5345
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-assert.md
|
|
5321
5346
|
*/
|
|
5322
5347
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5348
|
+
/**
|
|
5349
|
+
* Enforce consistent naming for boolean names.
|
|
5350
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-boolean-name.md
|
|
5351
|
+
*/
|
|
5352
|
+
'unicorn/consistent-boolean-name'?: Linter.RuleEntry<UnicornConsistentBooleanName>;
|
|
5353
|
+
/**
|
|
5354
|
+
* Enforce consistent class member order.
|
|
5355
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-class-member-order.md
|
|
5356
|
+
*/
|
|
5357
|
+
'unicorn/consistent-class-member-order'?: Linter.RuleEntry<UnicornConsistentClassMemberOrder>;
|
|
5323
5358
|
/**
|
|
5324
5359
|
* Enforce consistent spelling of compound words in identifiers.
|
|
5325
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5360
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-compound-words.md
|
|
5326
5361
|
*/
|
|
5327
5362
|
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>;
|
|
5363
|
+
/**
|
|
5364
|
+
* Enforce consistent conditional object spread style.
|
|
5365
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-conditional-object-spread.md
|
|
5366
|
+
*/
|
|
5367
|
+
'unicorn/consistent-conditional-object-spread'?: Linter.RuleEntry<UnicornConsistentConditionalObjectSpread>;
|
|
5328
5368
|
/**
|
|
5329
5369
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5330
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5370
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-date-clone.md
|
|
5331
5371
|
*/
|
|
5332
5372
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5333
5373
|
/**
|
|
5334
5374
|
* Use destructured variables over properties.
|
|
5335
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5375
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-destructuring.md
|
|
5336
5376
|
*/
|
|
5337
5377
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5338
5378
|
/**
|
|
5339
5379
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5340
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5380
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5341
5381
|
*/
|
|
5342
5382
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5343
5383
|
/**
|
|
5344
5384
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5345
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5385
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-existence-index-check.md
|
|
5346
5386
|
*/
|
|
5347
5387
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5388
|
+
/**
|
|
5389
|
+
* Enforce consistent decorator position on exported classes.
|
|
5390
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-export-decorator-position.md
|
|
5391
|
+
*/
|
|
5392
|
+
'unicorn/consistent-export-decorator-position'?: Linter.RuleEntry<UnicornConsistentExportDecoratorPosition>;
|
|
5348
5393
|
/**
|
|
5349
5394
|
* Move function definitions to the highest possible scope.
|
|
5350
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5395
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-function-scoping.md
|
|
5351
5396
|
*/
|
|
5352
5397
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5398
|
+
/**
|
|
5399
|
+
* Enforce function syntax by role.
|
|
5400
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-function-style.md
|
|
5401
|
+
*/
|
|
5402
|
+
'unicorn/consistent-function-style'?: Linter.RuleEntry<UnicornConsistentFunctionStyle>;
|
|
5353
5403
|
/**
|
|
5354
5404
|
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
5355
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5405
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-json-file-read.md
|
|
5356
5406
|
*/
|
|
5357
5407
|
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>;
|
|
5408
|
+
/**
|
|
5409
|
+
* Enforce consistent optional chaining for same-base member access.
|
|
5410
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-optional-chaining.md
|
|
5411
|
+
*/
|
|
5412
|
+
'unicorn/consistent-optional-chaining'?: Linter.RuleEntry<[]>;
|
|
5358
5413
|
/**
|
|
5359
5414
|
* Enforce consistent style for escaping `${` in template literals.
|
|
5360
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5415
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-template-literal-escape.md
|
|
5361
5416
|
*/
|
|
5362
5417
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>;
|
|
5418
|
+
/**
|
|
5419
|
+
* Enforce consistent labels on tuple type elements.
|
|
5420
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/consistent-tuple-labels.md
|
|
5421
|
+
*/
|
|
5422
|
+
'unicorn/consistent-tuple-labels'?: Linter.RuleEntry<[]>;
|
|
5363
5423
|
/**
|
|
5364
5424
|
* Enforce correct `Error` subclassing.
|
|
5365
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5425
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/custom-error-definition.md
|
|
5366
5426
|
*/
|
|
5367
5427
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5428
|
+
/**
|
|
5429
|
+
* Enforce consistent default export declarations.
|
|
5430
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/default-export-style.md
|
|
5431
|
+
*/
|
|
5432
|
+
'unicorn/default-export-style'?: Linter.RuleEntry<UnicornDefaultExportStyle>;
|
|
5368
5433
|
/**
|
|
5369
5434
|
* Enforce consistent style for DOM element dataset access.
|
|
5370
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5435
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/dom-node-dataset.md
|
|
5371
5436
|
*/
|
|
5372
5437
|
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>;
|
|
5373
5438
|
/**
|
|
5374
5439
|
* Enforce no spaces between braces.
|
|
5375
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5440
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/empty-brace-spaces.md
|
|
5376
5441
|
*/
|
|
5377
5442
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5378
5443
|
/**
|
|
5379
5444
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5380
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5445
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/error-message.md
|
|
5381
5446
|
*/
|
|
5382
5447
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5383
5448
|
/**
|
|
5384
5449
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5385
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5450
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/escape-case.md
|
|
5386
5451
|
*/
|
|
5387
5452
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5388
5453
|
/**
|
|
5389
5454
|
* Add expiration conditions to TODO comments.
|
|
5390
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5455
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/expiring-todo-comments.md
|
|
5391
5456
|
*/
|
|
5392
5457
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5393
5458
|
/**
|
|
5394
5459
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5395
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5460
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/explicit-length-check.md
|
|
5396
5461
|
*/
|
|
5397
5462
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5463
|
+
/**
|
|
5464
|
+
* Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.
|
|
5465
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/explicit-timer-delay.md
|
|
5466
|
+
*/
|
|
5467
|
+
'unicorn/explicit-timer-delay'?: Linter.RuleEntry<UnicornExplicitTimerDelay>;
|
|
5398
5468
|
/**
|
|
5399
5469
|
* Enforce a case style for filenames and directory names.
|
|
5400
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/filename-case.md
|
|
5401
5471
|
*/
|
|
5402
5472
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5473
|
+
/**
|
|
5474
|
+
* Require identifiers to match a specified regular expression.
|
|
5475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/id-match.md
|
|
5476
|
+
*/
|
|
5477
|
+
'unicorn/id-match'?: Linter.RuleEntry<UnicornIdMatch>;
|
|
5403
5478
|
/**
|
|
5404
5479
|
* Enforce specific import styles per module.
|
|
5405
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/import-style.md
|
|
5406
5481
|
*/
|
|
5407
5482
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5408
5483
|
/**
|
|
5409
5484
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
5410
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5485
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/isolated-functions.md
|
|
5411
5486
|
*/
|
|
5412
5487
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>;
|
|
5413
5488
|
/**
|
|
5414
|
-
*
|
|
5415
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5489
|
+
* Require or disallow logical assignment operator shorthand
|
|
5490
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/logical-assignment-operators.md
|
|
5491
|
+
*/
|
|
5492
|
+
'unicorn/logical-assignment-operators'?: Linter.RuleEntry<UnicornLogicalAssignmentOperators>;
|
|
5493
|
+
/**
|
|
5494
|
+
* Limit the depth of nested calls.
|
|
5495
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/max-nested-calls.md
|
|
5496
|
+
*/
|
|
5497
|
+
'unicorn/max-nested-calls'?: Linter.RuleEntry<UnicornMaxNestedCalls>;
|
|
5498
|
+
/**
|
|
5499
|
+
* Enforce replacements for variable, property, and filenames.
|
|
5500
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/name-replacements.md
|
|
5501
|
+
*/
|
|
5502
|
+
'unicorn/name-replacements'?: Linter.RuleEntry<UnicornNameReplacements>;
|
|
5503
|
+
/**
|
|
5504
|
+
* Enforce correct use of `new` for builtin constructors.
|
|
5505
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/new-for-builtins.md
|
|
5416
5506
|
*/
|
|
5417
5507
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5418
5508
|
/**
|
|
5419
5509
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5420
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5510
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5421
5511
|
*/
|
|
5422
5512
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5423
5513
|
/**
|
|
5424
5514
|
* Disallow recursive access to `this` within getters and setters.
|
|
5425
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5515
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-accessor-recursion.md
|
|
5426
5516
|
*/
|
|
5427
5517
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5518
|
+
/**
|
|
5519
|
+
* Disallow bitwise operators where a logical operator was likely intended.
|
|
5520
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-accidental-bitwise-operator.md
|
|
5521
|
+
*/
|
|
5522
|
+
'unicorn/no-accidental-bitwise-operator'?: Linter.RuleEntry<[]>;
|
|
5428
5523
|
/**
|
|
5429
5524
|
* Disallow anonymous functions and classes as the default export.
|
|
5430
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5525
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-anonymous-default-export.md
|
|
5431
5526
|
*/
|
|
5432
5527
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5433
5528
|
/**
|
|
5434
5529
|
* Prevent passing a function reference directly to iterator methods.
|
|
5435
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5530
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-callback-reference.md
|
|
5436
5531
|
*/
|
|
5437
5532
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>;
|
|
5438
5533
|
/**
|
|
5439
|
-
* Disallow
|
|
5440
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5534
|
+
* Disallow array accumulation with `Array#concat()` in loops.
|
|
5535
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-concat-in-loop.md
|
|
5441
5536
|
*/
|
|
5442
|
-
'unicorn/no-array-
|
|
5537
|
+
'unicorn/no-array-concat-in-loop'?: Linter.RuleEntry<[]>;
|
|
5443
5538
|
/**
|
|
5444
|
-
*
|
|
5445
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5539
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
5540
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-fill-with-reference-type.md
|
|
5446
5541
|
*/
|
|
5447
|
-
'unicorn/no-array-
|
|
5542
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>;
|
|
5448
5543
|
/**
|
|
5449
5544
|
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
5450
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5545
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-from-fill.md
|
|
5451
5546
|
*/
|
|
5452
5547
|
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>;
|
|
5548
|
+
/**
|
|
5549
|
+
* Disallow front-of-array mutation.
|
|
5550
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-front-mutation.md
|
|
5551
|
+
*/
|
|
5552
|
+
'unicorn/no-array-front-mutation'?: Linter.RuleEntry<[]>;
|
|
5453
5553
|
/**
|
|
5454
5554
|
* Disallow using the `this` argument in array methods.
|
|
5455
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5555
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-method-this-argument.md
|
|
5456
5556
|
*/
|
|
5457
5557
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5458
5558
|
/**
|
|
5459
5559
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5460
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5560
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
5461
5561
|
* @deprecated
|
|
5462
5562
|
*/
|
|
5463
5563
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5464
5564
|
/**
|
|
5465
5565
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5466
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5566
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-reduce.md
|
|
5467
5567
|
*/
|
|
5468
5568
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5469
5569
|
/**
|
|
5470
5570
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5471
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5571
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-reverse.md
|
|
5472
5572
|
*/
|
|
5473
5573
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5474
5574
|
/**
|
|
5475
5575
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
5476
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5576
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-sort.md
|
|
5477
5577
|
*/
|
|
5478
5578
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
5579
|
+
/**
|
|
5580
|
+
* Disallow sorting arrays to get the minimum or maximum value.
|
|
5581
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-sort-for-min-max.md
|
|
5582
|
+
*/
|
|
5583
|
+
'unicorn/no-array-sort-for-min-max'?: Linter.RuleEntry<[]>;
|
|
5584
|
+
/**
|
|
5585
|
+
* Prefer `Array#toSpliced()` over `Array#splice()`.
|
|
5586
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-array-splice.md
|
|
5587
|
+
*/
|
|
5588
|
+
'unicorn/no-array-splice'?: Linter.RuleEntry<[]>;
|
|
5589
|
+
/**
|
|
5590
|
+
* Disallow asterisk prefixes in documentation comments.
|
|
5591
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-asterisk-prefix-in-documentation-comments.md
|
|
5592
|
+
*/
|
|
5593
|
+
'unicorn/no-asterisk-prefix-in-documentation-comments'?: Linter.RuleEntry<[]>;
|
|
5479
5594
|
/**
|
|
5480
5595
|
* Disallow member access from await expression.
|
|
5481
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5596
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-await-expression-member.md
|
|
5482
5597
|
*/
|
|
5483
5598
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5484
5599
|
/**
|
|
5485
5600
|
* Disallow using `await` in `Promise` method parameters.
|
|
5486
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5601
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5487
5602
|
*/
|
|
5488
5603
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5489
5604
|
/**
|
|
5490
5605
|
* Disallow unnecessary `Blob` to `File` conversion.
|
|
5491
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5606
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-blob-to-file.md
|
|
5492
5607
|
*/
|
|
5493
5608
|
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>;
|
|
5609
|
+
/**
|
|
5610
|
+
* Disallow boolean-returning sort comparators.
|
|
5611
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-boolean-sort-comparator.md
|
|
5612
|
+
*/
|
|
5613
|
+
'unicorn/no-boolean-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
5614
|
+
/**
|
|
5615
|
+
* Disallow `break` and `continue` in nested loops and switches inside loops.
|
|
5616
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-break-in-nested-loop.md
|
|
5617
|
+
*/
|
|
5618
|
+
'unicorn/no-break-in-nested-loop'?: Linter.RuleEntry<[]>;
|
|
5494
5619
|
/**
|
|
5495
5620
|
* Prefer drawing canvases directly instead of converting them to images.
|
|
5496
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5621
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-canvas-to-image.md
|
|
5497
5622
|
*/
|
|
5498
5623
|
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>;
|
|
5624
|
+
/**
|
|
5625
|
+
* Disallow chained comparisons such as `a < b < c`.
|
|
5626
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-chained-comparison.md
|
|
5627
|
+
*/
|
|
5628
|
+
'unicorn/no-chained-comparison'?: Linter.RuleEntry<[]>;
|
|
5629
|
+
/**
|
|
5630
|
+
* Disallow accessing `Map`, `Set`, `WeakMap`, and `WeakSet` entries with bracket notation.
|
|
5631
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-collection-bracket-access.md
|
|
5632
|
+
*/
|
|
5633
|
+
'unicorn/no-collection-bracket-access'?: Linter.RuleEntry<[]>;
|
|
5634
|
+
/**
|
|
5635
|
+
* Disallow dynamic object property existence checks.
|
|
5636
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-computed-property-existence-check.md
|
|
5637
|
+
*/
|
|
5638
|
+
'unicorn/no-computed-property-existence-check'?: Linter.RuleEntry<[]>;
|
|
5499
5639
|
/**
|
|
5500
5640
|
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
5501
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5641
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-confusing-array-splice.md
|
|
5502
5642
|
*/
|
|
5503
5643
|
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>;
|
|
5644
|
+
/**
|
|
5645
|
+
* Disallow confusing uses of `Array#with()`.
|
|
5646
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-confusing-array-with.md
|
|
5647
|
+
*/
|
|
5648
|
+
'unicorn/no-confusing-array-with'?: Linter.RuleEntry<[]>;
|
|
5504
5649
|
/**
|
|
5505
5650
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5506
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-console-spaces.md
|
|
5507
5652
|
*/
|
|
5508
5653
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
5654
|
+
/**
|
|
5655
|
+
* Disallow arithmetic and bitwise operations that always evaluate to `0`.
|
|
5656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-constant-zero-expression.md
|
|
5657
|
+
*/
|
|
5658
|
+
'unicorn/no-constant-zero-expression'?: Linter.RuleEntry<[]>;
|
|
5659
|
+
/**
|
|
5660
|
+
* Disallow declarations before conditional early exits when they are only used after the exit.
|
|
5661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-declarations-before-early-exit.md
|
|
5662
|
+
*/
|
|
5663
|
+
'unicorn/no-declarations-before-early-exit'?: Linter.RuleEntry<[]>;
|
|
5509
5664
|
/**
|
|
5510
5665
|
* Do not use `document.cookie` directly.
|
|
5511
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-document-cookie.md
|
|
5512
5667
|
*/
|
|
5513
5668
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
5669
|
+
/**
|
|
5670
|
+
* Disallow two comparisons of the same operands that can be combined into one.
|
|
5671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-double-comparison.md
|
|
5672
|
+
*/
|
|
5673
|
+
'unicorn/no-double-comparison'?: Linter.RuleEntry<[]>;
|
|
5674
|
+
/**
|
|
5675
|
+
* Disallow duplicate adjacent branches in if chains.
|
|
5676
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-if-branches.md
|
|
5677
|
+
*/
|
|
5678
|
+
'unicorn/no-duplicate-if-branches'?: Linter.RuleEntry<[]>;
|
|
5679
|
+
/**
|
|
5680
|
+
* Disallow adjacent duplicate operands in logical expressions.
|
|
5681
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-logical-operands.md
|
|
5682
|
+
*/
|
|
5683
|
+
'unicorn/no-duplicate-logical-operands'?: Linter.RuleEntry<[]>;
|
|
5684
|
+
/**
|
|
5685
|
+
* Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.
|
|
5686
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-loops.md
|
|
5687
|
+
*/
|
|
5688
|
+
'unicorn/no-duplicate-loops'?: Linter.RuleEntry<[]>;
|
|
5514
5689
|
/**
|
|
5515
5690
|
* Disallow duplicate values in `Set` constructor array literals.
|
|
5516
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5691
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-duplicate-set-values.md
|
|
5517
5692
|
*/
|
|
5518
5693
|
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>;
|
|
5519
5694
|
/**
|
|
5520
5695
|
* Disallow empty files.
|
|
5521
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5696
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-empty-file.md
|
|
5522
5697
|
*/
|
|
5523
5698
|
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>;
|
|
5699
|
+
/**
|
|
5700
|
+
* Disallow assigning to built-in error properties.
|
|
5701
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-error-property-assignment.md
|
|
5702
|
+
*/
|
|
5703
|
+
'unicorn/no-error-property-assignment'?: Linter.RuleEntry<[]>;
|
|
5524
5704
|
/**
|
|
5525
5705
|
* Disallow exports in scripts.
|
|
5526
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5706
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-exports-in-scripts.md
|
|
5527
5707
|
*/
|
|
5528
5708
|
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>;
|
|
5709
|
+
/**
|
|
5710
|
+
* Prefer `for…of` over the `forEach` method.
|
|
5711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-for-each.md
|
|
5712
|
+
*/
|
|
5713
|
+
'unicorn/no-for-each'?: Linter.RuleEntry<[]>;
|
|
5529
5714
|
/**
|
|
5530
5715
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5531
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-for-loop.md
|
|
5532
5717
|
*/
|
|
5533
5718
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5534
5719
|
/**
|
|
5535
|
-
*
|
|
5536
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5720
|
+
* Disallow assigning properties on the global object.
|
|
5721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-global-object-property-assignment.md
|
|
5722
|
+
*/
|
|
5723
|
+
'unicorn/no-global-object-property-assignment'?: Linter.RuleEntry<[]>;
|
|
5724
|
+
/**
|
|
5725
|
+
* Replaced by `unicorn/prefer-unicode-code-point-escapes` which covers more cases.
|
|
5726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-hex-escape
|
|
5727
|
+
* @deprecated
|
|
5537
5728
|
*/
|
|
5538
5729
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5539
5730
|
/**
|
|
5540
5731
|
* Disallow immediate mutation after variable assignment.
|
|
5541
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5732
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-immediate-mutation.md
|
|
5542
5733
|
*/
|
|
5543
5734
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
5735
|
+
/**
|
|
5736
|
+
* Disallow impossible comparisons against `.length` or `.size`.
|
|
5737
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-impossible-length-comparison.md
|
|
5738
|
+
*/
|
|
5739
|
+
'unicorn/no-impossible-length-comparison'?: Linter.RuleEntry<[]>;
|
|
5544
5740
|
/**
|
|
5545
5741
|
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
5546
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5742
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-incorrect-query-selector.md
|
|
5547
5743
|
*/
|
|
5548
5744
|
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>;
|
|
5745
|
+
/**
|
|
5746
|
+
* Disallow incorrect template literal interpolation syntax.
|
|
5747
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-incorrect-template-string-interpolation.md
|
|
5748
|
+
*/
|
|
5749
|
+
'unicorn/no-incorrect-template-string-interpolation'?: Linter.RuleEntry<[]>;
|
|
5549
5750
|
/**
|
|
5550
5751
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5551
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5752
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
5552
5753
|
* @deprecated
|
|
5553
5754
|
*/
|
|
5554
5755
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5555
5756
|
/**
|
|
5556
5757
|
* Disallow `instanceof` with built-in objects
|
|
5557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5758
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-instanceof-builtins.md
|
|
5558
5759
|
*/
|
|
5559
5760
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
5761
|
+
/**
|
|
5762
|
+
* Disallow calling functions and constructors with an invalid number of arguments.
|
|
5763
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-argument-count.md
|
|
5764
|
+
*/
|
|
5765
|
+
'unicorn/no-invalid-argument-count'?: Linter.RuleEntry<UnicornNoInvalidArgumentCount>;
|
|
5766
|
+
/**
|
|
5767
|
+
* Disallow comparing a single character from a string to a multi-character string.
|
|
5768
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-character-comparison.md
|
|
5769
|
+
*/
|
|
5770
|
+
'unicorn/no-invalid-character-comparison'?: Linter.RuleEntry<[]>;
|
|
5560
5771
|
/**
|
|
5561
5772
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5773
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5563
5774
|
*/
|
|
5564
5775
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
5565
5776
|
/**
|
|
5566
5777
|
* Disallow invalid `accept` values on file inputs.
|
|
5567
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5778
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-file-input-accept.md
|
|
5568
5779
|
*/
|
|
5569
5780
|
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>;
|
|
5570
5781
|
/**
|
|
5571
5782
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5572
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5783
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5573
5784
|
*/
|
|
5574
5785
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
5786
|
+
/**
|
|
5787
|
+
* Disallow invalid implementations of well-known symbol methods.
|
|
5788
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-invalid-well-known-symbol-methods.md
|
|
5789
|
+
*/
|
|
5790
|
+
'unicorn/no-invalid-well-known-symbol-methods'?: Linter.RuleEntry<[]>;
|
|
5575
5791
|
/**
|
|
5576
5792
|
* Disallow identifiers starting with `new` or `class`.
|
|
5577
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5793
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-keyword-prefix.md
|
|
5578
5794
|
*/
|
|
5579
5795
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
5580
5796
|
/**
|
|
5581
5797
|
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
5582
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5798
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-late-current-target-access.md
|
|
5583
5799
|
*/
|
|
5584
5800
|
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>;
|
|
5801
|
+
/**
|
|
5802
|
+
* Disallow event-control method calls after the synchronous event dispatch has finished.
|
|
5803
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-late-event-control.md
|
|
5804
|
+
*/
|
|
5805
|
+
'unicorn/no-late-event-control'?: Linter.RuleEntry<[]>;
|
|
5585
5806
|
/**
|
|
5586
5807
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
5587
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5808
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
5588
5809
|
* @deprecated
|
|
5589
5810
|
*/
|
|
5590
5811
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
5591
5812
|
/**
|
|
5592
5813
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5593
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5814
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-lonely-if.md
|
|
5594
5815
|
*/
|
|
5595
5816
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
5817
|
+
/**
|
|
5818
|
+
* Disallow mutating a loop iterable during iteration.
|
|
5819
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-loop-iterable-mutation.md
|
|
5820
|
+
*/
|
|
5821
|
+
'unicorn/no-loop-iterable-mutation'?: Linter.RuleEntry<[]>;
|
|
5596
5822
|
/**
|
|
5597
5823
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5598
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5824
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5599
5825
|
*/
|
|
5600
5826
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5601
5827
|
/**
|
|
5602
5828
|
* Disallow manually wrapped comments.
|
|
5603
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5829
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-manually-wrapped-comments.md
|
|
5604
5830
|
*/
|
|
5605
5831
|
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>;
|
|
5832
|
+
/**
|
|
5833
|
+
* Disallow checking a Map key before accessing a different key.
|
|
5834
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-mismatched-map-key.md
|
|
5835
|
+
*/
|
|
5836
|
+
'unicorn/no-mismatched-map-key'?: Linter.RuleEntry<[]>;
|
|
5837
|
+
/**
|
|
5838
|
+
* Disallow misrefactored compound assignments where the target is duplicated in the right-hand side.
|
|
5839
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-misrefactored-assignment.md
|
|
5840
|
+
*/
|
|
5841
|
+
'unicorn/no-misrefactored-assignment'?: Linter.RuleEntry<[]>;
|
|
5606
5842
|
/**
|
|
5607
5843
|
* Disallow named usage of default import and export.
|
|
5608
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5844
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-named-default.md
|
|
5609
5845
|
*/
|
|
5610
5846
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
5847
|
+
/**
|
|
5848
|
+
* Disallow negated array predicate calls.
|
|
5849
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-array-predicate.md
|
|
5850
|
+
*/
|
|
5851
|
+
'unicorn/no-negated-array-predicate'?: Linter.RuleEntry<[]>;
|
|
5852
|
+
/**
|
|
5853
|
+
* Disallow negated comparisons.
|
|
5854
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-comparison.md
|
|
5855
|
+
*/
|
|
5856
|
+
'unicorn/no-negated-comparison'?: Linter.RuleEntry<UnicornNoNegatedComparison>;
|
|
5611
5857
|
/**
|
|
5612
5858
|
* Disallow negated conditions.
|
|
5613
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5859
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negated-condition.md
|
|
5614
5860
|
*/
|
|
5615
5861
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
5616
5862
|
/**
|
|
5617
5863
|
* Disallow negated expression in equality check.
|
|
5618
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5864
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-negation-in-equality-check.md
|
|
5619
5865
|
*/
|
|
5620
5866
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
5621
5867
|
/**
|
|
5622
5868
|
* Disallow nested ternary expressions.
|
|
5623
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5869
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-nested-ternary.md
|
|
5624
5870
|
*/
|
|
5625
5871
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5626
5872
|
/**
|
|
5627
5873
|
* Disallow `new Array()`.
|
|
5628
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5874
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-new-array.md
|
|
5629
5875
|
*/
|
|
5630
5876
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
5631
5877
|
/**
|
|
5632
5878
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5633
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5879
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-new-buffer.md
|
|
5634
5880
|
*/
|
|
5635
5881
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
5882
|
+
/**
|
|
5883
|
+
* Disallow non-function values with function-style verb prefixes.
|
|
5884
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-non-function-verb-prefix.md
|
|
5885
|
+
*/
|
|
5886
|
+
'unicorn/no-non-function-verb-prefix'?: Linter.RuleEntry<UnicornNoNonFunctionVerbPrefix>;
|
|
5887
|
+
/**
|
|
5888
|
+
* Disallow non-standard properties on built-in objects.
|
|
5889
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-nonstandard-builtin-properties.md
|
|
5890
|
+
*/
|
|
5891
|
+
'unicorn/no-nonstandard-builtin-properties'?: Linter.RuleEntry<[]>;
|
|
5636
5892
|
/**
|
|
5637
5893
|
* Disallow the use of the `null` literal.
|
|
5638
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5894
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-null.md
|
|
5639
5895
|
*/
|
|
5640
5896
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
5641
5897
|
/**
|
|
5642
5898
|
* Disallow the use of objects as default parameters.
|
|
5643
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5899
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5644
5900
|
*/
|
|
5645
5901
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
5902
|
+
/**
|
|
5903
|
+
* Disallow `Object` methods with `Map` or `Set`.
|
|
5904
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-object-methods-with-collections.md
|
|
5905
|
+
*/
|
|
5906
|
+
'unicorn/no-object-methods-with-collections'?: Linter.RuleEntry<[]>;
|
|
5907
|
+
/**
|
|
5908
|
+
* Disallow optional chaining on undeclared variables.
|
|
5909
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-optional-chaining-on-undeclared-variable.md
|
|
5910
|
+
*/
|
|
5911
|
+
'unicorn/no-optional-chaining-on-undeclared-variable'?: Linter.RuleEntry<[]>;
|
|
5646
5912
|
/**
|
|
5647
5913
|
* Disallow `process.exit()`.
|
|
5648
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5914
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-process-exit.md
|
|
5649
5915
|
*/
|
|
5650
5916
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
5917
|
+
/**
|
|
5918
|
+
* Disallow comparisons made redundant by an equality check in the same logical AND.
|
|
5919
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-redundant-comparison.md
|
|
5920
|
+
*/
|
|
5921
|
+
'unicorn/no-redundant-comparison'?: Linter.RuleEntry<[]>;
|
|
5922
|
+
/**
|
|
5923
|
+
* Disallow using the return value of `Array#push()` and `Array#unshift()`.
|
|
5924
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-return-array-push.md
|
|
5925
|
+
*/
|
|
5926
|
+
'unicorn/no-return-array-push'?: Linter.RuleEntry<[]>;
|
|
5927
|
+
/**
|
|
5928
|
+
* Disallow selector syntax in DOM names.
|
|
5929
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-selector-as-dom-name.md
|
|
5930
|
+
*/
|
|
5931
|
+
'unicorn/no-selector-as-dom-name'?: Linter.RuleEntry<[]>;
|
|
5651
5932
|
/**
|
|
5652
5933
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5653
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5934
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5654
5935
|
*/
|
|
5655
5936
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5656
5937
|
/**
|
|
5657
5938
|
* Disallow classes that only have static members.
|
|
5658
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5939
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-static-only-class.md
|
|
5659
5940
|
*/
|
|
5660
5941
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
5942
|
+
/**
|
|
5943
|
+
* Prefer comparing values directly over subtracting and comparing to `0`.
|
|
5944
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-subtraction-comparison.md
|
|
5945
|
+
*/
|
|
5946
|
+
'unicorn/no-subtraction-comparison'?: Linter.RuleEntry<[]>;
|
|
5661
5947
|
/**
|
|
5662
5948
|
* Disallow `then` property.
|
|
5663
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5949
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-thenable.md
|
|
5664
5950
|
*/
|
|
5665
5951
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
5666
5952
|
/**
|
|
5667
5953
|
* Disallow assigning `this` to a variable.
|
|
5668
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5954
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-this-assignment.md
|
|
5669
5955
|
*/
|
|
5670
5956
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
5671
5957
|
/**
|
|
5672
5958
|
* Disallow `this` outside of classes.
|
|
5673
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5959
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-this-outside-of-class.md
|
|
5674
5960
|
*/
|
|
5675
5961
|
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>;
|
|
5962
|
+
/**
|
|
5963
|
+
* Disallow assigning to top-level variables from inside functions.
|
|
5964
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-top-level-assignment-in-function.md
|
|
5965
|
+
*/
|
|
5966
|
+
'unicorn/no-top-level-assignment-in-function'?: Linter.RuleEntry<[]>;
|
|
5967
|
+
/**
|
|
5968
|
+
* Disallow top-level side effects in exported modules.
|
|
5969
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-top-level-side-effects.md
|
|
5970
|
+
*/
|
|
5971
|
+
'unicorn/no-top-level-side-effects'?: Linter.RuleEntry<[]>;
|
|
5676
5972
|
/**
|
|
5677
5973
|
* Disallow comparing `undefined` using `typeof`.
|
|
5678
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5974
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-typeof-undefined.md
|
|
5679
5975
|
*/
|
|
5680
5976
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
5977
|
+
/**
|
|
5978
|
+
* Disallow referencing methods without calling them.
|
|
5979
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-uncalled-method.md
|
|
5980
|
+
*/
|
|
5981
|
+
'unicorn/no-uncalled-method'?: Linter.RuleEntry<[]>;
|
|
5982
|
+
/**
|
|
5983
|
+
* Require class members to be declared.
|
|
5984
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-undeclared-class-members.md
|
|
5985
|
+
*/
|
|
5986
|
+
'unicorn/no-undeclared-class-members'?: Linter.RuleEntry<[]>;
|
|
5681
5987
|
/**
|
|
5682
5988
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
5683
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5989
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
5684
5990
|
*/
|
|
5685
5991
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5686
5992
|
/**
|
|
5687
5993
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
5688
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5994
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
5689
5995
|
*/
|
|
5690
5996
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
5691
5997
|
/**
|
|
5692
5998
|
* Disallow awaiting non-promise values.
|
|
5693
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5999
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-await.md
|
|
5694
6000
|
*/
|
|
5695
6001
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6002
|
+
/**
|
|
6003
|
+
* Disallow unnecessary comparisons against boolean literals.
|
|
6004
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-boolean-comparison.md
|
|
6005
|
+
*/
|
|
6006
|
+
'unicorn/no-unnecessary-boolean-comparison'?: Linter.RuleEntry<[]>;
|
|
6007
|
+
/**
|
|
6008
|
+
* Disallow unnecessary `globalThis` references.
|
|
6009
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-global-this.md
|
|
6010
|
+
*/
|
|
6011
|
+
'unicorn/no-unnecessary-global-this'?: Linter.RuleEntry<[]>;
|
|
5696
6012
|
/**
|
|
5697
6013
|
* Disallow unnecessary nested ternary expressions.
|
|
5698
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6014
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-nested-ternary.md
|
|
5699
6015
|
*/
|
|
5700
6016
|
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5701
6017
|
/**
|
|
5702
6018
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5703
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6019
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5704
6020
|
*/
|
|
5705
6021
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
5706
6022
|
/**
|
|
5707
6023
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
5708
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6024
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
5709
6025
|
*/
|
|
5710
6026
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6027
|
+
/**
|
|
6028
|
+
* Disallow `Array#splice()` when simpler alternatives exist.
|
|
6029
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unnecessary-splice.md
|
|
6030
|
+
*/
|
|
6031
|
+
'unicorn/no-unnecessary-splice'?: Linter.RuleEntry<[]>;
|
|
5711
6032
|
/**
|
|
5712
6033
|
* Disallow unreadable array destructuring.
|
|
5713
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6034
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
6035
|
+
*/
|
|
6036
|
+
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<UnicornNoUnreadableArrayDestructuring>;
|
|
6037
|
+
/**
|
|
6038
|
+
* Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
|
|
6039
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-for-of-expression.md
|
|
5714
6040
|
*/
|
|
5715
|
-
'unicorn/no-unreadable-
|
|
6041
|
+
'unicorn/no-unreadable-for-of-expression'?: Linter.RuleEntry<[]>;
|
|
5716
6042
|
/**
|
|
5717
6043
|
* Disallow unreadable IIFEs.
|
|
5718
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6044
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-iife.md
|
|
5719
6045
|
*/
|
|
5720
6046
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6047
|
+
/**
|
|
6048
|
+
* Disallow unreadable `new` expressions.
|
|
6049
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-new-expression.md
|
|
6050
|
+
*/
|
|
6051
|
+
'unicorn/no-unreadable-new-expression'?: Linter.RuleEntry<[]>;
|
|
6052
|
+
/**
|
|
6053
|
+
* Disallow unreadable object destructuring.
|
|
6054
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unreadable-object-destructuring.md
|
|
6055
|
+
*/
|
|
6056
|
+
'unicorn/no-unreadable-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
6057
|
+
/**
|
|
6058
|
+
* Prevent unsafe use of ArrayBuffer view `.buffer`.
|
|
6059
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-buffer-conversion.md
|
|
6060
|
+
*/
|
|
6061
|
+
'unicorn/no-unsafe-buffer-conversion'?: Linter.RuleEntry<[]>;
|
|
6062
|
+
/**
|
|
6063
|
+
* Disallow unsafe DOM HTML APIs.
|
|
6064
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-dom-html.md
|
|
6065
|
+
*/
|
|
6066
|
+
'unicorn/no-unsafe-dom-html'?: Linter.RuleEntry<[]>;
|
|
6067
|
+
/**
|
|
6068
|
+
* Disallow unsafe values as property keys.
|
|
6069
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-property-key.md
|
|
6070
|
+
*/
|
|
6071
|
+
'unicorn/no-unsafe-property-key'?: Linter.RuleEntry<[]>;
|
|
6072
|
+
/**
|
|
6073
|
+
* Disallow non-literal replacement values in `String#replace()` and `String#replaceAll()`.
|
|
6074
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unsafe-string-replacement.md
|
|
6075
|
+
*/
|
|
6076
|
+
'unicorn/no-unsafe-string-replacement'?: Linter.RuleEntry<[]>;
|
|
5721
6077
|
/**
|
|
5722
6078
|
* Disallow ignoring the return value of selected array methods.
|
|
5723
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6079
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unused-array-method-return.md
|
|
5724
6080
|
*/
|
|
5725
6081
|
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>;
|
|
5726
6082
|
/**
|
|
5727
6083
|
* Disallow unused object properties.
|
|
5728
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6084
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-unused-properties.md
|
|
5729
6085
|
*/
|
|
5730
6086
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6087
|
+
/**
|
|
6088
|
+
* Disallow unnecessary `Boolean()` casts in array predicate callbacks.
|
|
6089
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-boolean-cast.md
|
|
6090
|
+
*/
|
|
6091
|
+
'unicorn/no-useless-boolean-cast'?: Linter.RuleEntry<[]>;
|
|
6092
|
+
/**
|
|
6093
|
+
* Disallow useless type coercions of values that are already of the target type.
|
|
6094
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-coercion.md
|
|
6095
|
+
*/
|
|
6096
|
+
'unicorn/no-useless-coercion'?: Linter.RuleEntry<[]>;
|
|
5731
6097
|
/**
|
|
5732
6098
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
5733
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6099
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-collection-argument.md
|
|
5734
6100
|
*/
|
|
5735
6101
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
6102
|
+
/**
|
|
6103
|
+
* Disallow useless compound assignments such as `x += 0`.
|
|
6104
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-compound-assignment.md
|
|
6105
|
+
*/
|
|
6106
|
+
'unicorn/no-useless-compound-assignment'?: Linter.RuleEntry<[]>;
|
|
6107
|
+
/**
|
|
6108
|
+
* Disallow useless concatenation of literals.
|
|
6109
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-concat.md
|
|
6110
|
+
*/
|
|
6111
|
+
'unicorn/no-useless-concat'?: Linter.RuleEntry<[]>;
|
|
6112
|
+
/**
|
|
6113
|
+
* Disallow useless `continue` statements.
|
|
6114
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-continue.md
|
|
6115
|
+
*/
|
|
6116
|
+
'unicorn/no-useless-continue'?: Linter.RuleEntry<[]>;
|
|
6117
|
+
/**
|
|
6118
|
+
* Disallow unnecessary existence checks before deletion.
|
|
6119
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-delete-check.md
|
|
6120
|
+
*/
|
|
6121
|
+
'unicorn/no-useless-delete-check'?: Linter.RuleEntry<[]>;
|
|
6122
|
+
/**
|
|
6123
|
+
* Disallow `else` after a statement that exits.
|
|
6124
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-else.md
|
|
6125
|
+
*/
|
|
6126
|
+
'unicorn/no-useless-else'?: Linter.RuleEntry<[]>;
|
|
5736
6127
|
/**
|
|
5737
6128
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
5738
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6129
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
5739
6130
|
*/
|
|
5740
6131
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
5741
6132
|
/**
|
|
5742
6133
|
* Disallow useless fallback when spreading in object literals.
|
|
5743
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6134
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5744
6135
|
*/
|
|
5745
6136
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
5746
6137
|
/**
|
|
5747
6138
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
5748
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6139
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
5749
6140
|
*/
|
|
5750
6141
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
5751
6142
|
/**
|
|
5752
6143
|
* Disallow useless array length check.
|
|
5753
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6144
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-length-check.md
|
|
5754
6145
|
*/
|
|
5755
6146
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6147
|
+
/**
|
|
6148
|
+
* Disallow unnecessary operands in logical expressions involving boolean literals.
|
|
6149
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-logical-operand.md
|
|
6150
|
+
*/
|
|
6151
|
+
'unicorn/no-useless-logical-operand'?: Linter.RuleEntry<[]>;
|
|
6152
|
+
/**
|
|
6153
|
+
* Disallow useless overrides of class methods.
|
|
6154
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-override.md
|
|
6155
|
+
*/
|
|
6156
|
+
'unicorn/no-useless-override'?: Linter.RuleEntry<[]>;
|
|
5756
6157
|
/**
|
|
5757
6158
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5758
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6159
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5759
6160
|
*/
|
|
5760
6161
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6162
|
+
/**
|
|
6163
|
+
* Disallow simple recursive function calls that can be replaced with a loop.
|
|
6164
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-recursion.md
|
|
6165
|
+
*/
|
|
6166
|
+
'unicorn/no-useless-recursion'?: Linter.RuleEntry<[]>;
|
|
5761
6167
|
/**
|
|
5762
6168
|
* Disallow unnecessary spread.
|
|
5763
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6169
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-spread.md
|
|
5764
6170
|
*/
|
|
5765
6171
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
5766
6172
|
/**
|
|
5767
6173
|
* Disallow useless case in switch statements.
|
|
5768
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6174
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-switch-case.md
|
|
5769
6175
|
*/
|
|
5770
6176
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6177
|
+
/**
|
|
6178
|
+
* Disallow useless template literal expressions.
|
|
6179
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-template-literals.md
|
|
6180
|
+
*/
|
|
6181
|
+
'unicorn/no-useless-template-literals'?: Linter.RuleEntry<[]>;
|
|
5771
6182
|
/**
|
|
5772
6183
|
* Disallow useless `undefined`.
|
|
5773
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6184
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-useless-undefined.md
|
|
5774
6185
|
*/
|
|
5775
6186
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6187
|
+
/**
|
|
6188
|
+
* Disallow the bitwise XOR operator where exponentiation was likely intended.
|
|
6189
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-xor-as-exponentiation.md
|
|
6190
|
+
*/
|
|
6191
|
+
'unicorn/no-xor-as-exponentiation'?: Linter.RuleEntry<[]>;
|
|
5776
6192
|
/**
|
|
5777
6193
|
* Disallow number literals with zero fractions or dangling dots.
|
|
5778
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6194
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/no-zero-fractions.md
|
|
5779
6195
|
*/
|
|
5780
6196
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
5781
6197
|
/**
|
|
5782
6198
|
* Enforce proper case for numeric literals.
|
|
5783
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6199
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/number-literal-case.md
|
|
5784
6200
|
*/
|
|
5785
6201
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
5786
6202
|
/**
|
|
5787
6203
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
5788
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6204
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/numeric-separators-style.md
|
|
5789
6205
|
*/
|
|
5790
6206
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6207
|
+
/**
|
|
6208
|
+
* Require assignment operator shorthand where possible.
|
|
6209
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/operator-assignment.md
|
|
6210
|
+
*/
|
|
6211
|
+
'unicorn/operator-assignment'?: Linter.RuleEntry<UnicornOperatorAssignment>;
|
|
6212
|
+
/**
|
|
6213
|
+
* Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.
|
|
6214
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-abort-signal-timeout.md
|
|
6215
|
+
*/
|
|
6216
|
+
'unicorn/prefer-abort-signal-timeout'?: Linter.RuleEntry<[]>;
|
|
5791
6217
|
/**
|
|
5792
6218
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
5793
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6219
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-add-event-listener.md
|
|
5794
6220
|
*/
|
|
5795
6221
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6222
|
+
/**
|
|
6223
|
+
* Prefer an options object over a boolean in `.addEventListener()`.
|
|
6224
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-add-event-listener-options.md
|
|
6225
|
+
*/
|
|
6226
|
+
'unicorn/prefer-add-event-listener-options'?: Linter.RuleEntry<[]>;
|
|
6227
|
+
/**
|
|
6228
|
+
* Prefer `AggregateError` when throwing collected errors.
|
|
6229
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-aggregate-error.md
|
|
6230
|
+
*/
|
|
6231
|
+
'unicorn/prefer-aggregate-error'?: Linter.RuleEntry<[]>;
|
|
5796
6232
|
/**
|
|
5797
6233
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
5798
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6234
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-find.md
|
|
5799
6235
|
*/
|
|
5800
6236
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
5801
6237
|
/**
|
|
5802
6238
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
5803
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6239
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-flat.md
|
|
5804
6240
|
*/
|
|
5805
6241
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
5806
6242
|
/**
|
|
5807
|
-
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
5808
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6243
|
+
* Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.
|
|
6244
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-flat-map.md
|
|
5809
6245
|
*/
|
|
5810
6246
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6247
|
+
/**
|
|
6248
|
+
* Prefer `Array.fromAsync()` over `for await…of` array accumulation.
|
|
6249
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-from-async.md
|
|
6250
|
+
*/
|
|
6251
|
+
'unicorn/prefer-array-from-async'?: Linter.RuleEntry<[]>;
|
|
6252
|
+
/**
|
|
6253
|
+
* Prefer using the `Array.from()` mapping function argument.
|
|
6254
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-from-map.md
|
|
6255
|
+
*/
|
|
6256
|
+
'unicorn/prefer-array-from-map'?: Linter.RuleEntry<[]>;
|
|
5811
6257
|
/**
|
|
5812
6258
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
5813
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6259
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-index-of.md
|
|
5814
6260
|
*/
|
|
5815
6261
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6262
|
+
/**
|
|
6263
|
+
* Prefer iterating an array directly or with `Array#keys()` over `Array#entries()` when the index or value is unused.
|
|
6264
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-iterable-methods.md
|
|
6265
|
+
*/
|
|
6266
|
+
'unicorn/prefer-array-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
5816
6267
|
/**
|
|
5817
6268
|
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
5818
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6269
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-last-methods.md
|
|
5819
6270
|
*/
|
|
5820
6271
|
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>;
|
|
6272
|
+
/**
|
|
6273
|
+
* Prefer `Array#slice()` over `Array#splice()` when reading from the returned array.
|
|
6274
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-slice.md
|
|
6275
|
+
*/
|
|
6276
|
+
'unicorn/prefer-array-slice'?: Linter.RuleEntry<[]>;
|
|
5821
6277
|
/**
|
|
5822
6278
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
5823
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6279
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-array-some.md
|
|
5824
6280
|
*/
|
|
5825
6281
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
5826
6282
|
/**
|
|
5827
6283
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
5828
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6284
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-at.md
|
|
5829
6285
|
*/
|
|
5830
6286
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6287
|
+
/**
|
|
6288
|
+
* Prefer `await` over promise chaining.
|
|
6289
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-await.md
|
|
6290
|
+
*/
|
|
6291
|
+
'unicorn/prefer-await'?: Linter.RuleEntry<[]>;
|
|
5831
6292
|
/**
|
|
5832
6293
|
* Prefer `BigInt` literals over the constructor.
|
|
5833
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6294
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-bigint-literals.md
|
|
5834
6295
|
*/
|
|
5835
6296
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
5836
6297
|
/**
|
|
5837
6298
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
5838
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6299
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
5839
6300
|
*/
|
|
5840
6301
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6302
|
+
/**
|
|
6303
|
+
* Prefer directly returning boolean expressions over `if` statements.
|
|
6304
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-boolean-return.md
|
|
6305
|
+
*/
|
|
6306
|
+
'unicorn/prefer-boolean-return'?: Linter.RuleEntry<[]>;
|
|
5841
6307
|
/**
|
|
5842
6308
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
5843
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6309
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-class-fields.md
|
|
5844
6310
|
*/
|
|
5845
6311
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
5846
6312
|
/**
|
|
5847
6313
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
5848
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6314
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-classlist-toggle.md
|
|
5849
6315
|
*/
|
|
5850
6316
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
5851
6317
|
/**
|
|
5852
6318
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
5853
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6319
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-code-point.md
|
|
5854
6320
|
*/
|
|
5855
6321
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6322
|
+
/**
|
|
6323
|
+
* Prefer early continues over whole-loop conditional wrapping.
|
|
6324
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-continue.md
|
|
6325
|
+
*/
|
|
6326
|
+
'unicorn/prefer-continue'?: Linter.RuleEntry<UnicornPreferContinue>;
|
|
5856
6327
|
/**
|
|
5857
6328
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
5858
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6329
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-date-now.md
|
|
5859
6330
|
*/
|
|
5860
6331
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
5861
6332
|
/**
|
|
5862
6333
|
* Prefer default parameters over reassignment.
|
|
5863
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6334
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-default-parameters.md
|
|
5864
6335
|
*/
|
|
5865
6336
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6337
|
+
/**
|
|
6338
|
+
* Prefer direct iteration over default iterator method calls.
|
|
6339
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-direct-iteration.md
|
|
6340
|
+
*/
|
|
6341
|
+
'unicorn/prefer-direct-iteration'?: Linter.RuleEntry<[]>;
|
|
6342
|
+
/**
|
|
6343
|
+
* Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
|
|
6344
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dispose.md
|
|
6345
|
+
*/
|
|
6346
|
+
'unicorn/prefer-dispose'?: Linter.RuleEntry<[]>;
|
|
5866
6347
|
/**
|
|
5867
6348
|
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
5868
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6349
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-append.md
|
|
5869
6350
|
*/
|
|
5870
6351
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
5871
6352
|
/**
|
|
5872
6353
|
* Renamed to `unicorn/dom-node-dataset`.
|
|
5873
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6354
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
5874
6355
|
* @deprecated
|
|
5875
6356
|
*/
|
|
5876
6357
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6358
|
+
/**
|
|
6359
|
+
* Prefer `.getHTML()` and `.setHTML()` over `.innerHTML`.
|
|
6360
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-html-methods.md
|
|
6361
|
+
*/
|
|
6362
|
+
'unicorn/prefer-dom-node-html-methods'?: Linter.RuleEntry<[]>;
|
|
5877
6363
|
/**
|
|
5878
6364
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
5879
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6365
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-remove.md
|
|
5880
6366
|
*/
|
|
5881
6367
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6368
|
+
/**
|
|
6369
|
+
* Prefer `.replaceChildren()` when emptying DOM children.
|
|
6370
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-replace-children.md
|
|
6371
|
+
*/
|
|
6372
|
+
'unicorn/prefer-dom-node-replace-children'?: Linter.RuleEntry<[]>;
|
|
5882
6373
|
/**
|
|
5883
6374
|
* Prefer `.textContent` over `.innerText`.
|
|
5884
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6375
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
5885
6376
|
*/
|
|
5886
6377
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6378
|
+
/**
|
|
6379
|
+
* Prefer early returns over full-function conditional wrapping.
|
|
6380
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-early-return.md
|
|
6381
|
+
*/
|
|
6382
|
+
'unicorn/prefer-early-return'?: Linter.RuleEntry<UnicornPreferEarlyReturn>;
|
|
6383
|
+
/**
|
|
6384
|
+
* Prefer `else if` over adjacent `if` statements with related conditions.
|
|
6385
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-else-if.md
|
|
6386
|
+
*/
|
|
6387
|
+
'unicorn/prefer-else-if'?: Linter.RuleEntry<[]>;
|
|
6388
|
+
/**
|
|
6389
|
+
* Prefer `Error.isError()` when checking for errors.
|
|
6390
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-error-is-error.md
|
|
6391
|
+
*/
|
|
6392
|
+
'unicorn/prefer-error-is-error'?: Linter.RuleEntry<[]>;
|
|
5887
6393
|
/**
|
|
5888
6394
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
5889
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6395
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-event-target.md
|
|
5890
6396
|
*/
|
|
5891
6397
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
5892
6398
|
/**
|
|
5893
6399
|
* Prefer `export…from` when re-exporting.
|
|
5894
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6400
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-export-from.md
|
|
5895
6401
|
*/
|
|
5896
6402
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6403
|
+
/**
|
|
6404
|
+
* Prefer flat `Math.min()` and `Math.max()` calls over nested calls.
|
|
6405
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-flat-math-min-max.md
|
|
6406
|
+
*/
|
|
6407
|
+
'unicorn/prefer-flat-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5897
6408
|
/**
|
|
5898
6409
|
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
5899
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6410
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-get-or-insert-computed.md
|
|
5900
6411
|
*/
|
|
5901
6412
|
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>;
|
|
6413
|
+
/**
|
|
6414
|
+
* Prefer global numeric constants over `Number` static properties.
|
|
6415
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-global-number-constants.md
|
|
6416
|
+
*/
|
|
6417
|
+
'unicorn/prefer-global-number-constants'?: Linter.RuleEntry<[]>;
|
|
5902
6418
|
/**
|
|
5903
6419
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
5904
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6420
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-global-this.md
|
|
5905
6421
|
*/
|
|
5906
6422
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6423
|
+
/**
|
|
6424
|
+
* Prefer `.has()` when checking existence.
|
|
6425
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-has-check.md
|
|
6426
|
+
*/
|
|
6427
|
+
'unicorn/prefer-has-check'?: Linter.RuleEntry<[]>;
|
|
6428
|
+
/**
|
|
6429
|
+
* Prefer moving code shared by all branches of an `if` statement out of the branches.
|
|
6430
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-hoisting-branch-code.md
|
|
6431
|
+
*/
|
|
6432
|
+
'unicorn/prefer-hoisting-branch-code'?: Linter.RuleEntry<[]>;
|
|
5907
6433
|
/**
|
|
5908
6434
|
* Prefer HTTPS over HTTP.
|
|
5909
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6435
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-https.md
|
|
5910
6436
|
*/
|
|
5911
6437
|
'unicorn/prefer-https'?: Linter.RuleEntry<[]>;
|
|
6438
|
+
/**
|
|
6439
|
+
* Prefer identifiers over string literals in import and export specifiers.
|
|
6440
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-identifier-import-export-specifiers.md
|
|
6441
|
+
*/
|
|
6442
|
+
'unicorn/prefer-identifier-import-export-specifiers'?: Linter.RuleEntry<[]>;
|
|
5912
6443
|
/**
|
|
5913
6444
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
5914
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6445
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-import-meta-properties.md
|
|
5915
6446
|
*/
|
|
5916
6447
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
5917
6448
|
/**
|
|
5918
6449
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
5919
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6450
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-includes.md
|
|
5920
6451
|
*/
|
|
5921
6452
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
5922
6453
|
/**
|
|
5923
6454
|
* Prefer `.includes()` over repeated equality comparisons.
|
|
5924
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6455
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
5925
6456
|
*/
|
|
5926
6457
|
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>;
|
|
6458
|
+
/**
|
|
6459
|
+
* Prefer passing iterables directly to constructors instead of filling empty collections.
|
|
6460
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterable-in-constructor.md
|
|
6461
|
+
*/
|
|
6462
|
+
'unicorn/prefer-iterable-in-constructor'?: Linter.RuleEntry<[]>;
|
|
5927
6463
|
/**
|
|
5928
6464
|
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
5929
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6465
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-concat.md
|
|
5930
6466
|
*/
|
|
5931
6467
|
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>;
|
|
6468
|
+
/**
|
|
6469
|
+
* Prefer `Iterator#toArray()` over temporary arrays from iterator spreads.
|
|
6470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-to-array.md
|
|
6471
|
+
*/
|
|
6472
|
+
'unicorn/prefer-iterator-to-array'?: Linter.RuleEntry<[]>;
|
|
5932
6473
|
/**
|
|
5933
6474
|
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
5934
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-iterator-to-array-at-end.md
|
|
5935
6476
|
*/
|
|
5936
6477
|
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>;
|
|
5937
6478
|
/**
|
|
5938
6479
|
* Renamed to `unicorn/consistent-json-file-read`.
|
|
5939
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
5940
6481
|
* @deprecated
|
|
5941
6482
|
*/
|
|
5942
6483
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
5943
6484
|
/**
|
|
5944
6485
|
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
5945
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6486
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
5946
6487
|
*/
|
|
5947
6488
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6489
|
+
/**
|
|
6490
|
+
* Prefer `location.assign()` over assigning to `location.href`.
|
|
6491
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-location-assign.md
|
|
6492
|
+
*/
|
|
6493
|
+
'unicorn/prefer-location-assign'?: Linter.RuleEntry<[]>;
|
|
5948
6494
|
/**
|
|
5949
6495
|
* Prefer using a logical operator over a ternary.
|
|
5950
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6496
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
5951
6497
|
*/
|
|
5952
6498
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6499
|
+
/**
|
|
6500
|
+
* Prefer `new Map()` over `Object.fromEntries()` when using the result as a map.
|
|
6501
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-map-from-entries.md
|
|
6502
|
+
*/
|
|
6503
|
+
'unicorn/prefer-map-from-entries'?: Linter.RuleEntry<[]>;
|
|
5953
6504
|
/**
|
|
5954
6505
|
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
5955
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6506
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-abs.md
|
|
5956
6507
|
*/
|
|
5957
6508
|
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>;
|
|
6509
|
+
/**
|
|
6510
|
+
* Prefer `Math` constants over their approximate numeric values.
|
|
6511
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-constants.md
|
|
6512
|
+
*/
|
|
6513
|
+
'unicorn/prefer-math-constants'?: Linter.RuleEntry<[]>;
|
|
5958
6514
|
/**
|
|
5959
6515
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
5960
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6516
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-min-max.md
|
|
5961
6517
|
*/
|
|
5962
6518
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5963
6519
|
/**
|
|
5964
|
-
*
|
|
5965
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6520
|
+
* Prefer `Math.trunc()` for truncating numbers.
|
|
6521
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-math-trunc.md
|
|
5966
6522
|
*/
|
|
5967
6523
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
5968
6524
|
/**
|
|
5969
|
-
* Prefer
|
|
5970
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6525
|
+
* Prefer moving ternaries into the minimal varying part of an expression.
|
|
6526
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-minimal-ternary.md
|
|
6527
|
+
*/
|
|
6528
|
+
'unicorn/prefer-minimal-ternary'?: Linter.RuleEntry<UnicornPreferMinimalTernary>;
|
|
6529
|
+
/**
|
|
6530
|
+
* Prefer modern DOM APIs.
|
|
6531
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
5971
6532
|
*/
|
|
5972
6533
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
5973
6534
|
/**
|
|
5974
6535
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
5975
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6536
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-modern-math-apis.md
|
|
5976
6537
|
*/
|
|
5977
6538
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
5978
6539
|
/**
|
|
5979
6540
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
5980
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6541
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-module.md
|
|
5981
6542
|
*/
|
|
5982
6543
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
5983
6544
|
/**
|
|
5984
6545
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
5985
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6546
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
5986
6547
|
*/
|
|
5987
6548
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
5988
6549
|
/**
|
|
5989
6550
|
* Prefer negative index over `.length - index` when possible.
|
|
5990
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6551
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-negative-index.md
|
|
5991
6552
|
*/
|
|
5992
6553
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
5993
6554
|
/**
|
|
5994
6555
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
5995
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6556
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-node-protocol.md
|
|
5996
6557
|
*/
|
|
5997
6558
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
5998
6559
|
/**
|
|
5999
|
-
* Prefer `Number`
|
|
6000
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6560
|
+
* Prefer `Number()` over `parseFloat()` and base-10 `parseInt()`.
|
|
6561
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-coercion.md
|
|
6562
|
+
*/
|
|
6563
|
+
'unicorn/prefer-number-coercion'?: Linter.RuleEntry<[]>;
|
|
6564
|
+
/**
|
|
6565
|
+
* Prefer `Number.isSafeInteger()` over integer checks.
|
|
6566
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-is-safe-integer.md
|
|
6567
|
+
*/
|
|
6568
|
+
'unicorn/prefer-number-is-safe-integer'?: Linter.RuleEntry<[]>;
|
|
6569
|
+
/**
|
|
6570
|
+
* Prefer `Number` static methods over global functions and optionally static properties over global constants.
|
|
6571
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-number-properties.md
|
|
6001
6572
|
*/
|
|
6002
6573
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6574
|
+
/**
|
|
6575
|
+
* Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.
|
|
6576
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-define-properties.md
|
|
6577
|
+
*/
|
|
6578
|
+
'unicorn/prefer-object-define-properties'?: Linter.RuleEntry<[]>;
|
|
6579
|
+
/**
|
|
6580
|
+
* Prefer object destructuring defaults over default object literals with spread.
|
|
6581
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-destructuring-defaults.md
|
|
6582
|
+
*/
|
|
6583
|
+
'unicorn/prefer-object-destructuring-defaults'?: Linter.RuleEntry<[]>;
|
|
6003
6584
|
/**
|
|
6004
6585
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6005
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6586
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-from-entries.md
|
|
6006
6587
|
*/
|
|
6007
6588
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6589
|
+
/**
|
|
6590
|
+
* Prefer the most specific `Object` iterable method.
|
|
6591
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-object-iterable-methods.md
|
|
6592
|
+
*/
|
|
6593
|
+
'unicorn/prefer-object-iterable-methods'?: Linter.RuleEntry<[]>;
|
|
6594
|
+
/**
|
|
6595
|
+
* Prefer observer APIs over resize and scroll listeners with layout reads.
|
|
6596
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-observer-apis.md
|
|
6597
|
+
*/
|
|
6598
|
+
'unicorn/prefer-observer-apis'?: Linter.RuleEntry<[]>;
|
|
6008
6599
|
/**
|
|
6009
6600
|
* Prefer omitting the `catch` binding parameter.
|
|
6010
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6601
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
6011
6602
|
*/
|
|
6012
6603
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6604
|
+
/**
|
|
6605
|
+
* Prefer `Path2D` for repeatedly drawn canvas paths.
|
|
6606
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-path2d.md
|
|
6607
|
+
*/
|
|
6608
|
+
'unicorn/prefer-path2d'?: Linter.RuleEntry<[]>;
|
|
6609
|
+
/**
|
|
6610
|
+
* Prefer private class fields over the underscore-prefix convention.
|
|
6611
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-private-class-fields.md
|
|
6612
|
+
*/
|
|
6613
|
+
'unicorn/prefer-private-class-fields'?: Linter.RuleEntry<[]>;
|
|
6614
|
+
/**
|
|
6615
|
+
* Prefer `Promise.try()` over promise-wrapping boilerplate.
|
|
6616
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-promise-try.md
|
|
6617
|
+
*/
|
|
6618
|
+
'unicorn/prefer-promise-try'?: Linter.RuleEntry<[]>;
|
|
6619
|
+
/**
|
|
6620
|
+
* Prefer `Promise.withResolvers()` when extracting resolver functions from `new Promise()`.
|
|
6621
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-promise-with-resolvers.md
|
|
6622
|
+
*/
|
|
6623
|
+
'unicorn/prefer-promise-with-resolvers'?: Linter.RuleEntry<[]>;
|
|
6013
6624
|
/**
|
|
6014
6625
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6015
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6626
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-prototype-methods.md
|
|
6016
6627
|
*/
|
|
6017
6628
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6018
6629
|
/**
|
|
6019
6630
|
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
6020
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6631
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-query-selector.md
|
|
6021
6632
|
*/
|
|
6022
6633
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>;
|
|
6023
6634
|
/**
|
|
6024
6635
|
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
6025
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6636
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-queue-microtask.md
|
|
6026
6637
|
*/
|
|
6027
6638
|
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>;
|
|
6028
6639
|
/**
|
|
6029
6640
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6030
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6641
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-reflect-apply.md
|
|
6031
6642
|
*/
|
|
6032
6643
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6033
6644
|
/**
|
|
6034
|
-
* Prefer `RegExp
|
|
6035
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6645
|
+
* Prefer `RegExp.escape()` for escaping strings to use in regular expressions.
|
|
6646
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-regexp-escape.md
|
|
6647
|
+
*/
|
|
6648
|
+
'unicorn/prefer-regexp-escape'?: Linter.RuleEntry<[]>;
|
|
6649
|
+
/**
|
|
6650
|
+
* Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.
|
|
6651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-regexp-test.md
|
|
6036
6652
|
*/
|
|
6037
6653
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6038
6654
|
/**
|
|
6039
6655
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
6040
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-response-static-json.md
|
|
6041
6657
|
*/
|
|
6042
6658
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
6659
|
+
/**
|
|
6660
|
+
* Prefer `:scope` when using element query selector methods.
|
|
6661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-scoped-selector.md
|
|
6662
|
+
*/
|
|
6663
|
+
'unicorn/prefer-scoped-selector'?: Linter.RuleEntry<[]>;
|
|
6043
6664
|
/**
|
|
6044
6665
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6045
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-has.md
|
|
6046
6667
|
*/
|
|
6047
6668
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>;
|
|
6669
|
+
/**
|
|
6670
|
+
* Prefer `Set` methods for Set operations.
|
|
6671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-methods.md
|
|
6672
|
+
*/
|
|
6673
|
+
'unicorn/prefer-set-methods'?: Linter.RuleEntry<[]>;
|
|
6048
6674
|
/**
|
|
6049
6675
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6050
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6676
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-set-size.md
|
|
6051
6677
|
*/
|
|
6052
6678
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6679
|
+
/**
|
|
6680
|
+
* Prefer arrow function properties over methods with a single return.
|
|
6681
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-short-arrow-method.md
|
|
6682
|
+
*/
|
|
6683
|
+
'unicorn/prefer-short-arrow-method'?: Linter.RuleEntry<[]>;
|
|
6053
6684
|
/**
|
|
6054
6685
|
* Prefer simple conditions first in logical expressions.
|
|
6055
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6686
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-simple-condition-first.md
|
|
6056
6687
|
*/
|
|
6057
6688
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>;
|
|
6689
|
+
/**
|
|
6690
|
+
* Prefer a simple comparison function for `Array#sort()`.
|
|
6691
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-simple-sort-comparator.md
|
|
6692
|
+
*/
|
|
6693
|
+
'unicorn/prefer-simple-sort-comparator'?: Linter.RuleEntry<[]>;
|
|
6694
|
+
/**
|
|
6695
|
+
* Prefer a single `Array#some()` or `Array#every()` with a combined predicate.
|
|
6696
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-array-predicate.md
|
|
6697
|
+
*/
|
|
6698
|
+
'unicorn/prefer-single-array-predicate'?: Linter.RuleEntry<[]>;
|
|
6058
6699
|
/**
|
|
6059
6700
|
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6060
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6701
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-call.md
|
|
6061
6702
|
*/
|
|
6062
6703
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6704
|
+
/**
|
|
6705
|
+
* Prefer a single object destructuring declaration per local const source.
|
|
6706
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-object-destructuring.md
|
|
6707
|
+
*/
|
|
6708
|
+
'unicorn/prefer-single-object-destructuring'?: Linter.RuleEntry<[]>;
|
|
6709
|
+
/**
|
|
6710
|
+
* Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.
|
|
6711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-single-replace.md
|
|
6712
|
+
*/
|
|
6713
|
+
'unicorn/prefer-single-replace'?: Linter.RuleEntry<[]>;
|
|
6714
|
+
/**
|
|
6715
|
+
* Prefer declaring variables in the smallest possible scope.
|
|
6716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-smaller-scope.md
|
|
6717
|
+
*/
|
|
6718
|
+
'unicorn/prefer-smaller-scope'?: Linter.RuleEntry<[]>;
|
|
6063
6719
|
/**
|
|
6064
6720
|
* Prefer `String#split()` with a limit.
|
|
6065
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-split-limit.md
|
|
6066
6722
|
*/
|
|
6067
6723
|
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>;
|
|
6068
6724
|
/**
|
|
6069
|
-
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()
|
|
6070
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6725
|
+
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()`, and trivial `for…of` copies.
|
|
6726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-spread.md
|
|
6071
6727
|
*/
|
|
6072
6728
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6073
6729
|
/**
|
|
6074
6730
|
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
6075
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-match-all.md
|
|
6076
6732
|
*/
|
|
6077
6733
|
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>;
|
|
6078
6734
|
/**
|
|
6079
6735
|
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
6080
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-pad-start-end.md
|
|
6081
6737
|
*/
|
|
6082
6738
|
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>;
|
|
6083
6739
|
/**
|
|
6084
6740
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6085
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-raw.md
|
|
6086
6742
|
*/
|
|
6087
6743
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6088
6744
|
/**
|
|
6089
6745
|
* Prefer `String#repeat()` for repeated whitespace.
|
|
6090
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6746
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-repeat.md
|
|
6091
6747
|
*/
|
|
6092
6748
|
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>;
|
|
6093
6749
|
/**
|
|
6094
6750
|
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
6095
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6751
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-replace-all.md
|
|
6096
6752
|
*/
|
|
6097
6753
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6098
6754
|
/**
|
|
6099
6755
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6100
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-slice.md
|
|
6101
6757
|
*/
|
|
6102
6758
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6103
6759
|
/**
|
|
6104
|
-
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6105
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6760
|
+
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()` and `String#indexOf() === 0`.
|
|
6761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
6106
6762
|
*/
|
|
6107
6763
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6108
6764
|
/**
|
|
6109
6765
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6110
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6766
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
6111
6767
|
*/
|
|
6112
6768
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6113
6769
|
/**
|
|
6114
6770
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6115
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6771
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-structured-clone.md
|
|
6116
6772
|
*/
|
|
6117
6773
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6118
6774
|
/**
|
|
6119
6775
|
* Prefer `switch` over multiple `else-if`.
|
|
6120
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6776
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-switch.md
|
|
6121
6777
|
*/
|
|
6122
6778
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6123
6779
|
/**
|
|
6124
|
-
* Prefer
|
|
6125
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6780
|
+
* Prefer `Temporal` over `Date`.
|
|
6781
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-temporal.md
|
|
6782
|
+
*/
|
|
6783
|
+
'unicorn/prefer-temporal'?: Linter.RuleEntry<UnicornPreferTemporal>;
|
|
6784
|
+
/**
|
|
6785
|
+
* Prefer ternary expressions over simple `if` statements that return or assign values.
|
|
6786
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-ternary.md
|
|
6126
6787
|
*/
|
|
6127
6788
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6789
|
+
/**
|
|
6790
|
+
* Prefer using `Element#toggleAttribute()` to toggle attributes.
|
|
6791
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-toggle-attribute.md
|
|
6792
|
+
*/
|
|
6793
|
+
'unicorn/prefer-toggle-attribute'?: Linter.RuleEntry<[]>;
|
|
6128
6794
|
/**
|
|
6129
6795
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6130
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6796
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-top-level-await.md
|
|
6131
6797
|
*/
|
|
6132
6798
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6133
6799
|
/**
|
|
6134
6800
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6135
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6801
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-type-error.md
|
|
6136
6802
|
*/
|
|
6137
6803
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6138
6804
|
/**
|
|
6139
|
-
*
|
|
6140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6805
|
+
* Require type literals to be last in union types.
|
|
6806
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-type-literal-last.md
|
|
6141
6807
|
*/
|
|
6142
|
-
'unicorn/
|
|
6808
|
+
'unicorn/prefer-type-literal-last'?: Linter.RuleEntry<[]>;
|
|
6809
|
+
/**
|
|
6810
|
+
* Prefer `Uint8Array#toBase64()` and `Uint8Array.fromBase64()` over `atob()`, `btoa()`, and `Buffer` base64 conversions.
|
|
6811
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-uint8array-base64.md
|
|
6812
|
+
*/
|
|
6813
|
+
'unicorn/prefer-uint8array-base64'?: Linter.RuleEntry<[]>;
|
|
6814
|
+
/**
|
|
6815
|
+
* Prefer the unary minus operator over multiplying or dividing by `-1`.
|
|
6816
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-unary-minus.md
|
|
6817
|
+
*/
|
|
6818
|
+
'unicorn/prefer-unary-minus'?: Linter.RuleEntry<[]>;
|
|
6819
|
+
/**
|
|
6820
|
+
* Prefer Unicode code point escapes over legacy escape sequences.
|
|
6821
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-unicode-code-point-escapes.md
|
|
6822
|
+
*/
|
|
6823
|
+
'unicorn/prefer-unicode-code-point-escapes'?: Linter.RuleEntry<[]>;
|
|
6824
|
+
/**
|
|
6825
|
+
* Prefer `URL.canParse()` over constructing a `URL` in a try/catch for validation.
|
|
6826
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-can-parse.md
|
|
6827
|
+
*/
|
|
6828
|
+
'unicorn/prefer-url-can-parse'?: Linter.RuleEntry<[]>;
|
|
6829
|
+
/**
|
|
6830
|
+
* Prefer `URL#href` over stringifying a `URL`.
|
|
6831
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-href.md
|
|
6832
|
+
*/
|
|
6833
|
+
'unicorn/prefer-url-href'?: Linter.RuleEntry<[]>;
|
|
6834
|
+
/**
|
|
6835
|
+
* Prefer `URLSearchParams` over manually splitting query strings.
|
|
6836
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-url-search-parameters.md
|
|
6837
|
+
*/
|
|
6838
|
+
'unicorn/prefer-url-search-parameters'?: Linter.RuleEntry<[]>;
|
|
6839
|
+
/**
|
|
6840
|
+
* Prefer putting the condition in the while statement.
|
|
6841
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/prefer-while-loop-condition.md
|
|
6842
|
+
*/
|
|
6843
|
+
'unicorn/prefer-while-loop-condition'?: Linter.RuleEntry<[]>;
|
|
6844
|
+
/**
|
|
6845
|
+
* Renamed to `unicorn/name-replacements`.
|
|
6846
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/deleted-and-deprecated-rules.md#prevent-abbreviations
|
|
6847
|
+
* @deprecated
|
|
6848
|
+
*/
|
|
6849
|
+
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<[]>;
|
|
6143
6850
|
/**
|
|
6144
6851
|
* Enforce consistent relative URL style.
|
|
6145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6852
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/relative-url-style.md
|
|
6146
6853
|
*/
|
|
6147
6854
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6148
6855
|
/**
|
|
6149
6856
|
* Enforce using the separator argument with `Array#join()`.
|
|
6150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6857
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-array-join-separator.md
|
|
6151
6858
|
*/
|
|
6152
6859
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6860
|
+
/**
|
|
6861
|
+
* Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
|
|
6862
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-array-sort-compare.md
|
|
6863
|
+
*/
|
|
6864
|
+
'unicorn/require-array-sort-compare'?: Linter.RuleEntry<[]>;
|
|
6153
6865
|
/**
|
|
6154
6866
|
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
6155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6867
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-css-escape.md
|
|
6156
6868
|
*/
|
|
6157
6869
|
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>;
|
|
6158
6870
|
/**
|
|
6159
6871
|
* Require non-empty module attributes for imports and exports
|
|
6160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6872
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-module-attributes.md
|
|
6161
6873
|
*/
|
|
6162
6874
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6163
6875
|
/**
|
|
6164
6876
|
* Require non-empty specifier list in import and export statements.
|
|
6165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6877
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-module-specifiers.md
|
|
6166
6878
|
*/
|
|
6167
6879
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6168
6880
|
/**
|
|
6169
6881
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6882
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6171
6883
|
*/
|
|
6172
6884
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6173
6885
|
/**
|
|
6174
6886
|
* Require passive event listeners for high-frequency events.
|
|
6175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6887
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-passive-events.md
|
|
6176
6888
|
*/
|
|
6177
6889
|
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>;
|
|
6178
6890
|
/**
|
|
6179
6891
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6892
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-post-message-target-origin.md
|
|
6181
6893
|
*/
|
|
6182
6894
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6895
|
+
/**
|
|
6896
|
+
* Require boolean-returning Proxy traps to return booleans.
|
|
6897
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/require-proxy-trap-boolean-return.md
|
|
6898
|
+
*/
|
|
6899
|
+
'unicorn/require-proxy-trap-boolean-return'?: Linter.RuleEntry<[]>;
|
|
6183
6900
|
/**
|
|
6184
6901
|
* Enforce better string content.
|
|
6185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6902
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/string-content.md
|
|
6186
6903
|
*/
|
|
6187
6904
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6188
6905
|
/**
|
|
6189
6906
|
* Enforce consistent brace style for `case` clauses.
|
|
6190
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6907
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/switch-case-braces.md
|
|
6191
6908
|
*/
|
|
6192
6909
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6193
6910
|
/**
|
|
6194
6911
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
6195
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6912
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/switch-case-break-position.md
|
|
6196
6913
|
*/
|
|
6197
6914
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>;
|
|
6198
6915
|
/**
|
|
6199
6916
|
* Fix whitespace-insensitive template indentation.
|
|
6200
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6917
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/template-indent.md
|
|
6201
6918
|
*/
|
|
6202
6919
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6203
6920
|
/**
|
|
6204
6921
|
* Enforce consistent case for text encoding identifiers.
|
|
6205
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6922
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/text-encoding-identifier-case.md
|
|
6206
6923
|
*/
|
|
6207
6924
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
6208
6925
|
/**
|
|
6209
6926
|
* Require `new` when creating an error.
|
|
6210
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6927
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/throw-new-error.md
|
|
6211
6928
|
*/
|
|
6212
6929
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6213
6930
|
/**
|
|
6214
6931
|
* Limit the complexity of `try` blocks.
|
|
6215
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6932
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/try-complexity.md
|
|
6216
6933
|
*/
|
|
6217
6934
|
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>;
|
|
6218
6935
|
/**
|
|
@@ -7616,6 +8333,11 @@ interface RuleOptions {
|
|
|
7616
8333
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html
|
|
7617
8334
|
*/
|
|
7618
8335
|
'yaml/no-tab-indent'?: Linter.RuleEntry<[]>;
|
|
8336
|
+
/**
|
|
8337
|
+
* disallow trailing whitespace at the end of lines
|
|
8338
|
+
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-spaces.html
|
|
8339
|
+
*/
|
|
8340
|
+
'yaml/no-trailing-spaces'?: Linter.RuleEntry<YamlNoTrailingSpaces>;
|
|
7619
8341
|
/**
|
|
7620
8342
|
* disallow trailing zeros for floats
|
|
7621
8343
|
* @see https://ota-meshi.github.io/eslint-plugin-yml/rules/no-trailing-zeros.html
|
|
@@ -15094,6 +15816,30 @@ type UnicodeBom = [] | [("always" | "never")]; // ----- unicorn/catch-error-name
|
|
|
15094
15816
|
type UnicornCatchErrorName = [] | [{
|
|
15095
15817
|
name?: string;
|
|
15096
15818
|
ignore?: unknown[];
|
|
15819
|
+
}]; // ----- unicorn/class-reference-in-static-methods -----
|
|
15820
|
+
type UnicornClassReferenceInStaticMethods = [] | [{
|
|
15821
|
+
preferThis?: boolean;
|
|
15822
|
+
preferSuper?: boolean;
|
|
15823
|
+
}]; // ----- unicorn/comment-content -----
|
|
15824
|
+
type UnicornCommentContent = [] | [{
|
|
15825
|
+
checkUniformCase?: boolean;
|
|
15826
|
+
extendDefaultReplacements?: boolean;
|
|
15827
|
+
replacements?: {
|
|
15828
|
+
[k: string]: (false | string | {
|
|
15829
|
+
replacement: string;
|
|
15830
|
+
caseSensitive?: boolean;
|
|
15831
|
+
}) | undefined;
|
|
15832
|
+
};
|
|
15833
|
+
}]; // ----- unicorn/consistent-boolean-name -----
|
|
15834
|
+
type UnicornConsistentBooleanName = [] | [{
|
|
15835
|
+
checkProperties?: boolean;
|
|
15836
|
+
prefixes?: {
|
|
15837
|
+
[k: string]: boolean | undefined;
|
|
15838
|
+
};
|
|
15839
|
+
ignore?: unknown[];
|
|
15840
|
+
}]; // ----- unicorn/consistent-class-member-order -----
|
|
15841
|
+
type UnicornConsistentClassMemberOrder = [] | [{
|
|
15842
|
+
order?: [("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method")];
|
|
15097
15843
|
}]; // ----- unicorn/consistent-compound-words -----
|
|
15098
15844
|
type UnicornConsistentCompoundWords = [] | [{
|
|
15099
15845
|
checkProperties?: boolean;
|
|
@@ -15110,11 +15856,26 @@ interface _UnicornConsistentCompoundWords_Replacements {
|
|
|
15110
15856
|
}
|
|
15111
15857
|
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
15112
15858
|
[k: string]: true | undefined;
|
|
15113
|
-
} // ----- unicorn/consistent-
|
|
15859
|
+
} // ----- unicorn/consistent-conditional-object-spread -----
|
|
15860
|
+
type UnicornConsistentConditionalObjectSpread = [] | [("logical" | "ternary")]; // ----- unicorn/consistent-export-decorator-position -----
|
|
15861
|
+
type UnicornConsistentExportDecoratorPosition = [] | [("above" | "before" | "after")]; // ----- unicorn/consistent-function-scoping -----
|
|
15114
15862
|
type UnicornConsistentFunctionScoping = [] | [{
|
|
15115
15863
|
checkArrowFunctions?: boolean;
|
|
15864
|
+
}]; // ----- unicorn/consistent-function-style -----
|
|
15865
|
+
type UnicornConsistentFunctionStyle = [] | [{
|
|
15866
|
+
default?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
15867
|
+
namedFunctions?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
15868
|
+
namedExports?: ("declaration" | "function-expression" | "arrow-function" | "ignore");
|
|
15869
|
+
callbacks?: ("function-expression" | "arrow-function" | "ignore");
|
|
15870
|
+
objectProperties?: ("method" | "function-expression" | "arrow-function" | "ignore");
|
|
15871
|
+
reassignedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
15872
|
+
typedVariables?: ("function-expression" | "arrow-function" | "ignore");
|
|
15116
15873
|
}]; // ----- unicorn/consistent-json-file-read -----
|
|
15117
|
-
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/
|
|
15874
|
+
type UnicornConsistentJsonFileRead = [] | [("string" | "buffer")]; // ----- unicorn/default-export-style -----
|
|
15875
|
+
type UnicornDefaultExportStyle = [] | [{
|
|
15876
|
+
functions?: ("inline" | "separate" | "ignore");
|
|
15877
|
+
classes?: ("inline" | "separate" | "ignore");
|
|
15878
|
+
}]; // ----- unicorn/dom-node-dataset -----
|
|
15118
15879
|
type UnicornDomNodeDataset = [] | [{
|
|
15119
15880
|
preferAttributes?: boolean;
|
|
15120
15881
|
}]; // ----- unicorn/escape-case -----
|
|
@@ -15129,15 +15890,17 @@ type UnicornExpiringTodoComments = [] | [{
|
|
|
15129
15890
|
}]; // ----- unicorn/explicit-length-check -----
|
|
15130
15891
|
type UnicornExplicitLengthCheck = [] | [{
|
|
15131
15892
|
"non-zero"?: ("greater-than" | "not-equal");
|
|
15132
|
-
}]; // ----- unicorn/
|
|
15893
|
+
}]; // ----- unicorn/explicit-timer-delay -----
|
|
15894
|
+
type UnicornExplicitTimerDelay = [] | [("always" | "never")]; // ----- unicorn/filename-case -----
|
|
15133
15895
|
type UnicornFilenameCase = [] | [({
|
|
15134
|
-
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
15896
|
+
case?: ("camelCase" | "camelCaseWithAcronyms" | "snakeCase" | "kebabCase" | "pascalCase");
|
|
15135
15897
|
ignore?: unknown[];
|
|
15136
15898
|
multipleFileExtensions?: boolean;
|
|
15137
15899
|
checkDirectories?: boolean;
|
|
15138
15900
|
} | {
|
|
15139
15901
|
cases?: {
|
|
15140
15902
|
camelCase?: boolean;
|
|
15903
|
+
camelCaseWithAcronyms?: boolean;
|
|
15141
15904
|
snakeCase?: boolean;
|
|
15142
15905
|
kebabCase?: boolean;
|
|
15143
15906
|
pascalCase?: boolean;
|
|
@@ -15145,7 +15908,14 @@ type UnicornFilenameCase = [] | [({
|
|
|
15145
15908
|
ignore?: unknown[];
|
|
15146
15909
|
multipleFileExtensions?: boolean;
|
|
15147
15910
|
checkDirectories?: boolean;
|
|
15148
|
-
})]; // ----- unicorn/
|
|
15911
|
+
})]; // ----- unicorn/id-match -----
|
|
15912
|
+
type UnicornIdMatch = [] | [string] | [string, {
|
|
15913
|
+
properties?: boolean;
|
|
15914
|
+
classFields?: boolean;
|
|
15915
|
+
onlyDeclarations?: boolean;
|
|
15916
|
+
ignoreDestructuring?: boolean;
|
|
15917
|
+
checkNamedSpecifiers?: boolean;
|
|
15918
|
+
}]; // ----- unicorn/import-style -----
|
|
15149
15919
|
type UnicornImportStyle = [] | [{
|
|
15150
15920
|
checkImport?: boolean;
|
|
15151
15921
|
checkDynamicImport?: boolean;
|
|
@@ -15168,7 +15938,36 @@ type UnicornIsolatedFunctions = [] | [{
|
|
|
15168
15938
|
functions?: string[];
|
|
15169
15939
|
selectors?: string[];
|
|
15170
15940
|
comments?: string[];
|
|
15171
|
-
}]; // ----- unicorn/
|
|
15941
|
+
}]; // ----- unicorn/logical-assignment-operators -----
|
|
15942
|
+
type UnicornLogicalAssignmentOperators = (([] | ["always"] | ["always", {
|
|
15943
|
+
enforceForIfStatements?: boolean;
|
|
15944
|
+
}] | ["never"]) & unknown[]); // ----- unicorn/max-nested-calls -----
|
|
15945
|
+
type UnicornMaxNestedCalls = [] | [{
|
|
15946
|
+
max?: number;
|
|
15947
|
+
}]; // ----- unicorn/name-replacements -----
|
|
15948
|
+
type UnicornNameReplacements = [] | [{
|
|
15949
|
+
checkProperties?: boolean;
|
|
15950
|
+
checkVariables?: boolean;
|
|
15951
|
+
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
15952
|
+
checkShorthandImports?: (boolean | string);
|
|
15953
|
+
checkShorthandProperties?: boolean;
|
|
15954
|
+
checkFilenames?: boolean;
|
|
15955
|
+
extendDefaultReplacements?: boolean;
|
|
15956
|
+
replacements?: _UnicornNameReplacements_NameReplacements;
|
|
15957
|
+
extendDefaultAllowList?: boolean;
|
|
15958
|
+
allowList?: _UnicornNameReplacements_BooleanObject;
|
|
15959
|
+
ignore?: unknown[];
|
|
15960
|
+
}];
|
|
15961
|
+
type _UnicornNameReplacementsReplacements = (false | _UnicornNameReplacements_BooleanObject) | undefined;
|
|
15962
|
+
interface _UnicornNameReplacements_NameReplacements {
|
|
15963
|
+
[k: string]: _UnicornNameReplacementsReplacements | undefined;
|
|
15964
|
+
}
|
|
15965
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
15966
|
+
[k: string]: boolean | undefined;
|
|
15967
|
+
}
|
|
15968
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
15969
|
+
[k: string]: boolean | undefined;
|
|
15970
|
+
} // ----- unicorn/no-array-callback-reference -----
|
|
15172
15971
|
type UnicornNoArrayCallbackReference = [] | [{
|
|
15173
15972
|
ignore?: string[];
|
|
15174
15973
|
}]; // ----- unicorn/no-array-reduce -----
|
|
@@ -15189,11 +15988,23 @@ type UnicornNoInstanceofBuiltins = [] | [{
|
|
|
15189
15988
|
strategy?: ("loose" | "strict");
|
|
15190
15989
|
include?: string[];
|
|
15191
15990
|
exclude?: string[];
|
|
15991
|
+
}]; // ----- unicorn/no-invalid-argument-count -----
|
|
15992
|
+
type UnicornNoInvalidArgumentCount = [] | [{
|
|
15993
|
+
[k: string]: (number | [number, ...(number)[]] | {
|
|
15994
|
+
min?: number;
|
|
15995
|
+
max?: number;
|
|
15996
|
+
}) | undefined;
|
|
15192
15997
|
}]; // ----- unicorn/no-keyword-prefix -----
|
|
15193
15998
|
type UnicornNoKeywordPrefix = [] | [{
|
|
15194
15999
|
disallowedPrefixes?: [] | [string];
|
|
15195
16000
|
checkProperties?: boolean;
|
|
15196
16001
|
onlyCamelCase?: boolean;
|
|
16002
|
+
}]; // ----- unicorn/no-negated-comparison -----
|
|
16003
|
+
type UnicornNoNegatedComparison = [] | [{
|
|
16004
|
+
checkLogicalExpressions?: boolean;
|
|
16005
|
+
}]; // ----- unicorn/no-non-function-verb-prefix -----
|
|
16006
|
+
type UnicornNoNonFunctionVerbPrefix = [] | [{
|
|
16007
|
+
verbs?: string[];
|
|
15197
16008
|
}]; // ----- unicorn/no-null -----
|
|
15198
16009
|
type UnicornNoNull = [] | [{
|
|
15199
16010
|
checkArguments?: boolean;
|
|
@@ -15206,6 +16017,9 @@ type UnicornNoUnnecessaryPolyfills = [] | [{
|
|
|
15206
16017
|
targets?: (string | unknown[] | {
|
|
15207
16018
|
[k: string]: unknown | undefined;
|
|
15208
16019
|
});
|
|
16020
|
+
}]; // ----- unicorn/no-unreadable-array-destructuring -----
|
|
16021
|
+
type UnicornNoUnreadableArrayDestructuring = [] | [{
|
|
16022
|
+
maximumIgnoredElements?: number;
|
|
15209
16023
|
}]; // ----- unicorn/no-useless-undefined -----
|
|
15210
16024
|
type UnicornNoUselessUndefined = [] | [{
|
|
15211
16025
|
checkArguments?: boolean;
|
|
@@ -15237,7 +16051,8 @@ type UnicornNumericSeparatorsStyle = [] | [{
|
|
|
15237
16051
|
fractionGroupLength?: number;
|
|
15238
16052
|
};
|
|
15239
16053
|
onlyIfContainsSeparator?: boolean;
|
|
15240
|
-
}]; // ----- unicorn/
|
|
16054
|
+
}]; // ----- unicorn/operator-assignment -----
|
|
16055
|
+
type UnicornOperatorAssignment = [] | [("always" | "never")]; // ----- unicorn/prefer-add-event-listener -----
|
|
15241
16056
|
type UnicornPreferAddEventListener = [] | [{
|
|
15242
16057
|
excludedPackages?: string[];
|
|
15243
16058
|
}]; // ----- unicorn/prefer-array-find -----
|
|
@@ -15250,12 +16065,22 @@ type UnicornPreferArrayFlat = [] | [{
|
|
|
15250
16065
|
type UnicornPreferAt = [] | [{
|
|
15251
16066
|
getLastElementFunctions?: unknown[];
|
|
15252
16067
|
checkAllIndexAccess?: boolean;
|
|
16068
|
+
}]; // ----- unicorn/prefer-continue -----
|
|
16069
|
+
type UnicornPreferContinue = [] | [{
|
|
16070
|
+
maximumStatements?: number;
|
|
16071
|
+
}]; // ----- unicorn/prefer-early-return -----
|
|
16072
|
+
type UnicornPreferEarlyReturn = [] | [{
|
|
16073
|
+
maximumStatements?: number;
|
|
15253
16074
|
}]; // ----- unicorn/prefer-export-from -----
|
|
15254
16075
|
type UnicornPreferExportFrom = [] | [{
|
|
15255
16076
|
checkUsedVariables?: boolean;
|
|
15256
16077
|
}]; // ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
15257
16078
|
type UnicornPreferIncludesOverRepeatedComparisons = [] | [{
|
|
15258
16079
|
minimumComparisons?: number;
|
|
16080
|
+
}]; // ----- unicorn/prefer-minimal-ternary -----
|
|
16081
|
+
type UnicornPreferMinimalTernary = [] | [{
|
|
16082
|
+
checkVaryingCallee?: boolean;
|
|
16083
|
+
checkComputedMemberAccess?: boolean;
|
|
15259
16084
|
}]; // ----- unicorn/prefer-number-properties -----
|
|
15260
16085
|
type UnicornPreferNumberProperties = [] | [{
|
|
15261
16086
|
checkInfinity?: boolean;
|
|
@@ -15286,31 +16111,13 @@ type UnicornPreferStructuredClone = [] | [{
|
|
|
15286
16111
|
type UnicornPreferSwitch = [] | [{
|
|
15287
16112
|
minimumCases?: number;
|
|
15288
16113
|
emptyDefaultCase?: ("no-default-comment" | "do-nothing-comment" | "no-default-case");
|
|
16114
|
+
}]; // ----- unicorn/prefer-temporal -----
|
|
16115
|
+
type UnicornPreferTemporal = [] | [{
|
|
16116
|
+
checkDateNow?: boolean;
|
|
16117
|
+
checkReferences?: boolean;
|
|
16118
|
+
checkMethods?: boolean;
|
|
15289
16119
|
}]; // ----- unicorn/prefer-ternary -----
|
|
15290
|
-
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/
|
|
15291
|
-
type UnicornPreventAbbreviations = [] | [{
|
|
15292
|
-
checkProperties?: boolean;
|
|
15293
|
-
checkVariables?: boolean;
|
|
15294
|
-
checkDefaultAndNamespaceImports?: (boolean | string);
|
|
15295
|
-
checkShorthandImports?: (boolean | string);
|
|
15296
|
-
checkShorthandProperties?: boolean;
|
|
15297
|
-
checkFilenames?: boolean;
|
|
15298
|
-
extendDefaultReplacements?: boolean;
|
|
15299
|
-
replacements?: _UnicornPreventAbbreviations_Abbreviations;
|
|
15300
|
-
extendDefaultAllowList?: boolean;
|
|
15301
|
-
allowList?: _UnicornPreventAbbreviations_BooleanObject;
|
|
15302
|
-
ignore?: unknown[];
|
|
15303
|
-
}];
|
|
15304
|
-
type _UnicornPreventAbbreviationsReplacements = (false | _UnicornPreventAbbreviations_BooleanObject) | undefined;
|
|
15305
|
-
interface _UnicornPreventAbbreviations_Abbreviations {
|
|
15306
|
-
[k: string]: _UnicornPreventAbbreviationsReplacements | undefined;
|
|
15307
|
-
}
|
|
15308
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
15309
|
-
[k: string]: boolean | undefined;
|
|
15310
|
-
}
|
|
15311
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
15312
|
-
[k: string]: boolean | undefined;
|
|
15313
|
-
} // ----- unicorn/relative-url-style -----
|
|
16120
|
+
type UnicornPreferTernary = [] | [("always" | "only-single-line")]; // ----- unicorn/relative-url-style -----
|
|
15314
16121
|
type UnicornRelativeUrlStyle = [] | [("never" | "always")]; // ----- unicorn/require-css-escape -----
|
|
15315
16122
|
type UnicornRequireCssEscape = [] | [{
|
|
15316
16123
|
checkAllSelectors?: boolean;
|
|
@@ -15326,7 +16133,7 @@ type UnicornStringContent = [] | [{
|
|
|
15326
16133
|
};
|
|
15327
16134
|
selectors?: string[];
|
|
15328
16135
|
}]; // ----- unicorn/switch-case-braces -----
|
|
15329
|
-
type UnicornSwitchCaseBraces = [] | [("always" | "avoid")]; // ----- unicorn/template-indent -----
|
|
16136
|
+
type UnicornSwitchCaseBraces = [] | [("always" | "avoid" | "single-statement")]; // ----- unicorn/template-indent -----
|
|
15330
16137
|
type UnicornTemplateIndent = [] | [{
|
|
15331
16138
|
indent?: (string | number);
|
|
15332
16139
|
tags?: string[];
|
|
@@ -16612,6 +17419,10 @@ type YamlNoMultipleEmptyLines = [] | [{
|
|
|
16612
17419
|
max: number;
|
|
16613
17420
|
maxEOF?: number;
|
|
16614
17421
|
maxBOF?: number;
|
|
17422
|
+
}]; // ----- yaml/no-trailing-spaces -----
|
|
17423
|
+
type YamlNoTrailingSpaces = [] | [{
|
|
17424
|
+
skipBlankLines?: boolean;
|
|
17425
|
+
ignoreComments?: boolean;
|
|
16615
17426
|
}]; // ----- yaml/plain-scalar -----
|
|
16616
17427
|
type YamlPlainScalar = [] | [("always" | "never")] | [("always" | "never"), {
|
|
16617
17428
|
ignorePatterns?: string[];
|
|
@@ -16706,6 +17517,6 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16706
17517
|
exceptRange?: boolean;
|
|
16707
17518
|
onlyEquality?: boolean;
|
|
16708
17519
|
}]; // Names of all the configs
|
|
16709
|
-
type ConfigNames = 'eienjs/gitignore' | 'eienjs/ignores' | 'eienjs/javascript/setup' | 'eienjs/javascript/rules' | 'eienjs/eslint-comments/rules' | 'eienjs/command/rules' | 'eienjs/perfectionist/setup' | 'eienjs/node/setup' | 'eienjs/node/rules' | 'eienjs/jsdoc/setup' | 'eienjs/jsdoc/rules' | 'eienjs/imports/rules' | 'eienjs/e18e/setup' | 'eienjs/e18e/rules' | 'eienjs/unicorn/
|
|
17520
|
+
type ConfigNames = 'eienjs/gitignore' | 'eienjs/ignores' | 'eienjs/javascript/setup' | 'eienjs/javascript/rules' | 'eienjs/eslint-comments/rules' | 'eienjs/command/rules' | 'eienjs/perfectionist/setup' | 'eienjs/node/setup' | 'eienjs/node/rules' | 'eienjs/jsdoc/setup' | 'eienjs/jsdoc/rules' | 'eienjs/imports/rules' | 'eienjs/e18e/setup' | 'eienjs/e18e/rules' | 'eienjs/unicorn/setup' | 'eienjs/unicorn/rules' | 'eienjs/typescript/setup' | 'eienjs/typescript/parser' | 'eienjs/typescript/type-aware-parser' | 'eienjs/typescript/rules' | 'eienjs/typescript/rules-type-aware' | 'eienjs/typescript/disables' | 'eienjs/typescript/erasable-syntax-only' | 'eienjs/stylistic/rules' | 'eienjs/regexp/rules' | 'eienjs/test/setup' | 'eienjs/test/rules' | 'eienjs/vue/setup' | 'eienjs/vue/rules' | 'eienjs/vue/composables-disables' | 'eienjs/astro/setup' | 'eienjs/astro/rules' | 'eienjs/adonisjs/rules' | 'eienjs/adonisjs/inertia-rules' | 'eienjs/adonisjs/disables' | 'eienjs/adonisjs/database-disables' | 'eienjs/adonisjs/bin-disables' | 'eienjs/adonisjs/commands-disables' | 'eienjs/adonisjs/middleware-disables' | 'eienjs/adonisjs/transformers-disables' | 'eienjs/adonisjs/exceptions-disables' | 'eienjs/adonisjs/controllers-disables' | 'eienjs/adonisjs/config-disables' | 'eienjs/adonisjs/providers-disables' | 'eienjs/adonisjs/tests-disables' | 'eienjs/adonisjs/types-disables' | 'eienjs/nuxt/setup' | 'eienjs/nuxt/vue/single-root' | 'eienjs/nuxt/rules' | 'eienjs/nuxt/utils-disables' | 'eienjs/nuxt/sort-config' | 'eienjs/nuxt/vue/rules' | 'eienjs/jsonc/setup' | 'eienjs/jsonc/rules' | 'eienjs/sort/package-json' | 'eienjs/sort/tsconfig-json' | 'eienjs/pnpm/package-json' | 'eienjs/pnpm/pnpm-workspace-yaml' | 'eienjs/pnpm/pnpm-workspace-yaml-sort' | 'eienjs/yaml/setup' | 'eienjs/yaml/rules' | 'eienjs/toml/setup' | 'eienjs/toml/rules' | 'eienjs/markdown/setup' | 'eienjs/markdown/processor' | 'eienjs/markdown/parser' | 'eienjs/markdown/rules' | 'eienjs/markdown/disables/code' | 'eienjs/formatter/setup' | 'eienjs/formatter/css' | 'eienjs/formatter/scss' | 'eienjs/formatter/less' | 'eienjs/formatter/html' | 'eienjs/formatter/xml' | 'eienjs/formatter/svg' | 'eienjs/formatter/markdown' | 'eienjs/formatter/astro' | 'eienjs/formatter/astro/disables' | 'eienjs/disables/scripts' | 'eienjs/disables/cli' | 'eienjs/disables/bin' | 'eienjs/disables/dts' | 'eienjs/disables/cjs' | 'eienjs/disables/config-files' | 'eienjs/disables/json' | 'eienjs/disables/yaml' | 'eienjs/disables/toml' | 'eienjs/disables/astro' | 'eienjs/disables/deploy-tools';
|
|
16710
17521
|
//#endregion
|
|
16711
17522
|
export { ConfigNames, RuleOptions };
|