@ntnyq/eslint-config 5.4.1 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +219 -143
- package/dist/index.js +106 -87
- package/package.json +18 -19
package/dist/index.d.ts
CHANGED
|
@@ -514,10 +514,19 @@ type ConfigImportXOptions = Pick<OptionsShareable, 'typescript'> & OptionsOverri
|
|
|
514
514
|
declare const configImportX: (options?: ConfigImportXOptions) => TypedConfigItem[];
|
|
515
515
|
//#endregion
|
|
516
516
|
//#region src/configs/unicorn.d.ts
|
|
517
|
+
/**
|
|
518
|
+
* Built-in presets of `eslint-plugin-unicorn`
|
|
519
|
+
*/
|
|
520
|
+
declare const PLUGIN_UNICORN_PRESET: readonly ["all", "recommended", "unopinionated"];
|
|
517
521
|
/**
|
|
518
522
|
* Options type of {@link configUnicorn}
|
|
519
523
|
*/
|
|
520
|
-
type ConfigUnicornOptions = OptionsOverrides
|
|
524
|
+
type ConfigUnicornOptions = OptionsOverrides & {
|
|
525
|
+
/**
|
|
526
|
+
* Use a built-in preset
|
|
527
|
+
*/
|
|
528
|
+
preset?: (typeof PLUGIN_UNICORN_PRESET)[number];
|
|
529
|
+
};
|
|
521
530
|
/**
|
|
522
531
|
* Config for powerful rules
|
|
523
532
|
*
|
|
@@ -1171,7 +1180,7 @@ interface RuleOptions {
|
|
|
1171
1180
|
*/
|
|
1172
1181
|
'@html-eslint/require-title'?: Linter.RuleEntry<[]>;
|
|
1173
1182
|
/**
|
|
1174
|
-
* Enforce
|
|
1183
|
+
* Enforce priority and alphabetical sorting of attributes
|
|
1175
1184
|
* @see https://html-eslint.org/docs/rules/sort-attrs
|
|
1176
1185
|
*/
|
|
1177
1186
|
'@html-eslint/sort-attrs'?: Linter.RuleEntry<HtmlEslintSortAttrs>;
|
|
@@ -2954,7 +2963,7 @@ interface RuleOptions {
|
|
|
2954
2963
|
* Reports invalid alignment of JSDoc block asterisks.
|
|
2955
2964
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-alignment.md#repos-sticky-header
|
|
2956
2965
|
*/
|
|
2957
|
-
'jsdoc/check-alignment'?: Linter.RuleEntry<
|
|
2966
|
+
'jsdoc/check-alignment'?: Linter.RuleEntry<JsdocCheckAlignment>;
|
|
2958
2967
|
/**
|
|
2959
2968
|
* Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
|
|
2960
2969
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-examples.md#repos-sticky-header
|
|
@@ -3512,7 +3521,7 @@ interface RuleOptions {
|
|
|
3512
3521
|
* Enforce heading levels increment by one
|
|
3513
3522
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/heading-increment.md
|
|
3514
3523
|
*/
|
|
3515
|
-
'markdown/heading-increment'?: Linter.RuleEntry<
|
|
3524
|
+
'markdown/heading-increment'?: Linter.RuleEntry<MarkdownHeadingIncrement>;
|
|
3516
3525
|
/**
|
|
3517
3526
|
* Disallow bare URLs
|
|
3518
3527
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-bare-urls.md
|
|
@@ -3557,7 +3566,7 @@ interface RuleOptions {
|
|
|
3557
3566
|
* Disallow headings without a space after the hash characters
|
|
3558
3567
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-atx-heading-space.md
|
|
3559
3568
|
*/
|
|
3560
|
-
'markdown/no-missing-atx-heading-space'?: Linter.RuleEntry<
|
|
3569
|
+
'markdown/no-missing-atx-heading-space'?: Linter.RuleEntry<MarkdownNoMissingAtxHeadingSpace>;
|
|
3561
3570
|
/**
|
|
3562
3571
|
* Disallow missing label references
|
|
3563
3572
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md
|
|
@@ -3578,6 +3587,11 @@ interface RuleOptions {
|
|
|
3578
3587
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
|
|
3579
3588
|
*/
|
|
3580
3589
|
'markdown/no-reversed-media-syntax'?: Linter.RuleEntry<[]>;
|
|
3590
|
+
/**
|
|
3591
|
+
* Disallow spaces around emphasis markers
|
|
3592
|
+
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-space-in-emphasis.md
|
|
3593
|
+
*/
|
|
3594
|
+
'markdown/no-space-in-emphasis'?: Linter.RuleEntry<MarkdownNoSpaceInEmphasis>;
|
|
3581
3595
|
/**
|
|
3582
3596
|
* Disallow unused definitions
|
|
3583
3597
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md
|
|
@@ -5008,6 +5022,11 @@ interface RuleOptions {
|
|
|
5008
5022
|
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
5009
5023
|
*/
|
|
5010
5024
|
'prefer-template'?: Linter.RuleEntry<[]>;
|
|
5025
|
+
/**
|
|
5026
|
+
* Disallow losing originally caught error when re-throwing custom errors
|
|
5027
|
+
* @see https://eslint.org/docs/latest/rules/preserve-caught-error
|
|
5028
|
+
*/
|
|
5029
|
+
'preserve-caught-error'?: Linter.RuleEntry<PreserveCaughtError>;
|
|
5011
5030
|
/**
|
|
5012
5031
|
* @see https://github.com/prettier/eslint-plugin-prettier#options
|
|
5013
5032
|
*/
|
|
@@ -6078,690 +6097,710 @@ interface RuleOptions {
|
|
|
6078
6097
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
6079
6098
|
/**
|
|
6080
6099
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
6081
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6100
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/better-regex.md
|
|
6082
6101
|
*/
|
|
6083
6102
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
6084
6103
|
/**
|
|
6085
6104
|
* Enforce a specific parameter name in catch clauses.
|
|
6086
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6105
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/catch-error-name.md
|
|
6087
6106
|
*/
|
|
6088
6107
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
6089
6108
|
/**
|
|
6090
6109
|
* Enforce consistent assertion style with `node:assert`.
|
|
6091
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6110
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-assert.md
|
|
6092
6111
|
*/
|
|
6093
6112
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
6094
6113
|
/**
|
|
6095
6114
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6096
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-date-clone.md
|
|
6097
6116
|
*/
|
|
6098
6117
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
6099
6118
|
/**
|
|
6100
6119
|
* Use destructured variables over properties.
|
|
6101
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6120
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-destructuring.md
|
|
6102
6121
|
*/
|
|
6103
6122
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
6104
6123
|
/**
|
|
6105
6124
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6106
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-empty-array-spread.md
|
|
6107
6126
|
*/
|
|
6108
6127
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
6109
6128
|
/**
|
|
6110
6129
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6111
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6130
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-existence-index-check.md
|
|
6112
6131
|
*/
|
|
6113
6132
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
6114
6133
|
/**
|
|
6115
6134
|
* Move function definitions to the highest possible scope.
|
|
6116
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/consistent-function-scoping.md
|
|
6117
6136
|
*/
|
|
6118
6137
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
6119
6138
|
/**
|
|
6120
6139
|
* Enforce correct `Error` subclassing.
|
|
6121
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/custom-error-definition.md
|
|
6122
6141
|
*/
|
|
6123
6142
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
6124
6143
|
/**
|
|
6125
6144
|
* Enforce no spaces between braces.
|
|
6126
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/empty-brace-spaces.md
|
|
6127
6146
|
*/
|
|
6128
6147
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
6129
6148
|
/**
|
|
6130
6149
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6131
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/error-message.md
|
|
6132
6151
|
*/
|
|
6133
6152
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
6134
6153
|
/**
|
|
6135
6154
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6136
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/escape-case.md
|
|
6137
6156
|
*/
|
|
6138
6157
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
6139
6158
|
/**
|
|
6140
6159
|
* Add expiration conditions to TODO comments.
|
|
6141
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6160
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/expiring-todo-comments.md
|
|
6142
6161
|
*/
|
|
6143
6162
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
6144
6163
|
/**
|
|
6145
6164
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6146
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/explicit-length-check.md
|
|
6147
6166
|
*/
|
|
6148
6167
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
6149
6168
|
/**
|
|
6150
6169
|
* Enforce a case style for filenames.
|
|
6151
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/filename-case.md
|
|
6152
6171
|
*/
|
|
6153
6172
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
6154
6173
|
/**
|
|
6155
6174
|
* Enforce specific import styles per module.
|
|
6156
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6175
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/import-style.md
|
|
6157
6176
|
*/
|
|
6158
6177
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
6159
6178
|
/**
|
|
6160
6179
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6161
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6180
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/new-for-builtins.md
|
|
6162
6181
|
*/
|
|
6163
6182
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
6164
6183
|
/**
|
|
6165
6184
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6166
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-abusive-eslint-disable.md
|
|
6167
6186
|
*/
|
|
6168
6187
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
6169
6188
|
/**
|
|
6170
6189
|
* Disallow recursive access to `this` within getters and setters.
|
|
6171
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-accessor-recursion.md
|
|
6172
6191
|
*/
|
|
6173
6192
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
6174
6193
|
/**
|
|
6175
6194
|
* Disallow anonymous functions and classes as the default export.
|
|
6176
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6195
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-anonymous-default-export.md
|
|
6177
6196
|
*/
|
|
6178
6197
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
6179
6198
|
/**
|
|
6180
6199
|
* Prevent passing a function reference directly to iterator methods.
|
|
6181
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-callback-reference.md
|
|
6182
6201
|
*/
|
|
6183
6202
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
6184
6203
|
/**
|
|
6185
6204
|
* Prefer `for…of` over the `forEach` method.
|
|
6186
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6205
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-for-each.md
|
|
6187
6206
|
*/
|
|
6188
6207
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
6189
6208
|
/**
|
|
6190
6209
|
* Disallow using the `this` argument in array methods.
|
|
6191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6210
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-method-this-argument.md
|
|
6192
6211
|
*/
|
|
6193
6212
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
6194
6213
|
/**
|
|
6195
6214
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6215
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/deprecated-rules.md#no-array-push-push
|
|
6197
6216
|
* @deprecated
|
|
6198
6217
|
*/
|
|
6199
6218
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
6200
6219
|
/**
|
|
6201
6220
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6202
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-reduce.md
|
|
6203
6222
|
*/
|
|
6204
6223
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
6205
6224
|
/**
|
|
6206
6225
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6207
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-reverse.md
|
|
6208
6227
|
*/
|
|
6209
6228
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
6229
|
+
/**
|
|
6230
|
+
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-array-sort.md
|
|
6232
|
+
*/
|
|
6233
|
+
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6210
6234
|
/**
|
|
6211
6235
|
* Disallow member access from await expression.
|
|
6212
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-await-expression-member.md
|
|
6213
6237
|
*/
|
|
6214
6238
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
6215
6239
|
/**
|
|
6216
6240
|
* Disallow using `await` in `Promise` method parameters.
|
|
6217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-await-in-promise-methods.md
|
|
6218
6242
|
*/
|
|
6219
6243
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6220
6244
|
/**
|
|
6221
6245
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
6222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6246
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-console-spaces.md
|
|
6223
6247
|
*/
|
|
6224
6248
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6225
6249
|
/**
|
|
6226
6250
|
* Do not use `document.cookie` directly.
|
|
6227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-document-cookie.md
|
|
6228
6252
|
*/
|
|
6229
6253
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6230
6254
|
/**
|
|
6231
6255
|
* Disallow empty files.
|
|
6232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-empty-file.md
|
|
6233
6257
|
*/
|
|
6234
6258
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
6235
6259
|
/**
|
|
6236
6260
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
6237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-for-loop.md
|
|
6238
6262
|
*/
|
|
6239
6263
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
6240
6264
|
/**
|
|
6241
6265
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
6242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6266
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-hex-escape.md
|
|
6243
6267
|
*/
|
|
6244
6268
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
6245
6269
|
/**
|
|
6246
6270
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
6247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/deprecated-rules.md#no-instanceof-array
|
|
6248
6272
|
* @deprecated
|
|
6249
6273
|
*/
|
|
6250
6274
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
6251
6275
|
/**
|
|
6252
6276
|
* Disallow `instanceof` with built-in objects
|
|
6253
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-instanceof-builtins.md
|
|
6254
6278
|
*/
|
|
6255
6279
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6256
6280
|
/**
|
|
6257
6281
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6258
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-invalid-fetch-options.md
|
|
6259
6283
|
*/
|
|
6260
6284
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6261
6285
|
/**
|
|
6262
6286
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6263
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-invalid-remove-event-listener.md
|
|
6264
6288
|
*/
|
|
6265
6289
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6266
6290
|
/**
|
|
6267
6291
|
* Disallow identifiers starting with `new` or `class`.
|
|
6268
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-keyword-prefix.md
|
|
6269
6293
|
*/
|
|
6270
6294
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6271
6295
|
/**
|
|
6272
6296
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6273
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/deprecated-rules.md#no-length-as-slice-end
|
|
6274
6298
|
* @deprecated
|
|
6275
6299
|
*/
|
|
6276
6300
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6277
6301
|
/**
|
|
6278
6302
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6279
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6303
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-lonely-if.md
|
|
6280
6304
|
*/
|
|
6281
6305
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6282
6306
|
/**
|
|
6283
6307
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6284
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6308
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-magic-array-flat-depth.md
|
|
6285
6309
|
*/
|
|
6286
6310
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6287
6311
|
/**
|
|
6288
6312
|
* Disallow named usage of default import and export.
|
|
6289
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6313
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-named-default.md
|
|
6290
6314
|
*/
|
|
6291
6315
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6292
6316
|
/**
|
|
6293
6317
|
* Disallow negated conditions.
|
|
6294
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6318
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-negated-condition.md
|
|
6295
6319
|
*/
|
|
6296
6320
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6297
6321
|
/**
|
|
6298
6322
|
* Disallow negated expression in equality check.
|
|
6299
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6323
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-negation-in-equality-check.md
|
|
6300
6324
|
*/
|
|
6301
6325
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6302
6326
|
/**
|
|
6303
6327
|
* Disallow nested ternary expressions.
|
|
6304
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6328
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-nested-ternary.md
|
|
6305
6329
|
*/
|
|
6306
6330
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6307
6331
|
/**
|
|
6308
6332
|
* Disallow `new Array()`.
|
|
6309
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6333
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-new-array.md
|
|
6310
6334
|
*/
|
|
6311
6335
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6312
6336
|
/**
|
|
6313
6337
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6314
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6338
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-new-buffer.md
|
|
6315
6339
|
*/
|
|
6316
6340
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6317
6341
|
/**
|
|
6318
6342
|
* Disallow the use of the `null` literal.
|
|
6319
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6343
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-null.md
|
|
6320
6344
|
*/
|
|
6321
6345
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6322
6346
|
/**
|
|
6323
6347
|
* Disallow the use of objects as default parameters.
|
|
6324
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6348
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-object-as-default-parameter.md
|
|
6325
6349
|
*/
|
|
6326
6350
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6327
6351
|
/**
|
|
6328
6352
|
* Disallow `process.exit()`.
|
|
6329
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6353
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-process-exit.md
|
|
6330
6354
|
*/
|
|
6331
6355
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6332
6356
|
/**
|
|
6333
6357
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6334
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6358
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-single-promise-in-promise-methods.md
|
|
6335
6359
|
*/
|
|
6336
6360
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6337
6361
|
/**
|
|
6338
6362
|
* Disallow classes that only have static members.
|
|
6339
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6363
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-static-only-class.md
|
|
6340
6364
|
*/
|
|
6341
6365
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6342
6366
|
/**
|
|
6343
6367
|
* Disallow `then` property.
|
|
6344
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6368
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-thenable.md
|
|
6345
6369
|
*/
|
|
6346
6370
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6347
6371
|
/**
|
|
6348
6372
|
* Disallow assigning `this` to a variable.
|
|
6349
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6373
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-this-assignment.md
|
|
6350
6374
|
*/
|
|
6351
6375
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6352
6376
|
/**
|
|
6353
6377
|
* Disallow comparing `undefined` using `typeof`.
|
|
6354
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6378
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-typeof-undefined.md
|
|
6355
6379
|
*/
|
|
6356
6380
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6357
6381
|
/**
|
|
6358
6382
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6359
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6383
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6360
6384
|
*/
|
|
6361
6385
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6362
6386
|
/**
|
|
6363
6387
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6364
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6388
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unnecessary-array-splice-count.md
|
|
6365
6389
|
*/
|
|
6366
6390
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6367
6391
|
/**
|
|
6368
6392
|
* Disallow awaiting non-promise values.
|
|
6369
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unnecessary-await.md
|
|
6370
6394
|
*/
|
|
6371
6395
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6372
6396
|
/**
|
|
6373
6397
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6374
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unnecessary-polyfills.md
|
|
6375
6399
|
*/
|
|
6376
6400
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6377
6401
|
/**
|
|
6378
6402
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6379
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unnecessary-slice-end.md
|
|
6380
6404
|
*/
|
|
6381
6405
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6382
6406
|
/**
|
|
6383
6407
|
* Disallow unreadable array destructuring.
|
|
6384
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unreadable-array-destructuring.md
|
|
6385
6409
|
*/
|
|
6386
6410
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
6387
6411
|
/**
|
|
6388
6412
|
* Disallow unreadable IIFEs.
|
|
6389
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unreadable-iife.md
|
|
6390
6414
|
*/
|
|
6391
6415
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6392
6416
|
/**
|
|
6393
6417
|
* Disallow unused object properties.
|
|
6394
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-unused-properties.md
|
|
6395
6419
|
*/
|
|
6396
6420
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6397
6421
|
/**
|
|
6398
6422
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6399
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6400
6424
|
*/
|
|
6401
6425
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6402
6426
|
/**
|
|
6403
6427
|
* Disallow useless fallback when spreading in object literals.
|
|
6404
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-fallback-in-spread.md
|
|
6405
6429
|
*/
|
|
6406
6430
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6407
6431
|
/**
|
|
6408
6432
|
* Disallow useless array length check.
|
|
6409
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6433
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-length-check.md
|
|
6410
6434
|
*/
|
|
6411
6435
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6412
6436
|
/**
|
|
6413
6437
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6414
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6438
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-promise-resolve-reject.md
|
|
6415
6439
|
*/
|
|
6416
6440
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6417
6441
|
/**
|
|
6418
6442
|
* Disallow unnecessary spread.
|
|
6419
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6443
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-spread.md
|
|
6420
6444
|
*/
|
|
6421
6445
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6422
6446
|
/**
|
|
6423
6447
|
* Disallow useless case in switch statements.
|
|
6424
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6448
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-switch-case.md
|
|
6425
6449
|
*/
|
|
6426
6450
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6427
6451
|
/**
|
|
6428
6452
|
* Disallow useless `undefined`.
|
|
6429
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6453
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-useless-undefined.md
|
|
6430
6454
|
*/
|
|
6431
6455
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6432
6456
|
/**
|
|
6433
6457
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6434
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6458
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/no-zero-fractions.md
|
|
6435
6459
|
*/
|
|
6436
6460
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6437
6461
|
/**
|
|
6438
6462
|
* Enforce proper case for numeric literals.
|
|
6439
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6463
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/number-literal-case.md
|
|
6440
6464
|
*/
|
|
6441
6465
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6442
6466
|
/**
|
|
6443
6467
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6444
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6468
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/numeric-separators-style.md
|
|
6445
6469
|
*/
|
|
6446
6470
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6447
6471
|
/**
|
|
6448
6472
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6449
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6473
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-add-event-listener.md
|
|
6450
6474
|
*/
|
|
6451
6475
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6452
6476
|
/**
|
|
6453
6477
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6454
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6478
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-array-find.md
|
|
6455
6479
|
*/
|
|
6456
6480
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6457
6481
|
/**
|
|
6458
6482
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6459
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6483
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-array-flat.md
|
|
6460
6484
|
*/
|
|
6461
6485
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6462
6486
|
/**
|
|
6463
6487
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6464
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6488
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-array-flat-map.md
|
|
6465
6489
|
*/
|
|
6466
6490
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6467
6491
|
/**
|
|
6468
6492
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6469
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6493
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-array-index-of.md
|
|
6470
6494
|
*/
|
|
6471
6495
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6472
6496
|
/**
|
|
6473
6497
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6474
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6498
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-array-some.md
|
|
6475
6499
|
*/
|
|
6476
6500
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6477
6501
|
/**
|
|
6478
6502
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6479
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6503
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-at.md
|
|
6480
6504
|
*/
|
|
6481
6505
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6506
|
+
/**
|
|
6507
|
+
* Prefer `BigInt` literals over the constructor.
|
|
6508
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-bigint-literals.md
|
|
6509
|
+
*/
|
|
6510
|
+
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6482
6511
|
/**
|
|
6483
6512
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6484
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6513
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-blob-reading-methods.md
|
|
6485
6514
|
*/
|
|
6486
6515
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6487
6516
|
/**
|
|
6488
6517
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6489
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6518
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-class-fields.md
|
|
6490
6519
|
*/
|
|
6491
6520
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6521
|
+
/**
|
|
6522
|
+
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6523
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-classlist-toggle.md
|
|
6524
|
+
*/
|
|
6525
|
+
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6492
6526
|
/**
|
|
6493
6527
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6494
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6528
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-code-point.md
|
|
6495
6529
|
*/
|
|
6496
6530
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6497
6531
|
/**
|
|
6498
6532
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6499
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6533
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-date-now.md
|
|
6500
6534
|
*/
|
|
6501
6535
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6502
6536
|
/**
|
|
6503
6537
|
* Prefer default parameters over reassignment.
|
|
6504
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6538
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-default-parameters.md
|
|
6505
6539
|
*/
|
|
6506
6540
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6507
6541
|
/**
|
|
6508
6542
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
6509
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6543
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-dom-node-append.md
|
|
6510
6544
|
*/
|
|
6511
6545
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6512
6546
|
/**
|
|
6513
6547
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
6514
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6548
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-dom-node-dataset.md
|
|
6515
6549
|
*/
|
|
6516
6550
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6517
6551
|
/**
|
|
6518
6552
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6519
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6553
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-dom-node-remove.md
|
|
6520
6554
|
*/
|
|
6521
6555
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6522
6556
|
/**
|
|
6523
6557
|
* Prefer `.textContent` over `.innerText`.
|
|
6524
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6558
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-dom-node-text-content.md
|
|
6525
6559
|
*/
|
|
6526
6560
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6527
6561
|
/**
|
|
6528
6562
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6529
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6563
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-event-target.md
|
|
6530
6564
|
*/
|
|
6531
6565
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6532
6566
|
/**
|
|
6533
6567
|
* Prefer `export…from` when re-exporting.
|
|
6534
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6568
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-export-from.md
|
|
6535
6569
|
*/
|
|
6536
6570
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6537
6571
|
/**
|
|
6538
6572
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6539
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6573
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-global-this.md
|
|
6540
6574
|
*/
|
|
6541
6575
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6542
6576
|
/**
|
|
6543
6577
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6544
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6578
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-import-meta-properties.md
|
|
6545
6579
|
*/
|
|
6546
6580
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6547
6581
|
/**
|
|
6548
6582
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6549
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6583
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-includes.md
|
|
6550
6584
|
*/
|
|
6551
6585
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6552
6586
|
/**
|
|
6553
6587
|
* Prefer reading a JSON file as a buffer.
|
|
6554
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6588
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-json-parse-buffer.md
|
|
6555
6589
|
*/
|
|
6556
6590
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6557
6591
|
/**
|
|
6558
6592
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
6559
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6593
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-keyboard-event-key.md
|
|
6560
6594
|
*/
|
|
6561
6595
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6562
6596
|
/**
|
|
6563
6597
|
* Prefer using a logical operator over a ternary.
|
|
6564
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6598
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6565
6599
|
*/
|
|
6566
6600
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6567
6601
|
/**
|
|
6568
6602
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6569
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6603
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-math-min-max.md
|
|
6570
6604
|
*/
|
|
6571
6605
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6572
6606
|
/**
|
|
6573
6607
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6574
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6608
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-math-trunc.md
|
|
6575
6609
|
*/
|
|
6576
6610
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6577
6611
|
/**
|
|
6578
6612
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6579
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6613
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-modern-dom-apis.md
|
|
6580
6614
|
*/
|
|
6581
6615
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6582
6616
|
/**
|
|
6583
6617
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6584
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6618
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-modern-math-apis.md
|
|
6585
6619
|
*/
|
|
6586
6620
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6587
6621
|
/**
|
|
6588
6622
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6623
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-module.md
|
|
6590
6624
|
*/
|
|
6591
6625
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6592
6626
|
/**
|
|
6593
6627
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6628
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-native-coercion-functions.md
|
|
6595
6629
|
*/
|
|
6596
6630
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6597
6631
|
/**
|
|
6598
6632
|
* Prefer negative index over `.length - index` when possible.
|
|
6599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6633
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-negative-index.md
|
|
6600
6634
|
*/
|
|
6601
6635
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6602
6636
|
/**
|
|
6603
6637
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6638
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-node-protocol.md
|
|
6605
6639
|
*/
|
|
6606
6640
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6607
6641
|
/**
|
|
6608
6642
|
* Prefer `Number` static properties over global ones.
|
|
6609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6643
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-number-properties.md
|
|
6610
6644
|
*/
|
|
6611
6645
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6612
6646
|
/**
|
|
6613
6647
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6648
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-object-from-entries.md
|
|
6615
6649
|
*/
|
|
6616
6650
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6617
6651
|
/**
|
|
6618
6652
|
* Prefer omitting the `catch` binding parameter.
|
|
6619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6653
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-optional-catch-binding.md
|
|
6620
6654
|
*/
|
|
6621
6655
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6622
6656
|
/**
|
|
6623
6657
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6658
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-prototype-methods.md
|
|
6625
6659
|
*/
|
|
6626
6660
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6627
6661
|
/**
|
|
6628
6662
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
6629
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6663
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-query-selector.md
|
|
6630
6664
|
*/
|
|
6631
6665
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
6632
6666
|
/**
|
|
6633
6667
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6634
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6668
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-reflect-apply.md
|
|
6635
6669
|
*/
|
|
6636
6670
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6637
6671
|
/**
|
|
6638
6672
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6639
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6673
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-regexp-test.md
|
|
6640
6674
|
*/
|
|
6641
6675
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6642
6676
|
/**
|
|
6643
6677
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6644
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6678
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-set-has.md
|
|
6645
6679
|
*/
|
|
6646
6680
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
6647
6681
|
/**
|
|
6648
6682
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6649
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6683
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-set-size.md
|
|
6650
6684
|
*/
|
|
6651
6685
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6652
6686
|
/**
|
|
6653
6687
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6654
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6688
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-single-call.md
|
|
6655
6689
|
*/
|
|
6656
6690
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6657
6691
|
/**
|
|
6658
6692
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6659
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6693
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-spread.md
|
|
6660
6694
|
*/
|
|
6661
6695
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6662
6696
|
/**
|
|
6663
6697
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6664
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6698
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-string-raw.md
|
|
6665
6699
|
*/
|
|
6666
6700
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6667
6701
|
/**
|
|
6668
6702
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
6669
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6703
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-string-replace-all.md
|
|
6670
6704
|
*/
|
|
6671
6705
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6672
6706
|
/**
|
|
6673
6707
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6674
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6708
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-string-slice.md
|
|
6675
6709
|
*/
|
|
6676
6710
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6677
6711
|
/**
|
|
6678
6712
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6679
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6713
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-string-starts-ends-with.md
|
|
6680
6714
|
*/
|
|
6681
6715
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6682
6716
|
/**
|
|
6683
6717
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6684
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6718
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-string-trim-start-end.md
|
|
6685
6719
|
*/
|
|
6686
6720
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6687
6721
|
/**
|
|
6688
6722
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6689
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6723
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-structured-clone.md
|
|
6690
6724
|
*/
|
|
6691
6725
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6692
6726
|
/**
|
|
6693
6727
|
* Prefer `switch` over multiple `else-if`.
|
|
6694
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6728
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-switch.md
|
|
6695
6729
|
*/
|
|
6696
6730
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6697
6731
|
/**
|
|
6698
6732
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6699
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6733
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-ternary.md
|
|
6700
6734
|
*/
|
|
6701
6735
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6702
6736
|
/**
|
|
6703
6737
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6704
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6738
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-top-level-await.md
|
|
6705
6739
|
*/
|
|
6706
6740
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6707
6741
|
/**
|
|
6708
6742
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6709
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6743
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prefer-type-error.md
|
|
6710
6744
|
*/
|
|
6711
6745
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6712
6746
|
/**
|
|
6713
6747
|
* Prevent abbreviations.
|
|
6714
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6748
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/prevent-abbreviations.md
|
|
6715
6749
|
*/
|
|
6716
6750
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
6717
6751
|
/**
|
|
6718
6752
|
* Enforce consistent relative URL style.
|
|
6719
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6753
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/relative-url-style.md
|
|
6720
6754
|
*/
|
|
6721
6755
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6722
6756
|
/**
|
|
6723
6757
|
* Enforce using the separator argument with `Array#join()`.
|
|
6724
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6758
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/require-array-join-separator.md
|
|
6725
6759
|
*/
|
|
6726
6760
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6761
|
+
/**
|
|
6762
|
+
* Require non-empty module attributes for imports and exports
|
|
6763
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/require-module-attributes.md
|
|
6764
|
+
*/
|
|
6765
|
+
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6727
6766
|
/**
|
|
6728
6767
|
* Require non-empty specifier list in import and export statements.
|
|
6729
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6768
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/require-module-specifiers.md
|
|
6730
6769
|
*/
|
|
6731
6770
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6732
6771
|
/**
|
|
6733
6772
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6734
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6773
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6735
6774
|
*/
|
|
6736
6775
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6737
6776
|
/**
|
|
6738
6777
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6739
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6778
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/require-post-message-target-origin.md
|
|
6740
6779
|
*/
|
|
6741
6780
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6742
6781
|
/**
|
|
6743
6782
|
* Enforce better string content.
|
|
6744
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6783
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/string-content.md
|
|
6745
6784
|
*/
|
|
6746
6785
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6747
6786
|
/**
|
|
6748
6787
|
* Enforce consistent brace style for `case` clauses.
|
|
6749
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6788
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/switch-case-braces.md
|
|
6750
6789
|
*/
|
|
6751
6790
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6752
6791
|
/**
|
|
6753
6792
|
* Fix whitespace-insensitive template indentation.
|
|
6754
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6793
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/template-indent.md
|
|
6755
6794
|
*/
|
|
6756
6795
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6757
6796
|
/**
|
|
6758
6797
|
* Enforce consistent case for text encoding identifiers.
|
|
6759
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6798
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/text-encoding-identifier-case.md
|
|
6760
6799
|
*/
|
|
6761
6800
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>;
|
|
6762
6801
|
/**
|
|
6763
6802
|
* Require `new` when creating an error.
|
|
6764
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6803
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.1/docs/rules/throw-new-error.md
|
|
6765
6804
|
*/
|
|
6766
6805
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6767
6806
|
/**
|
|
@@ -6829,6 +6868,11 @@ interface RuleOptions {
|
|
|
6829
6868
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
6830
6869
|
*/
|
|
6831
6870
|
'vitest/expect-expect'?: Linter.RuleEntry<VitestExpectExpect>;
|
|
6871
|
+
/**
|
|
6872
|
+
* enforce hoisted APIs to be on top of the file
|
|
6873
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
|
|
6874
|
+
*/
|
|
6875
|
+
'vitest/hoisted-apis-on-top'?: Linter.RuleEntry<[]>;
|
|
6832
6876
|
/**
|
|
6833
6877
|
* enforce a maximum number of expect per test
|
|
6834
6878
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
@@ -7030,6 +7074,11 @@ interface RuleOptions {
|
|
|
7030
7074
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
7031
7075
|
*/
|
|
7032
7076
|
'vitest/prefer-expect-resolves'?: Linter.RuleEntry<[]>;
|
|
7077
|
+
/**
|
|
7078
|
+
* enforce using `expectTypeOf` instead of `expect(typeof ...)`
|
|
7079
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
|
|
7080
|
+
*/
|
|
7081
|
+
'vitest/prefer-expect-type-of'?: Linter.RuleEntry<[]>;
|
|
7033
7082
|
/**
|
|
7034
7083
|
* enforce having hooks in consistent order
|
|
7035
7084
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
@@ -10301,6 +10350,10 @@ type IndentLegacy = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
10301
10350
|
type InitDeclarations = ([] | ["always"] | [] | ["never"] | ["never", {
|
|
10302
10351
|
ignoreForLoopInit?: boolean;
|
|
10303
10352
|
}]);
|
|
10353
|
+
// ----- jsdoc/check-alignment -----
|
|
10354
|
+
type JsdocCheckAlignment = [] | [{
|
|
10355
|
+
innerIndent?: number;
|
|
10356
|
+
}];
|
|
10304
10357
|
// ----- jsdoc/check-examples -----
|
|
10305
10358
|
type JsdocCheckExamples = [] | [{
|
|
10306
10359
|
allowInlineConfig?: boolean;
|
|
@@ -10590,6 +10643,7 @@ type JsdocRequireJsdoc = [] | [{
|
|
|
10590
10643
|
enableFixer?: boolean;
|
|
10591
10644
|
exemptEmptyConstructors?: boolean;
|
|
10592
10645
|
exemptEmptyFunctions?: boolean;
|
|
10646
|
+
exemptOverloadedImplementations?: boolean;
|
|
10593
10647
|
fixerMessage?: string;
|
|
10594
10648
|
minLineCount?: number;
|
|
10595
10649
|
publicOnly?: (boolean | {
|
|
@@ -10606,6 +10660,7 @@ type JsdocRequireJsdoc = [] | [{
|
|
|
10606
10660
|
FunctionExpression?: boolean;
|
|
10607
10661
|
MethodDefinition?: boolean;
|
|
10608
10662
|
};
|
|
10663
|
+
skipInterveningOverloadedDeclarations?: boolean;
|
|
10609
10664
|
}];
|
|
10610
10665
|
// ----- jsdoc/require-param -----
|
|
10611
10666
|
type JsdocRequireParam = [] | [{
|
|
@@ -10696,6 +10751,7 @@ type JsdocRequireReturnsType = [] | [{
|
|
|
10696
10751
|
}];
|
|
10697
10752
|
// ----- jsdoc/require-template -----
|
|
10698
10753
|
type JsdocRequireTemplate = [] | [{
|
|
10754
|
+
exemptedBy?: string[];
|
|
10699
10755
|
requireSeparateTemplates?: boolean;
|
|
10700
10756
|
}];
|
|
10701
10757
|
// ----- jsdoc/require-throws -----
|
|
@@ -11417,6 +11473,10 @@ type LogicalAssignmentOperators = (([] | ["always"] | ["always", {
|
|
|
11417
11473
|
type MarkdownFencedCodeLanguage = [] | [{
|
|
11418
11474
|
required?: string[];
|
|
11419
11475
|
}];
|
|
11476
|
+
// ----- markdown/heading-increment -----
|
|
11477
|
+
type MarkdownHeadingIncrement = [] | [{
|
|
11478
|
+
frontmatterTitle?: string;
|
|
11479
|
+
}];
|
|
11420
11480
|
// ----- markdown/no-duplicate-definitions -----
|
|
11421
11481
|
type MarkdownNoDuplicateDefinitions = [] | [{
|
|
11422
11482
|
allowDefinitions?: string[];
|
|
@@ -11435,6 +11495,11 @@ type MarkdownNoEmptyDefinitions = [] | [{
|
|
|
11435
11495
|
// ----- markdown/no-html -----
|
|
11436
11496
|
type MarkdownNoHtml = [] | [{
|
|
11437
11497
|
allowed?: string[];
|
|
11498
|
+
allowedIgnoreCase?: boolean;
|
|
11499
|
+
}];
|
|
11500
|
+
// ----- markdown/no-missing-atx-heading-space -----
|
|
11501
|
+
type MarkdownNoMissingAtxHeadingSpace = [] | [{
|
|
11502
|
+
checkClosedHeadings?: boolean;
|
|
11438
11503
|
}];
|
|
11439
11504
|
// ----- markdown/no-missing-link-fragments -----
|
|
11440
11505
|
type MarkdownNoMissingLinkFragments = [] | [{
|
|
@@ -11445,6 +11510,10 @@ type MarkdownNoMissingLinkFragments = [] | [{
|
|
|
11445
11510
|
type MarkdownNoMultipleH1 = [] | [{
|
|
11446
11511
|
frontmatterTitle?: string;
|
|
11447
11512
|
}];
|
|
11513
|
+
// ----- markdown/no-space-in-emphasis -----
|
|
11514
|
+
type MarkdownNoSpaceInEmphasis = [] | [{
|
|
11515
|
+
checkStrikethrough?: boolean;
|
|
11516
|
+
}];
|
|
11448
11517
|
// ----- markdown/no-unused-definitions -----
|
|
11449
11518
|
type MarkdownNoUnusedDefinitions = [] | [{
|
|
11450
11519
|
allowDefinitions?: string[];
|
|
@@ -14149,6 +14218,10 @@ type PreferReflect = [] | [{
|
|
|
14149
14218
|
type PreferRegexLiterals = [] | [{
|
|
14150
14219
|
disallowRedundantWrapping?: boolean;
|
|
14151
14220
|
}];
|
|
14221
|
+
// ----- preserve-caught-error -----
|
|
14222
|
+
type PreserveCaughtError = [] | [{
|
|
14223
|
+
requireCatchParameter?: boolean;
|
|
14224
|
+
}];
|
|
14152
14225
|
// ----- prettier/prettier -----
|
|
14153
14226
|
type PrettierPrettier = [] | [{
|
|
14154
14227
|
[k: string]: unknown | undefined;
|
|
@@ -15270,6 +15343,10 @@ type UnicornNoArrayReduce = [] | [{
|
|
|
15270
15343
|
type UnicornNoArrayReverse = [] | [{
|
|
15271
15344
|
allowExpressionStatement?: boolean;
|
|
15272
15345
|
}];
|
|
15346
|
+
// ----- unicorn/no-array-sort -----
|
|
15347
|
+
type UnicornNoArraySort = [] | [{
|
|
15348
|
+
allowExpressionStatement?: boolean;
|
|
15349
|
+
}];
|
|
15273
15350
|
// ----- unicorn/no-instanceof-builtins -----
|
|
15274
15351
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
15275
15352
|
useErrorIsError?: boolean;
|
|
@@ -15427,7 +15504,6 @@ type UnocssEnforceClassCompile = [] | [{
|
|
|
15427
15504
|
type UnocssOrder = [] | [{
|
|
15428
15505
|
unoFunctions?: string[];
|
|
15429
15506
|
unoVariables?: string[];
|
|
15430
|
-
[k: string]: unknown | undefined;
|
|
15431
15507
|
}];
|
|
15432
15508
|
// ----- unused-imports/no-unused-imports -----
|
|
15433
15509
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|