@lincy/eslint-config 5.7.0 → 5.8.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/README.md +73 -44
- package/dist/index.cjs +41 -12
- package/dist/index.d.cts +302 -187
- package/dist/index.d.ts +302 -187
- package/dist/index.js +41 -13
- package/package.json +28 -23
package/dist/index.d.ts
CHANGED
|
@@ -1021,7 +1021,7 @@ interface RuleOptions {
|
|
|
1021
1021
|
* Disallow empty definitions
|
|
1022
1022
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-definitions.md
|
|
1023
1023
|
*/
|
|
1024
|
-
'markdown/no-empty-definitions'?: Linter.RuleEntry<
|
|
1024
|
+
'markdown/no-empty-definitions'?: Linter.RuleEntry<MarkdownNoEmptyDefinitions>;
|
|
1025
1025
|
/**
|
|
1026
1026
|
* Disallow empty images
|
|
1027
1027
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-images.md
|
|
@@ -1067,6 +1067,11 @@ interface RuleOptions {
|
|
|
1067
1067
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md
|
|
1068
1068
|
*/
|
|
1069
1069
|
'markdown/no-reversed-media-syntax'?: Linter.RuleEntry<[]>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Disallow unused definitions
|
|
1072
|
+
* @see https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md
|
|
1073
|
+
*/
|
|
1074
|
+
'markdown/no-unused-definitions'?: Linter.RuleEntry<MarkdownNoUnusedDefinitions>;
|
|
1070
1075
|
/**
|
|
1071
1076
|
* Require alternative text for images
|
|
1072
1077
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/require-alt-text.md
|
|
@@ -1076,7 +1081,7 @@ interface RuleOptions {
|
|
|
1076
1081
|
* Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row
|
|
1077
1082
|
* @see https://github.com/eslint/markdown/blob/main/docs/rules/table-column-count.md
|
|
1078
1083
|
*/
|
|
1079
|
-
'markdown/table-column-count'?: Linter.RuleEntry<
|
|
1084
|
+
'markdown/table-column-count'?: Linter.RuleEntry<MarkdownTableColumnCount>;
|
|
1080
1085
|
/**
|
|
1081
1086
|
* Enforce a maximum number of classes per file
|
|
1082
1087
|
* @see https://eslint.org/docs/latest/rules/max-classes-per-file
|
|
@@ -1239,7 +1244,7 @@ interface RuleOptions {
|
|
|
1239
1244
|
*/
|
|
1240
1245
|
'no-console'?: Linter.RuleEntry<NoConsole>;
|
|
1241
1246
|
/**
|
|
1242
|
-
* Disallow reassigning `const` variables
|
|
1247
|
+
* Disallow reassigning `const`, `using`, and `await using` variables
|
|
1243
1248
|
* @see https://eslint.org/docs/latest/rules/no-const-assign
|
|
1244
1249
|
*/
|
|
1245
1250
|
'no-const-assign'?: Linter.RuleEntry<[]>;
|
|
@@ -4130,6 +4135,16 @@ interface RuleOptions {
|
|
|
4130
4135
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
4131
4136
|
*/
|
|
4132
4137
|
'test/padding-around-test-blocks'?: Linter.RuleEntry<[]>;
|
|
4138
|
+
/**
|
|
4139
|
+
* enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`
|
|
4140
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
|
|
4141
|
+
*/
|
|
4142
|
+
'test/prefer-called-once'?: Linter.RuleEntry<[]>;
|
|
4143
|
+
/**
|
|
4144
|
+
* enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`
|
|
4145
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
|
|
4146
|
+
*/
|
|
4147
|
+
'test/prefer-called-times'?: Linter.RuleEntry<[]>;
|
|
4133
4148
|
/**
|
|
4134
4149
|
* enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
4135
4150
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
@@ -4295,6 +4310,11 @@ interface RuleOptions {
|
|
|
4295
4310
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
4296
4311
|
*/
|
|
4297
4312
|
'test/valid-title'?: Linter.RuleEntry<TestValidTitle>;
|
|
4313
|
+
/**
|
|
4314
|
+
* disallow `.todo` usage
|
|
4315
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/warn-todo.md
|
|
4316
|
+
*/
|
|
4317
|
+
'test/warn-todo'?: Linter.RuleEntry<[]>;
|
|
4298
4318
|
/**
|
|
4299
4319
|
* enforce linebreaks after opening and before closing array brackets
|
|
4300
4320
|
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-bracket-newline.html
|
|
@@ -5075,670 +5095,690 @@ interface RuleOptions {
|
|
|
5075
5095
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5076
5096
|
/**
|
|
5077
5097
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
5078
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5098
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/better-regex.md
|
|
5079
5099
|
*/
|
|
5080
5100
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
5081
5101
|
/**
|
|
5082
5102
|
* Enforce a specific parameter name in catch clauses.
|
|
5083
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5103
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/catch-error-name.md
|
|
5084
5104
|
*/
|
|
5085
5105
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5086
5106
|
/**
|
|
5087
5107
|
* Enforce consistent assertion style with `node:assert`.
|
|
5088
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5108
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-assert.md
|
|
5089
5109
|
*/
|
|
5090
5110
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5091
5111
|
/**
|
|
5092
5112
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5093
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5113
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-date-clone.md
|
|
5094
5114
|
*/
|
|
5095
5115
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5096
5116
|
/**
|
|
5097
5117
|
* Use destructured variables over properties.
|
|
5098
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5118
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-destructuring.md
|
|
5099
5119
|
*/
|
|
5100
5120
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5101
5121
|
/**
|
|
5102
5122
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5103
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5123
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5104
5124
|
*/
|
|
5105
5125
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5106
5126
|
/**
|
|
5107
5127
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5108
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5128
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-existence-index-check.md
|
|
5109
5129
|
*/
|
|
5110
5130
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5111
5131
|
/**
|
|
5112
5132
|
* Move function definitions to the highest possible scope.
|
|
5113
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5133
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/consistent-function-scoping.md
|
|
5114
5134
|
*/
|
|
5115
5135
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5116
5136
|
/**
|
|
5117
5137
|
* Enforce correct `Error` subclassing.
|
|
5118
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/custom-error-definition.md
|
|
5119
5139
|
*/
|
|
5120
5140
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5121
5141
|
/**
|
|
5122
5142
|
* Enforce no spaces between braces.
|
|
5123
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/empty-brace-spaces.md
|
|
5124
5144
|
*/
|
|
5125
5145
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5126
5146
|
/**
|
|
5127
5147
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5128
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/error-message.md
|
|
5129
5149
|
*/
|
|
5130
5150
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5131
5151
|
/**
|
|
5132
5152
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5133
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/escape-case.md
|
|
5134
5154
|
*/
|
|
5135
5155
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5136
5156
|
/**
|
|
5137
5157
|
* Add expiration conditions to TODO comments.
|
|
5138
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/expiring-todo-comments.md
|
|
5139
5159
|
*/
|
|
5140
5160
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5141
5161
|
/**
|
|
5142
5162
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5143
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/explicit-length-check.md
|
|
5144
5164
|
*/
|
|
5145
5165
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5146
5166
|
/**
|
|
5147
5167
|
* Enforce a case style for filenames.
|
|
5148
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5168
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/filename-case.md
|
|
5149
5169
|
*/
|
|
5150
5170
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5151
5171
|
/**
|
|
5152
5172
|
* Enforce specific import styles per module.
|
|
5153
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5173
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/import-style.md
|
|
5154
5174
|
*/
|
|
5155
5175
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5156
5176
|
/**
|
|
5157
5177
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
5158
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5178
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/new-for-builtins.md
|
|
5159
5179
|
*/
|
|
5160
5180
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5161
5181
|
/**
|
|
5162
5182
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5163
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5183
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5164
5184
|
*/
|
|
5165
5185
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5166
5186
|
/**
|
|
5167
5187
|
* Disallow recursive access to `this` within getters and setters.
|
|
5168
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5188
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-accessor-recursion.md
|
|
5169
5189
|
*/
|
|
5170
5190
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5171
5191
|
/**
|
|
5172
5192
|
* Disallow anonymous functions and classes as the default export.
|
|
5173
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5193
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-anonymous-default-export.md
|
|
5174
5194
|
*/
|
|
5175
5195
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5176
5196
|
/**
|
|
5177
5197
|
* Prevent passing a function reference directly to iterator methods.
|
|
5178
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5198
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-callback-reference.md
|
|
5179
5199
|
*/
|
|
5180
5200
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
5181
5201
|
/**
|
|
5182
5202
|
* Prefer `for…of` over the `forEach` method.
|
|
5183
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5203
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-for-each.md
|
|
5184
5204
|
*/
|
|
5185
5205
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
5186
5206
|
/**
|
|
5187
5207
|
* Disallow using the `this` argument in array methods.
|
|
5188
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5208
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-method-this-argument.md
|
|
5189
5209
|
*/
|
|
5190
5210
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5191
5211
|
/**
|
|
5192
5212
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5193
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5213
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
5194
5214
|
* @deprecated
|
|
5195
5215
|
*/
|
|
5196
5216
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5197
5217
|
/**
|
|
5198
5218
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5199
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5219
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-reduce.md
|
|
5200
5220
|
*/
|
|
5201
5221
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5222
|
+
/**
|
|
5223
|
+
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5224
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-array-reverse.md
|
|
5225
|
+
*/
|
|
5226
|
+
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5202
5227
|
/**
|
|
5203
5228
|
* Disallow member access from await expression.
|
|
5204
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5229
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-await-expression-member.md
|
|
5205
5230
|
*/
|
|
5206
5231
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5207
5232
|
/**
|
|
5208
5233
|
* Disallow using `await` in `Promise` method parameters.
|
|
5209
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5234
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5210
5235
|
*/
|
|
5211
5236
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5212
5237
|
/**
|
|
5213
5238
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5214
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5239
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-console-spaces.md
|
|
5215
5240
|
*/
|
|
5216
5241
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
5217
5242
|
/**
|
|
5218
5243
|
* Do not use `document.cookie` directly.
|
|
5219
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5244
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-document-cookie.md
|
|
5220
5245
|
*/
|
|
5221
5246
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
5222
5247
|
/**
|
|
5223
5248
|
* Disallow empty files.
|
|
5224
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5249
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-empty-file.md
|
|
5225
5250
|
*/
|
|
5226
5251
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
5227
5252
|
/**
|
|
5228
5253
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5229
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5254
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-for-loop.md
|
|
5230
5255
|
*/
|
|
5231
5256
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5232
5257
|
/**
|
|
5233
5258
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
5234
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5259
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-hex-escape.md
|
|
5235
5260
|
*/
|
|
5236
5261
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5237
5262
|
/**
|
|
5238
5263
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5239
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5264
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
5240
5265
|
* @deprecated
|
|
5241
5266
|
*/
|
|
5242
5267
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5243
5268
|
/**
|
|
5244
5269
|
* Disallow `instanceof` with built-in objects
|
|
5245
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5270
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-instanceof-builtins.md
|
|
5246
5271
|
*/
|
|
5247
5272
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
5248
5273
|
/**
|
|
5249
5274
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5250
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5275
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5251
5276
|
*/
|
|
5252
5277
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
5253
5278
|
/**
|
|
5254
5279
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5255
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5280
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5256
5281
|
*/
|
|
5257
5282
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
5258
5283
|
/**
|
|
5259
5284
|
* Disallow identifiers starting with `new` or `class`.
|
|
5260
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5285
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-keyword-prefix.md
|
|
5261
5286
|
*/
|
|
5262
5287
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
5263
5288
|
/**
|
|
5264
5289
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
5265
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5290
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
5266
5291
|
* @deprecated
|
|
5267
5292
|
*/
|
|
5268
5293
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
5269
5294
|
/**
|
|
5270
5295
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5271
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-lonely-if.md
|
|
5272
5297
|
*/
|
|
5273
5298
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
5274
5299
|
/**
|
|
5275
5300
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5276
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5277
5302
|
*/
|
|
5278
5303
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5279
5304
|
/**
|
|
5280
5305
|
* Disallow named usage of default import and export.
|
|
5281
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-named-default.md
|
|
5282
5307
|
*/
|
|
5283
5308
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
5284
5309
|
/**
|
|
5285
5310
|
* Disallow negated conditions.
|
|
5286
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-negated-condition.md
|
|
5287
5312
|
*/
|
|
5288
5313
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
5289
5314
|
/**
|
|
5290
5315
|
* Disallow negated expression in equality check.
|
|
5291
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-negation-in-equality-check.md
|
|
5292
5317
|
*/
|
|
5293
5318
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
5294
5319
|
/**
|
|
5295
5320
|
* Disallow nested ternary expressions.
|
|
5296
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-nested-ternary.md
|
|
5297
5322
|
*/
|
|
5298
5323
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5299
5324
|
/**
|
|
5300
5325
|
* Disallow `new Array()`.
|
|
5301
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-new-array.md
|
|
5302
5327
|
*/
|
|
5303
5328
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
5304
5329
|
/**
|
|
5305
5330
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5306
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-new-buffer.md
|
|
5307
5332
|
*/
|
|
5308
5333
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
5309
5334
|
/**
|
|
5310
5335
|
* Disallow the use of the `null` literal.
|
|
5311
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-null.md
|
|
5312
5337
|
*/
|
|
5313
5338
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
5314
5339
|
/**
|
|
5315
5340
|
* Disallow the use of objects as default parameters.
|
|
5316
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5317
5342
|
*/
|
|
5318
5343
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
5319
5344
|
/**
|
|
5320
5345
|
* Disallow `process.exit()`.
|
|
5321
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-process-exit.md
|
|
5322
5347
|
*/
|
|
5323
5348
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
5324
5349
|
/**
|
|
5325
5350
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5326
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5327
5352
|
*/
|
|
5328
5353
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5329
5354
|
/**
|
|
5330
5355
|
* Disallow classes that only have static members.
|
|
5331
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-static-only-class.md
|
|
5332
5357
|
*/
|
|
5333
5358
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
5334
5359
|
/**
|
|
5335
5360
|
* Disallow `then` property.
|
|
5336
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-thenable.md
|
|
5337
5362
|
*/
|
|
5338
5363
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
5339
5364
|
/**
|
|
5340
5365
|
* Disallow assigning `this` to a variable.
|
|
5341
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-this-assignment.md
|
|
5342
5367
|
*/
|
|
5343
5368
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
5344
5369
|
/**
|
|
5345
5370
|
* Disallow comparing `undefined` using `typeof`.
|
|
5346
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-typeof-undefined.md
|
|
5347
5372
|
*/
|
|
5348
5373
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
5349
5374
|
/**
|
|
5350
5375
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
5351
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
5352
5377
|
*/
|
|
5353
5378
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5354
5379
|
/**
|
|
5355
5380
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
5356
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
5357
5382
|
*/
|
|
5358
5383
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
5359
5384
|
/**
|
|
5360
5385
|
* Disallow awaiting non-promise values.
|
|
5361
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5386
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-await.md
|
|
5362
5387
|
*/
|
|
5363
5388
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
5364
5389
|
/**
|
|
5365
5390
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5366
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5391
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5367
5392
|
*/
|
|
5368
5393
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
5369
5394
|
/**
|
|
5370
5395
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
5371
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5396
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
5372
5397
|
*/
|
|
5373
5398
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
5374
5399
|
/**
|
|
5375
5400
|
* Disallow unreadable array destructuring.
|
|
5376
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5401
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
5377
5402
|
*/
|
|
5378
5403
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
5379
5404
|
/**
|
|
5380
5405
|
* Disallow unreadable IIFEs.
|
|
5381
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5406
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unreadable-iife.md
|
|
5382
5407
|
*/
|
|
5383
5408
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
5384
5409
|
/**
|
|
5385
5410
|
* Disallow unused object properties.
|
|
5386
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5411
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-unused-properties.md
|
|
5387
5412
|
*/
|
|
5388
5413
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
5414
|
+
/**
|
|
5415
|
+
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
5416
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
5417
|
+
*/
|
|
5418
|
+
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
5389
5419
|
/**
|
|
5390
5420
|
* Disallow useless fallback when spreading in object literals.
|
|
5391
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5421
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5392
5422
|
*/
|
|
5393
5423
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
5394
5424
|
/**
|
|
5395
5425
|
* Disallow useless array length check.
|
|
5396
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5426
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-length-check.md
|
|
5397
5427
|
*/
|
|
5398
5428
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
5399
5429
|
/**
|
|
5400
5430
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5401
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5431
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5402
5432
|
*/
|
|
5403
5433
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
5404
5434
|
/**
|
|
5405
5435
|
* Disallow unnecessary spread.
|
|
5406
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5436
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-spread.md
|
|
5407
5437
|
*/
|
|
5408
5438
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
5409
5439
|
/**
|
|
5410
5440
|
* Disallow useless case in switch statements.
|
|
5411
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5441
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-switch-case.md
|
|
5412
5442
|
*/
|
|
5413
5443
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
5414
5444
|
/**
|
|
5415
5445
|
* Disallow useless `undefined`.
|
|
5416
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5446
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-useless-undefined.md
|
|
5417
5447
|
*/
|
|
5418
5448
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
5419
5449
|
/**
|
|
5420
5450
|
* Disallow number literals with zero fractions or dangling dots.
|
|
5421
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5451
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/no-zero-fractions.md
|
|
5422
5452
|
*/
|
|
5423
5453
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
5424
5454
|
/**
|
|
5425
5455
|
* Enforce proper case for numeric literals.
|
|
5426
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5456
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/number-literal-case.md
|
|
5427
5457
|
*/
|
|
5428
5458
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
5429
5459
|
/**
|
|
5430
5460
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
5431
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5461
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/numeric-separators-style.md
|
|
5432
5462
|
*/
|
|
5433
5463
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
5434
5464
|
/**
|
|
5435
5465
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
5436
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5466
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-add-event-listener.md
|
|
5437
5467
|
*/
|
|
5438
5468
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
5439
5469
|
/**
|
|
5440
5470
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
5441
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5471
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-find.md
|
|
5442
5472
|
*/
|
|
5443
5473
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
5444
5474
|
/**
|
|
5445
5475
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
5446
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5476
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-flat.md
|
|
5447
5477
|
*/
|
|
5448
5478
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
5449
5479
|
/**
|
|
5450
5480
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
5451
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5481
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-flat-map.md
|
|
5452
5482
|
*/
|
|
5453
5483
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
5454
5484
|
/**
|
|
5455
5485
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
5456
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5486
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-index-of.md
|
|
5457
5487
|
*/
|
|
5458
5488
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
5459
5489
|
/**
|
|
5460
5490
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
5461
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5491
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-array-some.md
|
|
5462
5492
|
*/
|
|
5463
5493
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
5464
5494
|
/**
|
|
5465
5495
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
5466
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5496
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-at.md
|
|
5467
5497
|
*/
|
|
5468
5498
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
5469
5499
|
/**
|
|
5470
5500
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
5471
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5501
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
5472
5502
|
*/
|
|
5473
5503
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
5504
|
+
/**
|
|
5505
|
+
* Prefer class field declarations over `this` assignments in constructors.
|
|
5506
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-class-fields.md
|
|
5507
|
+
*/
|
|
5508
|
+
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
5474
5509
|
/**
|
|
5475
5510
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
5476
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5511
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-code-point.md
|
|
5477
5512
|
*/
|
|
5478
5513
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
5479
5514
|
/**
|
|
5480
5515
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
5481
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5516
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-date-now.md
|
|
5482
5517
|
*/
|
|
5483
5518
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
5484
5519
|
/**
|
|
5485
5520
|
* Prefer default parameters over reassignment.
|
|
5486
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5521
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-default-parameters.md
|
|
5487
5522
|
*/
|
|
5488
5523
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
5489
5524
|
/**
|
|
5490
5525
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
5491
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5526
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-append.md
|
|
5492
5527
|
*/
|
|
5493
5528
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
5494
5529
|
/**
|
|
5495
5530
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
5496
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5531
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
5497
5532
|
*/
|
|
5498
5533
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
5499
5534
|
/**
|
|
5500
5535
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
5501
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5536
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-remove.md
|
|
5502
5537
|
*/
|
|
5503
5538
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
5504
5539
|
/**
|
|
5505
5540
|
* Prefer `.textContent` over `.innerText`.
|
|
5506
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5541
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
5507
5542
|
*/
|
|
5508
5543
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
5509
5544
|
/**
|
|
5510
5545
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
5511
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5546
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-event-target.md
|
|
5512
5547
|
*/
|
|
5513
5548
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
5514
5549
|
/**
|
|
5515
5550
|
* Prefer `export…from` when re-exporting.
|
|
5516
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5551
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-export-from.md
|
|
5517
5552
|
*/
|
|
5518
5553
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
5519
5554
|
/**
|
|
5520
5555
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
5521
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5556
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-global-this.md
|
|
5522
5557
|
*/
|
|
5523
5558
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
5524
5559
|
/**
|
|
5525
5560
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
5526
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5561
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-import-meta-properties.md
|
|
5527
5562
|
*/
|
|
5528
5563
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
5529
5564
|
/**
|
|
5530
5565
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
5531
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5566
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-includes.md
|
|
5532
5567
|
*/
|
|
5533
5568
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
5534
5569
|
/**
|
|
5535
5570
|
* Prefer reading a JSON file as a buffer.
|
|
5536
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5571
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
5537
5572
|
*/
|
|
5538
5573
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
5539
5574
|
/**
|
|
5540
5575
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
5541
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5576
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
5542
5577
|
*/
|
|
5543
5578
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
5544
5579
|
/**
|
|
5545
5580
|
* Prefer using a logical operator over a ternary.
|
|
5546
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5581
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
5547
5582
|
*/
|
|
5548
5583
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
5549
5584
|
/**
|
|
5550
5585
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
5551
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5586
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-math-min-max.md
|
|
5552
5587
|
*/
|
|
5553
5588
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5554
5589
|
/**
|
|
5555
5590
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
5556
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5591
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-math-trunc.md
|
|
5557
5592
|
*/
|
|
5558
5593
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
5559
5594
|
/**
|
|
5560
5595
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
5561
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5596
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
5562
5597
|
*/
|
|
5563
5598
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
5564
5599
|
/**
|
|
5565
5600
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
5566
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5601
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-modern-math-apis.md
|
|
5567
5602
|
*/
|
|
5568
5603
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
5569
5604
|
/**
|
|
5570
5605
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
5571
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5606
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-module.md
|
|
5572
5607
|
*/
|
|
5573
5608
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
5574
5609
|
/**
|
|
5575
5610
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
5576
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5611
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
5577
5612
|
*/
|
|
5578
5613
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
5579
5614
|
/**
|
|
5580
5615
|
* Prefer negative index over `.length - index` when possible.
|
|
5581
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5616
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-negative-index.md
|
|
5582
5617
|
*/
|
|
5583
5618
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
5584
5619
|
/**
|
|
5585
5620
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
5586
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5621
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-node-protocol.md
|
|
5587
5622
|
*/
|
|
5588
5623
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
5589
5624
|
/**
|
|
5590
5625
|
* Prefer `Number` static properties over global ones.
|
|
5591
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5626
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-number-properties.md
|
|
5592
5627
|
*/
|
|
5593
5628
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
5594
5629
|
/**
|
|
5595
5630
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
5596
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5631
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-object-from-entries.md
|
|
5597
5632
|
*/
|
|
5598
5633
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
5599
5634
|
/**
|
|
5600
5635
|
* Prefer omitting the `catch` binding parameter.
|
|
5601
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5636
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
5602
5637
|
*/
|
|
5603
5638
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
5604
5639
|
/**
|
|
5605
5640
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
5606
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5641
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-prototype-methods.md
|
|
5607
5642
|
*/
|
|
5608
5643
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
5609
5644
|
/**
|
|
5610
5645
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
5611
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5646
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-query-selector.md
|
|
5612
5647
|
*/
|
|
5613
5648
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
5614
5649
|
/**
|
|
5615
5650
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
5616
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5651
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-reflect-apply.md
|
|
5617
5652
|
*/
|
|
5618
5653
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
5619
5654
|
/**
|
|
5620
5655
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
5621
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5656
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-regexp-test.md
|
|
5622
5657
|
*/
|
|
5623
5658
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
5624
5659
|
/**
|
|
5625
5660
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
5626
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5661
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-set-has.md
|
|
5627
5662
|
*/
|
|
5628
5663
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
5629
5664
|
/**
|
|
5630
5665
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
5631
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5666
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-set-size.md
|
|
5632
5667
|
*/
|
|
5633
5668
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
5634
5669
|
/**
|
|
5635
5670
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
5636
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5671
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-single-call.md
|
|
5637
5672
|
*/
|
|
5638
5673
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
5639
5674
|
/**
|
|
5640
5675
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
5641
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5676
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-spread.md
|
|
5642
5677
|
*/
|
|
5643
5678
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
5644
5679
|
/**
|
|
5645
5680
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
5646
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5681
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-raw.md
|
|
5647
5682
|
*/
|
|
5648
5683
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
5649
5684
|
/**
|
|
5650
5685
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
5651
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5686
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-replace-all.md
|
|
5652
5687
|
*/
|
|
5653
5688
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
5654
5689
|
/**
|
|
5655
5690
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
5656
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5691
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-slice.md
|
|
5657
5692
|
*/
|
|
5658
5693
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
5659
5694
|
/**
|
|
5660
5695
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
5661
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5696
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
5662
5697
|
*/
|
|
5663
5698
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
5664
5699
|
/**
|
|
5665
5700
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
5666
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5701
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
5667
5702
|
*/
|
|
5668
5703
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
5669
5704
|
/**
|
|
5670
5705
|
* Prefer using `structuredClone` to create a deep clone.
|
|
5671
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5706
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-structured-clone.md
|
|
5672
5707
|
*/
|
|
5673
5708
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
5674
5709
|
/**
|
|
5675
5710
|
* Prefer `switch` over multiple `else-if`.
|
|
5676
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5711
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-switch.md
|
|
5677
5712
|
*/
|
|
5678
5713
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
5679
5714
|
/**
|
|
5680
5715
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
5681
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5716
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-ternary.md
|
|
5682
5717
|
*/
|
|
5683
5718
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
5684
5719
|
/**
|
|
5685
5720
|
* Prefer top-level await over top-level promises and async function calls.
|
|
5686
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5721
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-top-level-await.md
|
|
5687
5722
|
*/
|
|
5688
5723
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
5689
5724
|
/**
|
|
5690
5725
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
5691
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5726
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prefer-type-error.md
|
|
5692
5727
|
*/
|
|
5693
5728
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
5694
5729
|
/**
|
|
5695
5730
|
* Prevent abbreviations.
|
|
5696
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5731
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/prevent-abbreviations.md
|
|
5697
5732
|
*/
|
|
5698
5733
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
5699
5734
|
/**
|
|
5700
5735
|
* Enforce consistent relative URL style.
|
|
5701
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5736
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/relative-url-style.md
|
|
5702
5737
|
*/
|
|
5703
5738
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
5704
5739
|
/**
|
|
5705
5740
|
* Enforce using the separator argument with `Array#join()`.
|
|
5706
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5741
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-array-join-separator.md
|
|
5707
5742
|
*/
|
|
5708
5743
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
5744
|
+
/**
|
|
5745
|
+
* Require non-empty specifier list in import and export statements.
|
|
5746
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-module-specifiers.md
|
|
5747
|
+
*/
|
|
5748
|
+
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
5709
5749
|
/**
|
|
5710
5750
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
5711
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5751
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
5712
5752
|
*/
|
|
5713
5753
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
5714
5754
|
/**
|
|
5715
5755
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
5716
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5756
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/require-post-message-target-origin.md
|
|
5717
5757
|
*/
|
|
5718
5758
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
5719
5759
|
/**
|
|
5720
5760
|
* Enforce better string content.
|
|
5721
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5761
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/string-content.md
|
|
5722
5762
|
*/
|
|
5723
5763
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
5724
5764
|
/**
|
|
5725
5765
|
* Enforce consistent brace style for `case` clauses.
|
|
5726
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5766
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/switch-case-braces.md
|
|
5727
5767
|
*/
|
|
5728
5768
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
5729
5769
|
/**
|
|
5730
5770
|
* Fix whitespace-insensitive template indentation.
|
|
5731
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5771
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/template-indent.md
|
|
5732
5772
|
*/
|
|
5733
5773
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
5734
5774
|
/**
|
|
5735
5775
|
* Enforce consistent case for text encoding identifiers.
|
|
5736
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5776
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/text-encoding-identifier-case.md
|
|
5737
5777
|
*/
|
|
5738
5778
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>;
|
|
5739
5779
|
/**
|
|
5740
5780
|
* Require `new` when creating an error.
|
|
5741
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5781
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v60.0.0/docs/rules/throw-new-error.md
|
|
5742
5782
|
*/
|
|
5743
5783
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
5744
5784
|
/**
|
|
@@ -6392,7 +6432,7 @@ interface RuleOptions {
|
|
|
6392
6432
|
*/
|
|
6393
6433
|
'vue/no-restricted-custom-event'?: Linter.RuleEntry<VueNoRestrictedCustomEvent>;
|
|
6394
6434
|
/**
|
|
6395
|
-
* disallow specific
|
|
6435
|
+
* disallow specific elements
|
|
6396
6436
|
* @see https://eslint.vuejs.org/rules/no-restricted-html-elements.html
|
|
6397
6437
|
*/
|
|
6398
6438
|
'vue/no-restricted-html-elements'?: Linter.RuleEntry<VueNoRestrictedHtmlElements>;
|
|
@@ -7688,8 +7728,8 @@ type JsdocMatchName = [] | [{
|
|
|
7688
7728
|
context?: string;
|
|
7689
7729
|
disallowName?: string;
|
|
7690
7730
|
message?: string;
|
|
7731
|
+
replacement?: string;
|
|
7691
7732
|
tags?: string[];
|
|
7692
|
-
[k: string]: unknown | undefined;
|
|
7693
7733
|
}[];
|
|
7694
7734
|
}];
|
|
7695
7735
|
// ----- jsdoc/multiline-blocks -----
|
|
@@ -7701,6 +7741,7 @@ type JsdocMultilineBlocks = [] | [{
|
|
|
7701
7741
|
noMultilineBlocks?: boolean;
|
|
7702
7742
|
noSingleLineBlocks?: boolean;
|
|
7703
7743
|
noZeroLineText?: boolean;
|
|
7744
|
+
requireSingleLineUnderCount?: number;
|
|
7704
7745
|
singleLineTags?: string[];
|
|
7705
7746
|
}];
|
|
7706
7747
|
// ----- jsdoc/no-bad-blocks -----
|
|
@@ -7762,7 +7803,6 @@ type JsdocRequireAsteriskPrefix = [] | [("always" | "never" | "any")] | [("alway
|
|
|
7762
7803
|
always?: string[];
|
|
7763
7804
|
any?: string[];
|
|
7764
7805
|
never?: string[];
|
|
7765
|
-
[k: string]: unknown | undefined;
|
|
7766
7806
|
};
|
|
7767
7807
|
}];
|
|
7768
7808
|
// ----- jsdoc/require-description -----
|
|
@@ -7972,7 +8012,6 @@ type JsdocSortTags = [] | [{
|
|
|
7972
8012
|
reportTagGroupSpacing?: boolean;
|
|
7973
8013
|
tagSequence?: {
|
|
7974
8014
|
tags?: string[];
|
|
7975
|
-
[k: string]: unknown | undefined;
|
|
7976
8015
|
}[];
|
|
7977
8016
|
}];
|
|
7978
8017
|
// ----- jsdoc/tag-lines -----
|
|
@@ -8662,6 +8701,12 @@ type MarkdownNoDuplicateDefinitions = [] | [{
|
|
|
8662
8701
|
type MarkdownNoDuplicateHeadings = [] | [{
|
|
8663
8702
|
checkSiblingsOnly?: boolean;
|
|
8664
8703
|
}];
|
|
8704
|
+
// ----- markdown/no-empty-definitions -----
|
|
8705
|
+
type MarkdownNoEmptyDefinitions = [] | [{
|
|
8706
|
+
allowDefinitions?: string[];
|
|
8707
|
+
allowFootnoteDefinitions?: string[];
|
|
8708
|
+
checkFootnoteDefinitions?: boolean;
|
|
8709
|
+
}];
|
|
8665
8710
|
// ----- markdown/no-html -----
|
|
8666
8711
|
type MarkdownNoHtml = [] | [{
|
|
8667
8712
|
allowed?: string[];
|
|
@@ -8675,6 +8720,15 @@ type MarkdownNoMissingLinkFragments = [] | [{
|
|
|
8675
8720
|
type MarkdownNoMultipleH1 = [] | [{
|
|
8676
8721
|
frontmatterTitle?: string;
|
|
8677
8722
|
}];
|
|
8723
|
+
// ----- markdown/no-unused-definitions -----
|
|
8724
|
+
type MarkdownNoUnusedDefinitions = [] | [{
|
|
8725
|
+
allowDefinitions?: string[];
|
|
8726
|
+
allowFootnoteDefinitions?: string[];
|
|
8727
|
+
}];
|
|
8728
|
+
// ----- markdown/table-column-count -----
|
|
8729
|
+
type MarkdownTableColumnCount = [] | [{
|
|
8730
|
+
checkMissingCells?: boolean;
|
|
8731
|
+
}];
|
|
8678
8732
|
// ----- max-classes-per-file -----
|
|
8679
8733
|
type MaxClassesPerFile = [] | [(number | {
|
|
8680
8734
|
ignoreExpressions?: boolean;
|
|
@@ -8838,6 +8892,7 @@ type NoConstantCondition = [] | [{
|
|
|
8838
8892
|
// ----- no-duplicate-imports -----
|
|
8839
8893
|
type NoDuplicateImports = [] | [{
|
|
8840
8894
|
includeExports?: boolean;
|
|
8895
|
+
allowSeparateTypeImports?: boolean;
|
|
8841
8896
|
}];
|
|
8842
8897
|
// ----- no-else-return -----
|
|
8843
8898
|
type NoElseReturn = [] | [{
|
|
@@ -11804,10 +11859,12 @@ type StyleIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
11804
11859
|
FunctionDeclaration?: {
|
|
11805
11860
|
parameters?: (number | ("first" | "off"));
|
|
11806
11861
|
body?: number;
|
|
11862
|
+
returnType?: number;
|
|
11807
11863
|
};
|
|
11808
11864
|
FunctionExpression?: {
|
|
11809
11865
|
parameters?: (number | ("first" | "off"));
|
|
11810
11866
|
body?: number;
|
|
11867
|
+
returnType?: number;
|
|
11811
11868
|
};
|
|
11812
11869
|
StaticBlock?: {
|
|
11813
11870
|
body?: number;
|
|
@@ -11848,31 +11905,52 @@ type StyleJsxCurlyNewline = [] | [(("consistent" | "never") | {
|
|
|
11848
11905
|
multiline?: ("consistent" | "require" | "forbid");
|
|
11849
11906
|
})];
|
|
11850
11907
|
// ----- style/jsx-curly-spacing -----
|
|
11851
|
-
type StyleJsxCurlySpacing = [] | [(
|
|
11852
|
-
|
|
11853
|
-
children?: _StyleJsxCurlySpacingBasicConfigOrBoolean;
|
|
11854
|
-
[k: string]: unknown | undefined;
|
|
11855
|
-
}) | ("always" | "never"))] | [((_StyleJsxCurlySpacing_BasicConfig & {
|
|
11856
|
-
attributes?: _StyleJsxCurlySpacingBasicConfigOrBoolean;
|
|
11857
|
-
children?: _StyleJsxCurlySpacingBasicConfigOrBoolean;
|
|
11858
|
-
[k: string]: unknown | undefined;
|
|
11859
|
-
}) | ("always" | "never")), {
|
|
11908
|
+
type StyleJsxCurlySpacing = [] | [({
|
|
11909
|
+
when?: ("always" | "never");
|
|
11860
11910
|
allowMultiline?: boolean;
|
|
11861
11911
|
spacing?: {
|
|
11862
11912
|
objectLiterals?: ("always" | "never");
|
|
11863
|
-
[k: string]: unknown | undefined;
|
|
11864
11913
|
};
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11914
|
+
attributes?: ({
|
|
11915
|
+
when?: ("always" | "never");
|
|
11916
|
+
allowMultiline?: boolean;
|
|
11917
|
+
spacing?: {
|
|
11918
|
+
objectLiterals?: ("always" | "never");
|
|
11919
|
+
};
|
|
11920
|
+
} | boolean);
|
|
11921
|
+
children?: ({
|
|
11922
|
+
when?: ("always" | "never");
|
|
11923
|
+
allowMultiline?: boolean;
|
|
11924
|
+
spacing?: {
|
|
11925
|
+
objectLiterals?: ("always" | "never");
|
|
11926
|
+
};
|
|
11927
|
+
} | boolean);
|
|
11928
|
+
} | ("always" | "never"))] | [({
|
|
11868
11929
|
when?: ("always" | "never");
|
|
11869
11930
|
allowMultiline?: boolean;
|
|
11870
11931
|
spacing?: {
|
|
11871
11932
|
objectLiterals?: ("always" | "never");
|
|
11872
|
-
[k: string]: unknown | undefined;
|
|
11873
11933
|
};
|
|
11874
|
-
|
|
11875
|
-
|
|
11934
|
+
attributes?: ({
|
|
11935
|
+
when?: ("always" | "never");
|
|
11936
|
+
allowMultiline?: boolean;
|
|
11937
|
+
spacing?: {
|
|
11938
|
+
objectLiterals?: ("always" | "never");
|
|
11939
|
+
};
|
|
11940
|
+
} | boolean);
|
|
11941
|
+
children?: ({
|
|
11942
|
+
when?: ("always" | "never");
|
|
11943
|
+
allowMultiline?: boolean;
|
|
11944
|
+
spacing?: {
|
|
11945
|
+
objectLiterals?: ("always" | "never");
|
|
11946
|
+
};
|
|
11947
|
+
} | boolean);
|
|
11948
|
+
} | ("always" | "never")), {
|
|
11949
|
+
allowMultiline?: boolean;
|
|
11950
|
+
spacing?: {
|
|
11951
|
+
objectLiterals?: ("always" | "never");
|
|
11952
|
+
};
|
|
11953
|
+
}];
|
|
11876
11954
|
// ----- style/jsx-equals-spacing -----
|
|
11877
11955
|
type StyleJsxEqualsSpacing = [] | [("always" | "never")];
|
|
11878
11956
|
// ----- style/jsx-first-prop-new-line -----
|
|
@@ -11888,14 +11966,12 @@ type StyleJsxIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
11888
11966
|
type StyleJsxIndentProps = [] | [(("tab" | "first") | number | {
|
|
11889
11967
|
indentMode?: (("tab" | "first") | number);
|
|
11890
11968
|
ignoreTernaryOperator?: boolean;
|
|
11891
|
-
[k: string]: unknown | undefined;
|
|
11892
11969
|
})];
|
|
11893
11970
|
// ----- style/jsx-max-props-per-line -----
|
|
11894
11971
|
type StyleJsxMaxPropsPerLine = [] | [({
|
|
11895
11972
|
maximum?: {
|
|
11896
11973
|
single?: number;
|
|
11897
11974
|
multi?: number;
|
|
11898
|
-
[k: string]: unknown | undefined;
|
|
11899
11975
|
};
|
|
11900
11976
|
} | {
|
|
11901
11977
|
maximum?: number;
|
|
@@ -12242,6 +12318,10 @@ type StyleKeywordSpacing = [] | [{
|
|
|
12242
12318
|
before?: boolean;
|
|
12243
12319
|
after?: boolean;
|
|
12244
12320
|
};
|
|
12321
|
+
accessor?: {
|
|
12322
|
+
before?: boolean;
|
|
12323
|
+
after?: boolean;
|
|
12324
|
+
};
|
|
12245
12325
|
as?: {
|
|
12246
12326
|
before?: boolean;
|
|
12247
12327
|
after?: boolean;
|
|
@@ -12454,11 +12534,11 @@ interface _StyleMemberDelimiterStyle_DelimiterConfig {
|
|
|
12454
12534
|
// ----- style/multiline-comment-style -----
|
|
12455
12535
|
type StyleMultilineCommentStyle = ([] | [("starred-block" | "bare-block")] | [] | ["separate-lines"] | ["separate-lines", {
|
|
12456
12536
|
checkJSDoc?: boolean;
|
|
12537
|
+
checkExclamation?: boolean;
|
|
12457
12538
|
}]);
|
|
12458
12539
|
// ----- style/multiline-ternary -----
|
|
12459
12540
|
type StyleMultilineTernary = [] | [("always" | "always-multiline" | "never")] | [("always" | "always-multiline" | "never"), {
|
|
12460
12541
|
ignoreJSX?: boolean;
|
|
12461
|
-
[k: string]: unknown | undefined;
|
|
12462
12542
|
}];
|
|
12463
12543
|
// ----- style/new-parens -----
|
|
12464
12544
|
type StyleNewParens = [] | [("always" | "never")];
|
|
@@ -12603,11 +12683,12 @@ type StylePaddedBlocks = [] | [(("always" | "never" | "start" | "end") | {
|
|
|
12603
12683
|
}];
|
|
12604
12684
|
// ----- style/padding-line-between-statements -----
|
|
12605
12685
|
type _StylePaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always");
|
|
12606
|
-
type
|
|
12686
|
+
type _StylePaddingLineBetweenStatementsStatementOption = (_StylePaddingLineBetweenStatementsStatementType | [_StylePaddingLineBetweenStatementsStatementType, ...(_StylePaddingLineBetweenStatementsStatementType)[]]);
|
|
12687
|
+
type _StylePaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "return" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "type" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using");
|
|
12607
12688
|
type StylePaddingLineBetweenStatements = {
|
|
12608
12689
|
blankLine: _StylePaddingLineBetweenStatementsPaddingType;
|
|
12609
|
-
prev:
|
|
12610
|
-
next:
|
|
12690
|
+
prev: _StylePaddingLineBetweenStatementsStatementOption;
|
|
12691
|
+
next: _StylePaddingLineBetweenStatementsStatementOption;
|
|
12611
12692
|
}[];
|
|
12612
12693
|
// ----- style/quote-props -----
|
|
12613
12694
|
type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
@@ -13414,6 +13495,7 @@ interface _TsNamingConvention_MatchRegexConfig {
|
|
|
13414
13495
|
}
|
|
13415
13496
|
// ----- ts/no-base-to-string -----
|
|
13416
13497
|
type TsNoBaseToString = [] | [{
|
|
13498
|
+
checkUnknown?: boolean;
|
|
13417
13499
|
ignoredTypeNames?: string[];
|
|
13418
13500
|
}];
|
|
13419
13501
|
// ----- ts/no-confusing-void-expression -----
|
|
@@ -13737,7 +13819,6 @@ type TsPreferDestructuring = [] | [({
|
|
|
13737
13819
|
}), {
|
|
13738
13820
|
enforceForDeclarationWithTypeAnnotation?: boolean;
|
|
13739
13821
|
enforceForRenamedProperties?: boolean;
|
|
13740
|
-
[k: string]: unknown | undefined;
|
|
13741
13822
|
}];
|
|
13742
13823
|
// ----- ts/prefer-literal-enum-member -----
|
|
13743
13824
|
type TsPreferLiteralEnumMember = [] | [{
|
|
@@ -13755,7 +13836,6 @@ type TsPreferNullishCoalescing = [] | [{
|
|
|
13755
13836
|
boolean?: boolean;
|
|
13756
13837
|
number?: boolean;
|
|
13757
13838
|
string?: boolean;
|
|
13758
|
-
[k: string]: unknown | undefined;
|
|
13759
13839
|
} | true);
|
|
13760
13840
|
ignoreTernaryTests?: boolean;
|
|
13761
13841
|
}];
|
|
@@ -13964,6 +14044,10 @@ interface _UnicornImportStyle_BooleanObject {
|
|
|
13964
14044
|
type UnicornNoArrayReduce = [] | [{
|
|
13965
14045
|
allowSimpleOperations?: boolean;
|
|
13966
14046
|
}];
|
|
14047
|
+
// ----- unicorn/no-array-reverse -----
|
|
14048
|
+
type UnicornNoArrayReverse = [] | [{
|
|
14049
|
+
allowExpressionStatement?: boolean;
|
|
14050
|
+
}];
|
|
13967
14051
|
// ----- unicorn/no-instanceof-builtins -----
|
|
13968
14052
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
13969
14053
|
useErrorIsError?: boolean;
|
|
@@ -15675,14 +15759,24 @@ interface VendoredPrettierOptionsRequired {
|
|
|
15675
15759
|
//#endregion
|
|
15676
15760
|
//#region src/types.d.ts
|
|
15677
15761
|
type Awaitable<T> = T | Promise<T>;
|
|
15678
|
-
|
|
15679
|
-
|
|
15762
|
+
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
15763
|
+
/**
|
|
15764
|
+
* ESLint 的 `Linter.Config` 的更新版本,
|
|
15765
|
+
* 为 `rules` 提供自动补全功能,并放宽了 `plugins` 和 `rules` 的类型限制,
|
|
15766
|
+
* 因为许多插件仍然缺乏适当的类型定义。
|
|
15767
|
+
*/
|
|
15768
|
+
type TypedFlatConfigItem = Omit<Linter.Config, 'plugins' | 'rules'> & {
|
|
15680
15769
|
/**
|
|
15681
|
-
*
|
|
15770
|
+
* 一个包含插件名称到插件对象的键值对映射的对象。
|
|
15771
|
+
* 当指定 `files` 时,这些插件仅适用于匹配的文件。
|
|
15682
15772
|
*
|
|
15683
|
-
* @see [
|
|
15773
|
+
* @see [在配置中使用插件](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
15684
15774
|
*/
|
|
15685
15775
|
plugins?: Record<string, any>;
|
|
15776
|
+
/**
|
|
15777
|
+
* 包含已配置规则的对象。当指定 `files` 或 `ignores` 时,这些规则配置仅适用于匹配的文件。
|
|
15778
|
+
*/
|
|
15779
|
+
rules?: Rules;
|
|
15686
15780
|
};
|
|
15687
15781
|
interface OptionsFiles {
|
|
15688
15782
|
/**
|
|
@@ -15824,7 +15918,7 @@ interface OptionsOverrides {
|
|
|
15824
15918
|
}
|
|
15825
15919
|
interface OptionsProjectType {
|
|
15826
15920
|
/**
|
|
15827
|
-
*
|
|
15921
|
+
* 项目类型。“lib”将为库启用更严格的规则。
|
|
15828
15922
|
*
|
|
15829
15923
|
* @default 'app'
|
|
15830
15924
|
*/
|
|
@@ -15858,14 +15952,14 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
15858
15952
|
/**
|
|
15859
15953
|
* 启用 gitignore 支持.
|
|
15860
15954
|
*
|
|
15861
|
-
*
|
|
15955
|
+
* 传递一个对象来配置选项
|
|
15862
15956
|
*
|
|
15863
15957
|
* @see https://github.com/antfu/eslint-config-flat-gitignore
|
|
15864
15958
|
* @default true
|
|
15865
15959
|
*/
|
|
15866
15960
|
gitignore?: boolean | FlatGitignoreOptions;
|
|
15867
15961
|
/**
|
|
15868
|
-
*
|
|
15962
|
+
* 核心规则。不能禁用。
|
|
15869
15963
|
*/
|
|
15870
15964
|
javascript?: boolean;
|
|
15871
15965
|
/**
|
|
@@ -15955,6 +16049,15 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
15955
16049
|
* @default 根据依赖关系自动检测
|
|
15956
16050
|
*/
|
|
15957
16051
|
react?: boolean | OptionsFiles;
|
|
16052
|
+
/**
|
|
16053
|
+
* 启用 nextjs 支持.
|
|
16054
|
+
*
|
|
16055
|
+
* 需要安装:
|
|
16056
|
+
* - `@next/eslint-plugin-next`
|
|
16057
|
+
*
|
|
16058
|
+
* @default false
|
|
16059
|
+
*/
|
|
16060
|
+
nextjs?: boolean | OptionsOverrides;
|
|
15958
16061
|
/**
|
|
15959
16062
|
* 启用 unocss rules.
|
|
15960
16063
|
*
|
|
@@ -16003,30 +16106,38 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
16003
16106
|
* @default true
|
|
16004
16107
|
*/
|
|
16005
16108
|
autoRenamePlugins?: boolean;
|
|
16109
|
+
/**
|
|
16110
|
+
* 没啥用的配置
|
|
16111
|
+
*/
|
|
16112
|
+
comments?: boolean | OptionsOverrides;
|
|
16113
|
+
node?: boolean | OptionsOverrides;
|
|
16114
|
+
jsdoc?: boolean | OptionsOverrides;
|
|
16115
|
+
perfectionist?: boolean | OptionsOverrides;
|
|
16116
|
+
ignores?: boolean | OptionsOverrides;
|
|
16006
16117
|
/**
|
|
16007
16118
|
* 为每个集成提供规则覆盖
|
|
16008
16119
|
*/
|
|
16009
16120
|
overrides?: {
|
|
16121
|
+
comments?: TypedFlatConfigItem['rules'];
|
|
16122
|
+
ignores?: string[];
|
|
16123
|
+
imports?: TypedFlatConfigItem['rules'];
|
|
16010
16124
|
javascript?: TypedFlatConfigItem['rules'];
|
|
16011
|
-
|
|
16012
|
-
stylistic?: TypedFlatConfigItem['rules'];
|
|
16013
|
-
test?: TypedFlatConfigItem['rules'];
|
|
16014
|
-
vue?: TypedFlatConfigItem['rules'];
|
|
16015
|
-
regexp?: TypedFlatConfigItem['rules'];
|
|
16016
|
-
react?: TypedFlatConfigItem['rules'];
|
|
16017
|
-
svelte?: TypedFlatConfigItem['rules'];
|
|
16125
|
+
jsdoc?: TypedFlatConfigItem['rules'];
|
|
16018
16126
|
jsonc?: TypedFlatConfigItem['rules'];
|
|
16019
16127
|
markdown?: TypedFlatConfigItem['rules'];
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
unocss?: TypedFlatConfigItem['rules'];
|
|
16128
|
+
nuxtjs?: TypedFlatConfigItem['rules'];
|
|
16129
|
+
node?: TypedFlatConfigItem['rules'];
|
|
16023
16130
|
perfectionist?: TypedFlatConfigItem['rules'];
|
|
16131
|
+
react?: TypedFlatConfigItem['rules'];
|
|
16132
|
+
regexp?: TypedFlatConfigItem['rules'];
|
|
16133
|
+
stylistic?: TypedFlatConfigItem['rules'];
|
|
16134
|
+
test?: TypedFlatConfigItem['rules'];
|
|
16135
|
+
toml?: TypedFlatConfigItem['rules'];
|
|
16136
|
+
typescript?: TypedFlatConfigItem['rules'];
|
|
16024
16137
|
unicorn?: TypedFlatConfigItem['rules'];
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
jsdoc?: TypedFlatConfigItem['rules'];
|
|
16029
|
-
ignores?: string[];
|
|
16138
|
+
unocss?: TypedFlatConfigItem['rules'];
|
|
16139
|
+
vue?: TypedFlatConfigItem['rules'];
|
|
16140
|
+
yaml?: TypedFlatConfigItem['rules'];
|
|
16030
16141
|
};
|
|
16031
16142
|
}
|
|
16032
16143
|
//#endregion
|
|
@@ -16036,6 +16147,7 @@ declare const defaultPluginRenaming: {
|
|
|
16036
16147
|
'@eslint-react/dom': string;
|
|
16037
16148
|
'@eslint-react/hooks-extra': string;
|
|
16038
16149
|
'@eslint-react/naming-convention': string;
|
|
16150
|
+
'@next/next': string;
|
|
16039
16151
|
'@stylistic': string;
|
|
16040
16152
|
'@typescript-eslint': string;
|
|
16041
16153
|
'import-lite': string;
|
|
@@ -16088,6 +16200,9 @@ declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
|
16088
16200
|
//#region src/configs/markdown.d.ts
|
|
16089
16201
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
16090
16202
|
//#endregion
|
|
16203
|
+
//#region src/configs/nextjs.d.ts
|
|
16204
|
+
declare function nextjs(options?: OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
16205
|
+
//#endregion
|
|
16091
16206
|
//#region src/configs/node.d.ts
|
|
16092
16207
|
declare function node(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
16093
16208
|
//#endregion
|
|
@@ -16220,4 +16335,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
16220
16335
|
declare function isInEditorEnv(): boolean;
|
|
16221
16336
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
16222
16337
|
//#endregion
|
|
16223
|
-
export { Awaitable, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, lincy as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, lincy, markdown, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
16338
|
+
export { Awaitable, type ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIgnores, OptionsIsInEditor, OptionsOverrides, OptionsProjectType, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, lincy as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, lincy, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|