@nicksp/eslint-config 1.2.0 → 1.4.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 +3 -1
- package/dist/index.d.ts +398 -291
- package/dist/index.js +1 -1
- package/package.json +27 -26
package/dist/index.d.ts
CHANGED
|
@@ -1141,6 +1141,11 @@ interface RuleOptions {
|
|
|
1141
1141
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-set-text-directive/
|
|
1142
1142
|
*/
|
|
1143
1143
|
'astro/no-set-text-directive'?: Linter.RuleEntry<[]>;
|
|
1144
|
+
/**
|
|
1145
|
+
* disallow inline `<script>` without `src` to encourage CSP-safe patterns
|
|
1146
|
+
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unsafe-inline-scripts/
|
|
1147
|
+
*/
|
|
1148
|
+
'astro/no-unsafe-inline-scripts'?: Linter.RuleEntry<AstroNoUnsafeInlineScripts>;
|
|
1144
1149
|
/**
|
|
1145
1150
|
* disallow selectors defined in `style` tag that don't use in HTML
|
|
1146
1151
|
* @see https://ota-meshi.github.io/eslint-plugin-astro/rules/no-unused-css-selector/
|
|
@@ -1315,6 +1320,26 @@ interface RuleOptions {
|
|
|
1315
1320
|
* @see https://eslint.org/docs/latest/rules/eqeqeq
|
|
1316
1321
|
*/
|
|
1317
1322
|
'eqeqeq'?: Linter.RuleEntry<Eqeqeq>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Avoid using TypeScript's enums.
|
|
1325
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/enums.md
|
|
1326
|
+
*/
|
|
1327
|
+
'erasable-syntax-only/enums'?: Linter.RuleEntry<[]>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Avoid using TypeScript's import aliases.
|
|
1330
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/import-aliases.md
|
|
1331
|
+
*/
|
|
1332
|
+
'erasable-syntax-only/import-aliases'?: Linter.RuleEntry<[]>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Avoid using TypeScript's namespaces.
|
|
1335
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/namespaces.md
|
|
1336
|
+
*/
|
|
1337
|
+
'erasable-syntax-only/namespaces'?: Linter.RuleEntry<[]>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Avoid using TypeScript's class parameter properties.
|
|
1340
|
+
* @see https://github.com/JoshuaKGoldberg/eslint-plugin-erasable-syntax-only/blob/main/docs/rules/parameter-properties.md
|
|
1341
|
+
*/
|
|
1342
|
+
'erasable-syntax-only/parameter-properties'?: Linter.RuleEntry<[]>;
|
|
1318
1343
|
/**
|
|
1319
1344
|
* Enforce `for` loop update clause moving the counter in the right direction
|
|
1320
1345
|
* @see https://eslint.org/docs/latest/rules/for-direction
|
|
@@ -1805,6 +1830,26 @@ interface RuleOptions {
|
|
|
1805
1830
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
|
|
1806
1831
|
*/
|
|
1807
1832
|
'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Prefers either function properties or method signatures
|
|
1835
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-method-signature-style.md#repos-sticky-header
|
|
1836
|
+
*/
|
|
1837
|
+
'jsdoc/ts-method-signature-style'?: Linter.RuleEntry<JsdocTsMethodSignatureStyle>;
|
|
1838
|
+
/**
|
|
1839
|
+
* Warns against use of the empty object type
|
|
1840
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-empty-object-type.md#repos-sticky-header
|
|
1841
|
+
*/
|
|
1842
|
+
'jsdoc/ts-no-empty-object-type'?: Linter.RuleEntry<[]>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Catches unnecessary template expressions such as string expressions within a template literal.
|
|
1845
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-no-unnecessary-template-expression.md#repos-sticky-header
|
|
1846
|
+
*/
|
|
1847
|
+
'jsdoc/ts-no-unnecessary-template-expression'?: Linter.RuleEntry<JsdocTsNoUnnecessaryTemplateExpression>;
|
|
1848
|
+
/**
|
|
1849
|
+
* Prefers function types over call signatures when there are no other properties.
|
|
1850
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/ts-prefer-function-type.md#repos-sticky-header
|
|
1851
|
+
*/
|
|
1852
|
+
'jsdoc/ts-prefer-function-type'?: Linter.RuleEntry<JsdocTsPreferFunctionType>;
|
|
1808
1853
|
/**
|
|
1809
1854
|
* Formats JSDoc type values.
|
|
1810
1855
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header
|
|
@@ -3857,7 +3902,7 @@ interface RuleOptions {
|
|
|
3857
3902
|
*/
|
|
3858
3903
|
'react-hooks/use-memo'?: Linter.RuleEntry<ReactHooksUseMemo>;
|
|
3859
3904
|
/**
|
|
3860
|
-
* Validates that useMemos always return a value. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
3905
|
+
* Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
|
|
3861
3906
|
*/
|
|
3862
3907
|
'react-hooks/void-use-memo'?: Linter.RuleEntry<ReactHooksVoidUseMemo>;
|
|
3863
3908
|
/**
|
|
@@ -4750,7 +4795,7 @@ interface RuleOptions {
|
|
|
4750
4795
|
*/
|
|
4751
4796
|
'template-tag-spacing'?: Linter.RuleEntry<TemplateTagSpacing>;
|
|
4752
4797
|
/**
|
|
4753
|
-
* require
|
|
4798
|
+
* require test file pattern
|
|
4754
4799
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
4755
4800
|
*/
|
|
4756
4801
|
'test/consistent-test-filename'?: Linter.RuleEntry<TestConsistentTestFilename>;
|
|
@@ -5137,710 +5182,725 @@ interface RuleOptions {
|
|
|
5137
5182
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
5138
5183
|
/**
|
|
5139
5184
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
5140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/better-regex.md
|
|
5141
5186
|
*/
|
|
5142
5187
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
5143
5188
|
/**
|
|
5144
5189
|
* Enforce a specific parameter name in catch clauses.
|
|
5145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/catch-error-name.md
|
|
5146
5191
|
*/
|
|
5147
5192
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
5148
5193
|
/**
|
|
5149
5194
|
* Enforce consistent assertion style with `node:assert`.
|
|
5150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5195
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-assert.md
|
|
5151
5196
|
*/
|
|
5152
5197
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
5153
5198
|
/**
|
|
5154
5199
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
5155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-date-clone.md
|
|
5156
5201
|
*/
|
|
5157
5202
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
5158
5203
|
/**
|
|
5159
5204
|
* Use destructured variables over properties.
|
|
5160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5205
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-destructuring.md
|
|
5161
5206
|
*/
|
|
5162
5207
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
5163
5208
|
/**
|
|
5164
5209
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
5165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5210
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-empty-array-spread.md
|
|
5166
5211
|
*/
|
|
5167
5212
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
5168
5213
|
/**
|
|
5169
5214
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
5170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5215
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-existence-index-check.md
|
|
5171
5216
|
*/
|
|
5172
5217
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
5173
5218
|
/**
|
|
5174
5219
|
* Move function definitions to the highest possible scope.
|
|
5175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5220
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-function-scoping.md
|
|
5176
5221
|
*/
|
|
5177
5222
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
5178
5223
|
/**
|
|
5179
5224
|
* Enforce correct `Error` subclassing.
|
|
5180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5225
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/custom-error-definition.md
|
|
5181
5226
|
*/
|
|
5182
5227
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
5183
5228
|
/**
|
|
5184
5229
|
* Enforce no spaces between braces.
|
|
5185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5230
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/empty-brace-spaces.md
|
|
5186
5231
|
*/
|
|
5187
5232
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
5188
5233
|
/**
|
|
5189
5234
|
* Enforce passing a `message` value when creating a built-in error.
|
|
5190
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5235
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/error-message.md
|
|
5191
5236
|
*/
|
|
5192
5237
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
5193
5238
|
/**
|
|
5194
5239
|
* Require escape sequences to use uppercase or lowercase values.
|
|
5195
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5240
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/escape-case.md
|
|
5196
5241
|
*/
|
|
5197
5242
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
5198
5243
|
/**
|
|
5199
5244
|
* Add expiration conditions to TODO comments.
|
|
5200
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5245
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/expiring-todo-comments.md
|
|
5201
5246
|
*/
|
|
5202
5247
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
5203
5248
|
/**
|
|
5204
5249
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
5205
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5250
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/explicit-length-check.md
|
|
5206
5251
|
*/
|
|
5207
5252
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
5208
5253
|
/**
|
|
5209
5254
|
* Enforce a case style for filenames.
|
|
5210
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5255
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/filename-case.md
|
|
5211
5256
|
*/
|
|
5212
5257
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
5213
5258
|
/**
|
|
5214
5259
|
* Enforce specific import styles per module.
|
|
5215
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5260
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/import-style.md
|
|
5216
5261
|
*/
|
|
5217
5262
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
5218
5263
|
/**
|
|
5219
5264
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
5220
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5265
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/new-for-builtins.md
|
|
5221
5266
|
*/
|
|
5222
5267
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
5223
5268
|
/**
|
|
5224
5269
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
5225
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5270
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
5226
5271
|
*/
|
|
5227
5272
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
5228
5273
|
/**
|
|
5229
5274
|
* Disallow recursive access to `this` within getters and setters.
|
|
5230
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5275
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-accessor-recursion.md
|
|
5231
5276
|
*/
|
|
5232
5277
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
5233
5278
|
/**
|
|
5234
5279
|
* Disallow anonymous functions and classes as the default export.
|
|
5235
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5280
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-anonymous-default-export.md
|
|
5236
5281
|
*/
|
|
5237
5282
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
5238
5283
|
/**
|
|
5239
5284
|
* Prevent passing a function reference directly to iterator methods.
|
|
5240
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5285
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-callback-reference.md
|
|
5241
5286
|
*/
|
|
5242
5287
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
5243
5288
|
/**
|
|
5244
5289
|
* Prefer `for…of` over the `forEach` method.
|
|
5245
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5290
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-for-each.md
|
|
5246
5291
|
*/
|
|
5247
5292
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
5248
5293
|
/**
|
|
5249
5294
|
* Disallow using the `this` argument in array methods.
|
|
5250
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5295
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-method-this-argument.md
|
|
5251
5296
|
*/
|
|
5252
5297
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
5253
5298
|
/**
|
|
5254
5299
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
5255
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5300
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
5256
5301
|
* @deprecated
|
|
5257
5302
|
*/
|
|
5258
5303
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
5259
5304
|
/**
|
|
5260
5305
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
5261
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reduce.md
|
|
5262
5307
|
*/
|
|
5263
5308
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
5264
5309
|
/**
|
|
5265
5310
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
5266
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reverse.md
|
|
5267
5312
|
*/
|
|
5268
5313
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
5269
5314
|
/**
|
|
5270
5315
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
5271
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-sort.md
|
|
5272
5317
|
*/
|
|
5273
5318
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
5274
5319
|
/**
|
|
5275
5320
|
* Disallow member access from await expression.
|
|
5276
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-expression-member.md
|
|
5277
5322
|
*/
|
|
5278
5323
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
5279
5324
|
/**
|
|
5280
5325
|
* Disallow using `await` in `Promise` method parameters.
|
|
5281
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-in-promise-methods.md
|
|
5282
5327
|
*/
|
|
5283
5328
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5284
5329
|
/**
|
|
5285
5330
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
5286
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-console-spaces.md
|
|
5287
5332
|
*/
|
|
5288
5333
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
5289
5334
|
/**
|
|
5290
5335
|
* Do not use `document.cookie` directly.
|
|
5291
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-document-cookie.md
|
|
5292
5337
|
*/
|
|
5293
5338
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
5294
5339
|
/**
|
|
5295
5340
|
* Disallow empty files.
|
|
5296
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-empty-file.md
|
|
5297
5342
|
*/
|
|
5298
5343
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
5299
5344
|
/**
|
|
5300
5345
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
5301
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-for-loop.md
|
|
5302
5347
|
*/
|
|
5303
5348
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
5304
5349
|
/**
|
|
5305
5350
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
5306
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-hex-escape.md
|
|
5307
5352
|
*/
|
|
5308
5353
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
5354
|
+
/**
|
|
5355
|
+
* Disallow immediate mutation after variable assignment.
|
|
5356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-immediate-mutation.md
|
|
5357
|
+
*/
|
|
5358
|
+
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>;
|
|
5309
5359
|
/**
|
|
5310
5360
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
5311
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
5312
5362
|
* @deprecated
|
|
5313
5363
|
*/
|
|
5314
5364
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
5315
5365
|
/**
|
|
5316
5366
|
* Disallow `instanceof` with built-in objects
|
|
5317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5367
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-instanceof-builtins.md
|
|
5318
5368
|
*/
|
|
5319
5369
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
5320
5370
|
/**
|
|
5321
5371
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
5322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5372
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-fetch-options.md
|
|
5323
5373
|
*/
|
|
5324
5374
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
5325
5375
|
/**
|
|
5326
5376
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
5327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5377
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
5328
5378
|
*/
|
|
5329
5379
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
5330
5380
|
/**
|
|
5331
5381
|
* Disallow identifiers starting with `new` or `class`.
|
|
5332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5382
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-keyword-prefix.md
|
|
5333
5383
|
*/
|
|
5334
5384
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
5335
5385
|
/**
|
|
5336
5386
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
5337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5387
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
5338
5388
|
* @deprecated
|
|
5339
5389
|
*/
|
|
5340
5390
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
5341
5391
|
/**
|
|
5342
5392
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
5343
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-lonely-if.md
|
|
5344
5394
|
*/
|
|
5345
5395
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
5346
5396
|
/**
|
|
5347
5397
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
5348
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
5349
5399
|
*/
|
|
5350
5400
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5351
5401
|
/**
|
|
5352
5402
|
* Disallow named usage of default import and export.
|
|
5353
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-named-default.md
|
|
5354
5404
|
*/
|
|
5355
5405
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
5356
5406
|
/**
|
|
5357
5407
|
* Disallow negated conditions.
|
|
5358
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negated-condition.md
|
|
5359
5409
|
*/
|
|
5360
5410
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
5361
5411
|
/**
|
|
5362
5412
|
* Disallow negated expression in equality check.
|
|
5363
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negation-in-equality-check.md
|
|
5364
5414
|
*/
|
|
5365
5415
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
5366
5416
|
/**
|
|
5367
5417
|
* Disallow nested ternary expressions.
|
|
5368
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-nested-ternary.md
|
|
5369
5419
|
*/
|
|
5370
5420
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
5371
5421
|
/**
|
|
5372
5422
|
* Disallow `new Array()`.
|
|
5373
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-array.md
|
|
5374
5424
|
*/
|
|
5375
5425
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
5376
5426
|
/**
|
|
5377
5427
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
5378
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-buffer.md
|
|
5379
5429
|
*/
|
|
5380
5430
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
5381
5431
|
/**
|
|
5382
5432
|
* Disallow the use of the `null` literal.
|
|
5383
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5433
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-null.md
|
|
5384
5434
|
*/
|
|
5385
5435
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
5386
5436
|
/**
|
|
5387
5437
|
* Disallow the use of objects as default parameters.
|
|
5388
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5438
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-object-as-default-parameter.md
|
|
5389
5439
|
*/
|
|
5390
5440
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
5391
5441
|
/**
|
|
5392
5442
|
* Disallow `process.exit()`.
|
|
5393
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5443
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-process-exit.md
|
|
5394
5444
|
*/
|
|
5395
5445
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
5396
5446
|
/**
|
|
5397
5447
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
5398
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5448
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
5399
5449
|
*/
|
|
5400
5450
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
5401
5451
|
/**
|
|
5402
5452
|
* Disallow classes that only have static members.
|
|
5403
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5453
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-static-only-class.md
|
|
5404
5454
|
*/
|
|
5405
5455
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
5406
5456
|
/**
|
|
5407
5457
|
* Disallow `then` property.
|
|
5408
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5458
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-thenable.md
|
|
5409
5459
|
*/
|
|
5410
5460
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
5411
5461
|
/**
|
|
5412
5462
|
* Disallow assigning `this` to a variable.
|
|
5413
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5463
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-this-assignment.md
|
|
5414
5464
|
*/
|
|
5415
5465
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
5416
5466
|
/**
|
|
5417
5467
|
* Disallow comparing `undefined` using `typeof`.
|
|
5418
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5468
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-typeof-undefined.md
|
|
5419
5469
|
*/
|
|
5420
5470
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
5421
5471
|
/**
|
|
5422
5472
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
5423
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5473
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
5424
5474
|
*/
|
|
5425
5475
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
5426
5476
|
/**
|
|
5427
5477
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
5428
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5478
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
5429
5479
|
*/
|
|
5430
5480
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
5431
5481
|
/**
|
|
5432
5482
|
* Disallow awaiting non-promise values.
|
|
5433
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5483
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-await.md
|
|
5434
5484
|
*/
|
|
5435
5485
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
5436
5486
|
/**
|
|
5437
5487
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
5438
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5488
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
5439
5489
|
*/
|
|
5440
5490
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
5441
5491
|
/**
|
|
5442
5492
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
5443
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5493
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
5444
5494
|
*/
|
|
5445
5495
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
5446
5496
|
/**
|
|
5447
5497
|
* Disallow unreadable array destructuring.
|
|
5448
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5498
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
5449
5499
|
*/
|
|
5450
5500
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
5451
5501
|
/**
|
|
5452
5502
|
* Disallow unreadable IIFEs.
|
|
5453
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5503
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-iife.md
|
|
5454
5504
|
*/
|
|
5455
5505
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
5456
5506
|
/**
|
|
5457
5507
|
* Disallow unused object properties.
|
|
5458
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5508
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unused-properties.md
|
|
5459
5509
|
*/
|
|
5460
5510
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
5511
|
+
/**
|
|
5512
|
+
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
5513
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-collection-argument.md
|
|
5514
|
+
*/
|
|
5515
|
+
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>;
|
|
5461
5516
|
/**
|
|
5462
5517
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
5463
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5518
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
5464
5519
|
*/
|
|
5465
5520
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
5466
5521
|
/**
|
|
5467
5522
|
* Disallow useless fallback when spreading in object literals.
|
|
5468
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5523
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
5469
5524
|
*/
|
|
5470
5525
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
5471
5526
|
/**
|
|
5472
5527
|
* Disallow useless array length check.
|
|
5473
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5528
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-length-check.md
|
|
5474
5529
|
*/
|
|
5475
5530
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
5476
5531
|
/**
|
|
5477
5532
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
5478
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5533
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
5479
5534
|
*/
|
|
5480
5535
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
5481
5536
|
/**
|
|
5482
5537
|
* Disallow unnecessary spread.
|
|
5483
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5538
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-spread.md
|
|
5484
5539
|
*/
|
|
5485
5540
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
5486
5541
|
/**
|
|
5487
5542
|
* Disallow useless case in switch statements.
|
|
5488
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5543
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-switch-case.md
|
|
5489
5544
|
*/
|
|
5490
5545
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
5491
5546
|
/**
|
|
5492
5547
|
* Disallow useless `undefined`.
|
|
5493
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5548
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-undefined.md
|
|
5494
5549
|
*/
|
|
5495
5550
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
5496
5551
|
/**
|
|
5497
5552
|
* Disallow number literals with zero fractions or dangling dots.
|
|
5498
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5553
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-zero-fractions.md
|
|
5499
5554
|
*/
|
|
5500
5555
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
5501
5556
|
/**
|
|
5502
5557
|
* Enforce proper case for numeric literals.
|
|
5503
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5558
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/number-literal-case.md
|
|
5504
5559
|
*/
|
|
5505
5560
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
5506
5561
|
/**
|
|
5507
5562
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
5508
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5563
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/numeric-separators-style.md
|
|
5509
5564
|
*/
|
|
5510
5565
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
5511
5566
|
/**
|
|
5512
5567
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
5513
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5568
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-add-event-listener.md
|
|
5514
5569
|
*/
|
|
5515
5570
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
5516
5571
|
/**
|
|
5517
5572
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
5518
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5573
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-find.md
|
|
5519
5574
|
*/
|
|
5520
5575
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
5521
5576
|
/**
|
|
5522
5577
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
5523
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5578
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat.md
|
|
5524
5579
|
*/
|
|
5525
5580
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
5526
5581
|
/**
|
|
5527
5582
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
5528
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5583
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat-map.md
|
|
5529
5584
|
*/
|
|
5530
5585
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
5531
5586
|
/**
|
|
5532
5587
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
5533
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5588
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-index-of.md
|
|
5534
5589
|
*/
|
|
5535
5590
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
5536
5591
|
/**
|
|
5537
5592
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
5538
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5593
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-some.md
|
|
5539
5594
|
*/
|
|
5540
5595
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
5541
5596
|
/**
|
|
5542
5597
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
5543
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5598
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-at.md
|
|
5544
5599
|
*/
|
|
5545
5600
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
5546
5601
|
/**
|
|
5547
5602
|
* Prefer `BigInt` literals over the constructor.
|
|
5548
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5603
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-bigint-literals.md
|
|
5549
5604
|
*/
|
|
5550
5605
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
5551
5606
|
/**
|
|
5552
5607
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
5553
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5608
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
5554
5609
|
*/
|
|
5555
5610
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
5556
5611
|
/**
|
|
5557
5612
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
5558
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5613
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-class-fields.md
|
|
5559
5614
|
*/
|
|
5560
5615
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
5561
5616
|
/**
|
|
5562
5617
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
5563
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5618
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-classlist-toggle.md
|
|
5564
5619
|
*/
|
|
5565
5620
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
5566
5621
|
/**
|
|
5567
5622
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
5568
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5623
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-code-point.md
|
|
5569
5624
|
*/
|
|
5570
5625
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
5571
5626
|
/**
|
|
5572
5627
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
5573
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5628
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-date-now.md
|
|
5574
5629
|
*/
|
|
5575
5630
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
5576
5631
|
/**
|
|
5577
5632
|
* Prefer default parameters over reassignment.
|
|
5578
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5633
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-default-parameters.md
|
|
5579
5634
|
*/
|
|
5580
5635
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
5581
5636
|
/**
|
|
5582
5637
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
5583
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5638
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-append.md
|
|
5584
5639
|
*/
|
|
5585
5640
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
5586
5641
|
/**
|
|
5587
5642
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
5588
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5643
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
5589
5644
|
*/
|
|
5590
5645
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
5591
5646
|
/**
|
|
5592
5647
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
5593
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5648
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-remove.md
|
|
5594
5649
|
*/
|
|
5595
5650
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
5596
5651
|
/**
|
|
5597
5652
|
* Prefer `.textContent` over `.innerText`.
|
|
5598
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5653
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
5599
5654
|
*/
|
|
5600
5655
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
5601
5656
|
/**
|
|
5602
5657
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
5603
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5658
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-event-target.md
|
|
5604
5659
|
*/
|
|
5605
5660
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
5606
5661
|
/**
|
|
5607
5662
|
* Prefer `export…from` when re-exporting.
|
|
5608
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5663
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-export-from.md
|
|
5609
5664
|
*/
|
|
5610
5665
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
5611
5666
|
/**
|
|
5612
5667
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
5613
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5668
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-global-this.md
|
|
5614
5669
|
*/
|
|
5615
5670
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
5616
5671
|
/**
|
|
5617
5672
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
5618
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5673
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-import-meta-properties.md
|
|
5619
5674
|
*/
|
|
5620
5675
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
5621
5676
|
/**
|
|
5622
5677
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
5623
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5678
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-includes.md
|
|
5624
5679
|
*/
|
|
5625
5680
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
5626
5681
|
/**
|
|
5627
5682
|
* Prefer reading a JSON file as a buffer.
|
|
5628
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5683
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
5629
5684
|
*/
|
|
5630
5685
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
5631
5686
|
/**
|
|
5632
5687
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
5633
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5688
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
5634
5689
|
*/
|
|
5635
5690
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
5636
5691
|
/**
|
|
5637
5692
|
* Prefer using a logical operator over a ternary.
|
|
5638
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5693
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
5639
5694
|
*/
|
|
5640
5695
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
5641
5696
|
/**
|
|
5642
5697
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
5643
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5698
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-min-max.md
|
|
5644
5699
|
*/
|
|
5645
5700
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
5646
5701
|
/**
|
|
5647
5702
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
5648
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5703
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-trunc.md
|
|
5649
5704
|
*/
|
|
5650
5705
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
5651
5706
|
/**
|
|
5652
5707
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
5653
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5708
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
5654
5709
|
*/
|
|
5655
5710
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
5656
5711
|
/**
|
|
5657
5712
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
5658
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5713
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-math-apis.md
|
|
5659
5714
|
*/
|
|
5660
5715
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
5661
5716
|
/**
|
|
5662
5717
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
5663
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5718
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-module.md
|
|
5664
5719
|
*/
|
|
5665
5720
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
5666
5721
|
/**
|
|
5667
5722
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
5668
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5723
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
5669
5724
|
*/
|
|
5670
5725
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
5671
5726
|
/**
|
|
5672
5727
|
* Prefer negative index over `.length - index` when possible.
|
|
5673
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5728
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-negative-index.md
|
|
5674
5729
|
*/
|
|
5675
5730
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
5676
5731
|
/**
|
|
5677
5732
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
5678
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5733
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-node-protocol.md
|
|
5679
5734
|
*/
|
|
5680
5735
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
5681
5736
|
/**
|
|
5682
5737
|
* Prefer `Number` static properties over global ones.
|
|
5683
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5738
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-number-properties.md
|
|
5684
5739
|
*/
|
|
5685
5740
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
5686
5741
|
/**
|
|
5687
5742
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
5688
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5743
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-object-from-entries.md
|
|
5689
5744
|
*/
|
|
5690
5745
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
5691
5746
|
/**
|
|
5692
5747
|
* Prefer omitting the `catch` binding parameter.
|
|
5693
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5748
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
5694
5749
|
*/
|
|
5695
5750
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
5696
5751
|
/**
|
|
5697
5752
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
5698
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5753
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-prototype-methods.md
|
|
5699
5754
|
*/
|
|
5700
5755
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
5701
5756
|
/**
|
|
5702
5757
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
5703
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5758
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-query-selector.md
|
|
5704
5759
|
*/
|
|
5705
5760
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
5706
5761
|
/**
|
|
5707
5762
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
5708
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5763
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-reflect-apply.md
|
|
5709
5764
|
*/
|
|
5710
5765
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
5711
5766
|
/**
|
|
5712
5767
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
5713
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5768
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-regexp-test.md
|
|
5714
5769
|
*/
|
|
5715
5770
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
5771
|
+
/**
|
|
5772
|
+
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
5773
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-response-static-json.md
|
|
5774
|
+
*/
|
|
5775
|
+
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>;
|
|
5716
5776
|
/**
|
|
5717
5777
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
5718
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5778
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-has.md
|
|
5719
5779
|
*/
|
|
5720
5780
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
5721
5781
|
/**
|
|
5722
5782
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
5723
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5783
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-size.md
|
|
5724
5784
|
*/
|
|
5725
5785
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
5726
5786
|
/**
|
|
5727
5787
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
5728
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5788
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-single-call.md
|
|
5729
5789
|
*/
|
|
5730
5790
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
5731
5791
|
/**
|
|
5732
5792
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
5733
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5793
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-spread.md
|
|
5734
5794
|
*/
|
|
5735
5795
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
5736
5796
|
/**
|
|
5737
5797
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
5738
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5798
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-raw.md
|
|
5739
5799
|
*/
|
|
5740
5800
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
5741
5801
|
/**
|
|
5742
5802
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
5743
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5803
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-replace-all.md
|
|
5744
5804
|
*/
|
|
5745
5805
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
5746
5806
|
/**
|
|
5747
5807
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
5748
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5808
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-slice.md
|
|
5749
5809
|
*/
|
|
5750
5810
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
5751
5811
|
/**
|
|
5752
5812
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
5753
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5813
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
5754
5814
|
*/
|
|
5755
5815
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
5756
5816
|
/**
|
|
5757
5817
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
5758
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5818
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
5759
5819
|
*/
|
|
5760
5820
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
5761
5821
|
/**
|
|
5762
5822
|
* Prefer using `structuredClone` to create a deep clone.
|
|
5763
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5823
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-structured-clone.md
|
|
5764
5824
|
*/
|
|
5765
5825
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
5766
5826
|
/**
|
|
5767
5827
|
* Prefer `switch` over multiple `else-if`.
|
|
5768
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5828
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-switch.md
|
|
5769
5829
|
*/
|
|
5770
5830
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
5771
5831
|
/**
|
|
5772
5832
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
5773
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5833
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-ternary.md
|
|
5774
5834
|
*/
|
|
5775
5835
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
5776
5836
|
/**
|
|
5777
5837
|
* Prefer top-level await over top-level promises and async function calls.
|
|
5778
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5838
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-top-level-await.md
|
|
5779
5839
|
*/
|
|
5780
5840
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
5781
5841
|
/**
|
|
5782
5842
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
5783
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5843
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-type-error.md
|
|
5784
5844
|
*/
|
|
5785
5845
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
5786
5846
|
/**
|
|
5787
5847
|
* Prevent abbreviations.
|
|
5788
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5848
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prevent-abbreviations.md
|
|
5789
5849
|
*/
|
|
5790
5850
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
5791
5851
|
/**
|
|
5792
5852
|
* Enforce consistent relative URL style.
|
|
5793
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5853
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/relative-url-style.md
|
|
5794
5854
|
*/
|
|
5795
5855
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
5796
5856
|
/**
|
|
5797
5857
|
* Enforce using the separator argument with `Array#join()`.
|
|
5798
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5858
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-array-join-separator.md
|
|
5799
5859
|
*/
|
|
5800
5860
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
5801
5861
|
/**
|
|
5802
5862
|
* Require non-empty module attributes for imports and exports
|
|
5803
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5863
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-attributes.md
|
|
5804
5864
|
*/
|
|
5805
5865
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
5806
5866
|
/**
|
|
5807
5867
|
* Require non-empty specifier list in import and export statements.
|
|
5808
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5868
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-specifiers.md
|
|
5809
5869
|
*/
|
|
5810
5870
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
5811
5871
|
/**
|
|
5812
5872
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
5813
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5873
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
5814
5874
|
*/
|
|
5815
5875
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
5816
5876
|
/**
|
|
5817
5877
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
5818
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5878
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-post-message-target-origin.md
|
|
5819
5879
|
*/
|
|
5820
5880
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
5821
5881
|
/**
|
|
5822
5882
|
* Enforce better string content.
|
|
5823
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5883
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/string-content.md
|
|
5824
5884
|
*/
|
|
5825
5885
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
5826
5886
|
/**
|
|
5827
5887
|
* Enforce consistent brace style for `case` clauses.
|
|
5828
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5888
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/switch-case-braces.md
|
|
5829
5889
|
*/
|
|
5830
5890
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
5831
5891
|
/**
|
|
5832
5892
|
* Fix whitespace-insensitive template indentation.
|
|
5833
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5893
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/template-indent.md
|
|
5834
5894
|
*/
|
|
5835
5895
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
5836
5896
|
/**
|
|
5837
5897
|
* Enforce consistent case for text encoding identifiers.
|
|
5838
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5898
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/text-encoding-identifier-case.md
|
|
5839
5899
|
*/
|
|
5840
|
-
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<
|
|
5900
|
+
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>;
|
|
5841
5901
|
/**
|
|
5842
5902
|
* Require `new` when creating an error.
|
|
5843
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
5903
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/throw-new-error.md
|
|
5844
5904
|
*/
|
|
5845
5905
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
5846
5906
|
/**
|
|
@@ -7258,6 +7318,13 @@ type AstroJsxA11YScope = [] | [{
|
|
|
7258
7318
|
type AstroJsxA11YTabindexNoPositive = [] | [{
|
|
7259
7319
|
[k: string]: unknown | undefined;
|
|
7260
7320
|
}];
|
|
7321
|
+
// ----- astro/no-unsafe-inline-scripts -----
|
|
7322
|
+
type AstroNoUnsafeInlineScripts = [] | [{
|
|
7323
|
+
allowDefineVars?: boolean;
|
|
7324
|
+
allowModuleScripts?: boolean;
|
|
7325
|
+
allowNonExecutingTypes?: string[];
|
|
7326
|
+
allowNonce?: boolean;
|
|
7327
|
+
}];
|
|
7261
7328
|
// ----- astro/prefer-split-class-list -----
|
|
7262
7329
|
type AstroPreferSplitClassList = [] | [{
|
|
7263
7330
|
splitLiteral?: boolean;
|
|
@@ -8015,6 +8082,18 @@ type JsdocTextEscaping = [] | [{
|
|
|
8015
8082
|
escapeHTML?: boolean;
|
|
8016
8083
|
escapeMarkdown?: boolean;
|
|
8017
8084
|
}];
|
|
8085
|
+
// ----- jsdoc/ts-method-signature-style -----
|
|
8086
|
+
type JsdocTsMethodSignatureStyle = [] | [("method" | "property")] | [("method" | "property"), {
|
|
8087
|
+
enableFixer?: boolean;
|
|
8088
|
+
}];
|
|
8089
|
+
// ----- jsdoc/ts-no-unnecessary-template-expression -----
|
|
8090
|
+
type JsdocTsNoUnnecessaryTemplateExpression = [] | [{
|
|
8091
|
+
enableFixer?: boolean;
|
|
8092
|
+
}];
|
|
8093
|
+
// ----- jsdoc/ts-prefer-function-type -----
|
|
8094
|
+
type JsdocTsPreferFunctionType = [] | [{
|
|
8095
|
+
enableFixer?: boolean;
|
|
8096
|
+
}];
|
|
8018
8097
|
// ----- jsdoc/type-formatting -----
|
|
8019
8098
|
type JsdocTypeFormatting = [] | [{
|
|
8020
8099
|
arrayBrackets?: ("angle" | "square");
|
|
@@ -11746,7 +11825,6 @@ type ReactXNoForbiddenProps = [] | [{
|
|
|
11746
11825
|
includedNodes?: string[];
|
|
11747
11826
|
prop: string;
|
|
11748
11827
|
})[];
|
|
11749
|
-
[k: string]: unknown | undefined;
|
|
11750
11828
|
}];
|
|
11751
11829
|
// ----- react-x/no-useless-fragment -----
|
|
11752
11830
|
type ReactXNoUselessFragment = [] | [{
|
|
@@ -12295,6 +12373,10 @@ type UnicornTemplateIndent = [] | [{
|
|
|
12295
12373
|
selectors?: string[];
|
|
12296
12374
|
comments?: string[];
|
|
12297
12375
|
}];
|
|
12376
|
+
// ----- unicorn/text-encoding-identifier-case -----
|
|
12377
|
+
type UnicornTextEncodingIdentifierCase = [] | [{
|
|
12378
|
+
withDash?: boolean;
|
|
12379
|
+
}];
|
|
12298
12380
|
// ----- unused-imports/no-unused-imports -----
|
|
12299
12381
|
type UnusedImportsNoUnusedImports = [] | [(("all" | "local") | {
|
|
12300
12382
|
args?: ("all" | "after-used" | "none");
|
|
@@ -12555,192 +12637,215 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
12555
12637
|
onlyEquality?: boolean;
|
|
12556
12638
|
}];
|
|
12557
12639
|
// Names of all the configs
|
|
12558
|
-
type ConfigNames = '
|
|
12640
|
+
type ConfigNames = 'nicksp/astro/setup' | 'nicksp/astro/rules' | 'nicksp/astro/script/javascript' | 'nicksp/astro/script/typescript' | 'nicksp/astro/disables' | 'nicksp/comments/recommended' | 'nicksp/comments/rules' | 'nicksp/prettier/setup' | 'nicksp/prettier/astro' | 'nicksp/prettier/rules' | 'nicksp/imports/rules' | 'nicksp/javascript/recommended' | 'nicksp/javascript/setup' | 'nicksp/javascript/rules' | 'nicksp/jsx/setup' | 'nicksp/jsdoc/rules' | 'nicksp/jsonc/setup' | 'nicksp/jsonc/rules' | 'nicksp/node/rules' | 'nicksp/sort/imports' | 'nicksp/nextjs/setup' | 'nicksp/nextjs/rules' | 'nicksp/react/setup' | 'nicksp/react/rules' | 'nicksp/sort/package-json' | 'nicksp/sort/tsconfig' | 'nicksp/test/setup' | 'nicksp/test/rules' | 'nicksp/regexp/rules' | 'nicksp/typescript/setup' | 'nicksp/typescript/parser' | 'nicksp/typescript/recommended' | 'nicksp/typescript/rules' | 'nicksp/typescript/dts-rules' | 'nicksp/typescript/cjs-rules' | 'nicksp/unicorn/unopinionated' | 'nicksp/unicorn/rules' | 'nicksp/yaml/setup' | 'nicksp/yaml/rules' | 'nicksp/yaml/pnpm-workspace' | 'builtin-rules';
|
|
12559
12641
|
//#endregion
|
|
12560
12642
|
//#region src/types.d.ts
|
|
12561
12643
|
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
12562
12644
|
/**
|
|
12563
|
-
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
12564
|
-
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
12565
|
-
* many plugins still lack proper type definitions.
|
|
12566
|
-
*/
|
|
12567
|
-
type Config = Omit<Linter.Config,
|
|
12568
|
-
/**
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12645
|
+
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
12646
|
+
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
12647
|
+
* many plugins still lack proper type definitions.
|
|
12648
|
+
*/
|
|
12649
|
+
type Config = Omit<Linter.Config, 'plugins' | 'rules'> & {
|
|
12650
|
+
/**
|
|
12651
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
12652
|
+
* When `files` is specified, these plugins are only available to the matching files.
|
|
12653
|
+
*
|
|
12654
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
12655
|
+
*/
|
|
12574
12656
|
plugins?: Record<string, any>;
|
|
12575
12657
|
/**
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12658
|
+
* An object containing the configured rules. When `files` or `ignores` are
|
|
12659
|
+
* specified, these rule configurations are only available to the matching files.
|
|
12660
|
+
*/
|
|
12579
12661
|
rules?: Rules;
|
|
12580
12662
|
};
|
|
12581
12663
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
12582
|
-
|
|
12664
|
+
interface OptionsFiles {
|
|
12583
12665
|
/**
|
|
12584
|
-
|
|
12585
|
-
|
|
12666
|
+
* Override the `files` option to provide custom globs.
|
|
12667
|
+
*/
|
|
12586
12668
|
files?: string[];
|
|
12587
|
-
}
|
|
12669
|
+
}
|
|
12588
12670
|
type OptionsJSXA11y = {} & OptionsOverrides;
|
|
12589
|
-
|
|
12590
|
-
/**
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12671
|
+
interface OptionsJSX {
|
|
12672
|
+
/**
|
|
12673
|
+
* Enable JSX accessibility rules.
|
|
12674
|
+
*
|
|
12675
|
+
* Requires installing:
|
|
12676
|
+
* - `eslint-plugin-jsx-a11y`
|
|
12677
|
+
*
|
|
12678
|
+
* Can be a boolean or an object for custom options and overrides.
|
|
12679
|
+
* @default false
|
|
12680
|
+
*/
|
|
12599
12681
|
a11y?: boolean | OptionsJSXA11y;
|
|
12600
|
-
}
|
|
12601
|
-
type
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
type
|
|
12682
|
+
}
|
|
12683
|
+
type OptionsTypescript = OptionsTypeScriptWithTypes & OptionsOverrides;
|
|
12684
|
+
interface OptionsTypeScriptWithTypes {
|
|
12685
|
+
/**
|
|
12686
|
+
* When this options is provided, type aware rules will be enabled.
|
|
12687
|
+
* @see https://typescript-eslint.io/getting-started/typed-linting/
|
|
12688
|
+
* @default true
|
|
12689
|
+
*/
|
|
12690
|
+
typeAware?: boolean;
|
|
12691
|
+
/**
|
|
12692
|
+
* Glob patterns for files that should be type aware.
|
|
12693
|
+
* @default ['**\/*.{ts,tsx}']
|
|
12694
|
+
*/
|
|
12695
|
+
filesTypeAware?: string[];
|
|
12696
|
+
/**
|
|
12697
|
+
* Glob patterns for files that should not be type aware.
|
|
12698
|
+
* @default ['**\/*.md\/**', '**\/*.astro/*.ts']
|
|
12699
|
+
*/
|
|
12700
|
+
ignoresTypeAware?: string[];
|
|
12701
|
+
/**
|
|
12702
|
+
* Override type aware rules.
|
|
12703
|
+
*/
|
|
12704
|
+
overridesTypeAware?: Config['rules'];
|
|
12705
|
+
}
|
|
12706
|
+
interface OptionsOverrides {
|
|
12707
|
+
overrides?: Config['rules'];
|
|
12708
|
+
}
|
|
12709
|
+
interface OptionsPrettierOptions {
|
|
12605
12710
|
options?: Options$1;
|
|
12606
|
-
}
|
|
12607
|
-
|
|
12711
|
+
}
|
|
12712
|
+
interface OptionsProjectType {
|
|
12608
12713
|
/**
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
type?:
|
|
12614
|
-
}
|
|
12615
|
-
|
|
12714
|
+
* Type of the project. `lib` will enable more strict rules for libraries.
|
|
12715
|
+
*
|
|
12716
|
+
* @default 'app'
|
|
12717
|
+
*/
|
|
12718
|
+
type?: 'app' | 'lib';
|
|
12719
|
+
}
|
|
12720
|
+
interface OptionsRegExp {
|
|
12616
12721
|
/**
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
level?:
|
|
12620
|
-
}
|
|
12621
|
-
|
|
12722
|
+
* Override rulelevels
|
|
12723
|
+
*/
|
|
12724
|
+
level?: 'error' | 'warn';
|
|
12725
|
+
}
|
|
12726
|
+
interface OptionsIsInEditor {
|
|
12622
12727
|
isInEditor?: boolean;
|
|
12623
|
-
}
|
|
12624
|
-
|
|
12728
|
+
}
|
|
12729
|
+
interface OptionsEnableAstro {
|
|
12625
12730
|
enableAstro?: boolean;
|
|
12626
|
-
}
|
|
12731
|
+
}
|
|
12627
12732
|
type Options = {
|
|
12628
12733
|
/**
|
|
12629
|
-
|
|
12630
|
-
|
|
12734
|
+
* Core rules. Can't be disabled.
|
|
12735
|
+
*/
|
|
12631
12736
|
javascript?: OptionsOverrides;
|
|
12632
12737
|
/**
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
typescript?: boolean |
|
|
12640
|
-
/**
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12738
|
+
* Enable TypeScript support.
|
|
12739
|
+
*
|
|
12740
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
12741
|
+
*
|
|
12742
|
+
* @default auto-detect based on the dependencies
|
|
12743
|
+
*/
|
|
12744
|
+
typescript?: boolean | OptionsTypescript;
|
|
12745
|
+
/**
|
|
12746
|
+
* Enable JSX related rules.
|
|
12747
|
+
*
|
|
12748
|
+
* Passing an object to enable JSX accessibility rules.
|
|
12749
|
+
*
|
|
12750
|
+
* @default true
|
|
12751
|
+
*/
|
|
12647
12752
|
jsx?: boolean | OptionsJSX;
|
|
12648
12753
|
/**
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12754
|
+
* Enable test support.
|
|
12755
|
+
*
|
|
12756
|
+
* @default true
|
|
12757
|
+
*/
|
|
12653
12758
|
test?: boolean | OptionsOverrides;
|
|
12654
12759
|
/**
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12658
|
-
|
|
12760
|
+
* Enable YAML support.
|
|
12761
|
+
*
|
|
12762
|
+
* @default true
|
|
12763
|
+
*/
|
|
12659
12764
|
yaml?: boolean | OptionsOverrides;
|
|
12660
12765
|
/**
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12766
|
+
* Enable Prettier support.
|
|
12767
|
+
*
|
|
12768
|
+
* By default it's controlled by our own config.
|
|
12769
|
+
*
|
|
12770
|
+
* @see https://prettier.io/docs/
|
|
12771
|
+
* @default true
|
|
12772
|
+
*/
|
|
12668
12773
|
prettier?: boolean | OptionsPrettierOptions;
|
|
12669
12774
|
/**
|
|
12670
|
-
|
|
12671
|
-
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12775
|
+
* Enable regexp rules.
|
|
12776
|
+
*
|
|
12777
|
+
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
|
|
12778
|
+
* @default true
|
|
12779
|
+
*/
|
|
12675
12780
|
regexp?: boolean | (OptionsRegExp & OptionsOverrides);
|
|
12676
12781
|
/**
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
|
|
12681
|
-
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12782
|
+
* Enable Astro support.
|
|
12783
|
+
*
|
|
12784
|
+
* Requires installing:
|
|
12785
|
+
* - `eslint-plugin-astro`
|
|
12786
|
+
*
|
|
12787
|
+
* Requires installing for formatting .astro:
|
|
12788
|
+
* - `prettier-plugin-astro`
|
|
12789
|
+
*
|
|
12790
|
+
* @default false
|
|
12791
|
+
*/
|
|
12687
12792
|
astro?: boolean | OptionsOverrides;
|
|
12688
12793
|
/**
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
|
|
12697
|
-
|
|
12794
|
+
* Enable React rules.
|
|
12795
|
+
*
|
|
12796
|
+
* Requires installing:
|
|
12797
|
+
* - `@eslint-react/eslint-plugin`
|
|
12798
|
+
* - `eslint-plugin-react-hooks`
|
|
12799
|
+
* - `eslint-plugin-react-refresh`
|
|
12800
|
+
*
|
|
12801
|
+
* @default false
|
|
12802
|
+
*/
|
|
12698
12803
|
react?: boolean | OptionsOverrides;
|
|
12699
12804
|
/**
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
|
|
12805
|
+
* Enable Nextjs rules.
|
|
12806
|
+
*
|
|
12807
|
+
* Requires installing:
|
|
12808
|
+
* - `@next/eslint-plugin-next`
|
|
12809
|
+
*
|
|
12810
|
+
* @default false
|
|
12811
|
+
*/
|
|
12707
12812
|
nextjs?: boolean | OptionsOverrides;
|
|
12708
12813
|
} & OptionsProjectType;
|
|
12709
12814
|
//#endregion
|
|
12710
12815
|
//#region src/factory.d.ts
|
|
12711
12816
|
/**
|
|
12712
|
-
* Construct an array of ESLint flat config items.
|
|
12713
|
-
*
|
|
12714
|
-
* @param options - The options for generating the ESLint configurations.
|
|
12715
|
-
* @param userConfigs - The user configurations to be merged with the generated configurations.
|
|
12716
|
-
* @returns The merged ESLint configurations.
|
|
12717
|
-
*/
|
|
12718
|
-
declare function defineConfig(options?: Options & Omit<Config,
|
|
12817
|
+
* Construct an array of ESLint flat config items.
|
|
12818
|
+
*
|
|
12819
|
+
* @param options - The options for generating the ESLint configurations.
|
|
12820
|
+
* @param userConfigs - The user configurations to be merged with the generated configurations.
|
|
12821
|
+
* @returns The merged ESLint configurations.
|
|
12822
|
+
*/
|
|
12823
|
+
declare function defineConfig(options?: Options & Omit<Config, 'files'>, ...userConfigs: Awaitable<Arrayable<Config> | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<Config, ConfigNames>;
|
|
12719
12824
|
//#endregion
|
|
12720
12825
|
//#region src/configs/astro.d.ts
|
|
12721
12826
|
declare function astro(options?: OptionsOverrides & OptionsFiles): Promise<Config[]>;
|
|
12722
12827
|
//#endregion
|
|
12723
12828
|
//#region src/configs/comments.d.ts
|
|
12724
|
-
declare function comments():
|
|
12829
|
+
declare function comments(): Config[];
|
|
12725
12830
|
//#endregion
|
|
12726
12831
|
//#region src/configs/disables.d.ts
|
|
12727
|
-
declare function disables():
|
|
12832
|
+
declare function disables(): Config[];
|
|
12728
12833
|
//#endregion
|
|
12729
12834
|
//#region src/configs/ignores.d.ts
|
|
12730
|
-
declare function ignores(userIgnores?: string[]):
|
|
12835
|
+
declare function ignores(userIgnores?: string[]): Config[];
|
|
12731
12836
|
//#endregion
|
|
12732
12837
|
//#region src/configs/imports.d.ts
|
|
12733
|
-
declare function imports():
|
|
12838
|
+
declare function imports(): Config[];
|
|
12734
12839
|
//#endregion
|
|
12735
12840
|
//#region src/configs/javascript.d.ts
|
|
12736
12841
|
declare const restrictedSyntaxJs: AST_NODE_TYPES[];
|
|
12737
|
-
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides):
|
|
12842
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): Config[];
|
|
12738
12843
|
//#endregion
|
|
12739
12844
|
//#region src/configs/jsdoc.d.ts
|
|
12740
|
-
declare function jsdoc():
|
|
12845
|
+
declare function jsdoc(): Config[];
|
|
12741
12846
|
//#endregion
|
|
12742
12847
|
//#region src/configs/jsonc.d.ts
|
|
12743
|
-
declare function jsonc():
|
|
12848
|
+
declare function jsonc(): Config[];
|
|
12744
12849
|
//#endregion
|
|
12745
12850
|
//#region src/configs/jsx.d.ts
|
|
12746
12851
|
declare function jsx(options?: OptionsJSX): Promise<Config[]>;
|
|
@@ -12749,45 +12854,46 @@ declare function jsx(options?: OptionsJSX): Promise<Config[]>;
|
|
|
12749
12854
|
declare function nextjs(options?: OptionsOverrides & OptionsFiles): Promise<Config[]>;
|
|
12750
12855
|
//#endregion
|
|
12751
12856
|
//#region src/configs/node.d.ts
|
|
12752
|
-
declare function node():
|
|
12857
|
+
declare function node(): Config[];
|
|
12753
12858
|
//#endregion
|
|
12754
12859
|
//#region src/configs/prettier.d.ts
|
|
12755
12860
|
declare function prettier(options?: OptionsPrettierOptions & OptionsOverrides & OptionsEnableAstro): Promise<Config[]>;
|
|
12756
12861
|
//#endregion
|
|
12757
12862
|
//#region src/configs/react.d.ts
|
|
12758
|
-
declare function react(options?:
|
|
12863
|
+
declare function react(options?: OptionsTypescript & OptionsFiles): Promise<Config[]>;
|
|
12759
12864
|
//#endregion
|
|
12760
12865
|
//#region src/configs/regexp.d.ts
|
|
12761
|
-
declare function regexp(options?: OptionsRegExp & OptionsOverrides):
|
|
12866
|
+
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Config[];
|
|
12762
12867
|
//#endregion
|
|
12763
12868
|
//#region src/configs/sort.d.ts
|
|
12764
12869
|
/**
|
|
12765
|
-
* Sort package.json
|
|
12766
|
-
*/
|
|
12767
|
-
declare function sortPackageJson():
|
|
12870
|
+
* Sort package.json
|
|
12871
|
+
*/
|
|
12872
|
+
declare function sortPackageJson(): Config[];
|
|
12768
12873
|
/**
|
|
12769
|
-
* Sort tsconfig.json
|
|
12770
|
-
*/
|
|
12874
|
+
* Sort tsconfig.json
|
|
12875
|
+
*/
|
|
12771
12876
|
declare function sortTsconfig(): Config[];
|
|
12772
12877
|
/**
|
|
12773
|
-
* Perfectionist plugin for props and items sorting.
|
|
12774
|
-
*
|
|
12775
|
-
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
12776
|
-
*/
|
|
12878
|
+
* Perfectionist plugin for props and items sorting.
|
|
12879
|
+
*
|
|
12880
|
+
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
12881
|
+
*/
|
|
12777
12882
|
declare function sortImports(): Config[];
|
|
12778
12883
|
//#endregion
|
|
12779
12884
|
//#region src/configs/test.d.ts
|
|
12780
|
-
declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides):
|
|
12885
|
+
declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverrides): Config[];
|
|
12781
12886
|
//#endregion
|
|
12782
12887
|
//#region src/configs/typescript.d.ts
|
|
12783
12888
|
declare const typescriptRecommended: Config[];
|
|
12784
|
-
declare
|
|
12889
|
+
declare const typescriptTypeCheckedRecommended: Config[];
|
|
12890
|
+
declare function typescript(options?: OptionsTypescript & OptionsFiles & OptionsProjectType): Config[];
|
|
12785
12891
|
//#endregion
|
|
12786
12892
|
//#region src/configs/unicorn.d.ts
|
|
12787
|
-
declare function unicorn(options?: OptionsOverrides):
|
|
12893
|
+
declare function unicorn(options?: OptionsOverrides): Config[];
|
|
12788
12894
|
//#endregion
|
|
12789
12895
|
//#region src/configs/yaml.d.ts
|
|
12790
|
-
declare function yaml(options?: OptionsOverrides & OptionsFiles):
|
|
12896
|
+
declare function yaml(options?: OptionsOverrides & OptionsFiles): Config[];
|
|
12791
12897
|
//#endregion
|
|
12792
12898
|
//#region src/globs.d.ts
|
|
12793
12899
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -12799,6 +12905,7 @@ declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
|
12799
12905
|
declare const GLOB_JSON = "**/*.json";
|
|
12800
12906
|
declare const GLOB_JSON5 = "**/*.json5";
|
|
12801
12907
|
declare const GLOB_JSONC = "**/*.jsonc";
|
|
12908
|
+
declare const GLOB_MARKDOWN = "**/*.md";
|
|
12802
12909
|
declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
12803
12910
|
declare const GLOB_ASTRO = "**/*.astro";
|
|
12804
12911
|
declare const GLOB_ASTRO_JS = "**/*.astro/*.js";
|
|
@@ -12812,12 +12919,12 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
12812
12919
|
//#region src/utils.d.ts
|
|
12813
12920
|
declare function isPackageInScope(name: string): boolean;
|
|
12814
12921
|
declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
|
|
12815
|
-
declare function interopDefault<T>(
|
|
12922
|
+
declare function interopDefault<T>(module: Awaitable<T>): Promise<T extends {
|
|
12816
12923
|
default: infer U;
|
|
12817
12924
|
} ? U : T>;
|
|
12818
12925
|
declare function isInEditorEnv(): boolean;
|
|
12819
12926
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
12820
12927
|
declare function resolveSubOptions<K extends keyof Options>(options: Options, key: K): ResolvedOptions<Options[K]>;
|
|
12821
|
-
declare function getOverrides
|
|
12928
|
+
declare function getOverrides(options: Options, key: keyof Options): Partial<Linter.RulesRecord & RuleOptions>;
|
|
12822
12929
|
//#endregion
|
|
12823
|
-
export { Config, type ConfigNames, GLOB_ASTRO, GLOB_ASTRO_JS, GLOB_ASTRO_TS, GLOB_DIST, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LOCKFILE, GLOB_NODE_MODULES, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, Options, OptionsEnableAstro, OptionsFiles, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPrettierOptions, OptionsProjectType, OptionsRegExp, ResolvedOptions, Rules, astro, comments, defineConfig as default, defineConfig, disables, ensurePackages, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, nextjs, node, prettier, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, test, typescript, typescriptRecommended, unicorn, yaml };
|
|
12930
|
+
export { Config, type ConfigNames, GLOB_ASTRO, GLOB_ASTRO_JS, GLOB_ASTRO_TS, GLOB_DIST, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_YAML, Options, OptionsEnableAstro, OptionsFiles, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPrettierOptions, OptionsProjectType, OptionsRegExp, OptionsTypeScriptWithTypes, OptionsTypescript, ResolvedOptions, Rules, astro, comments, defineConfig as default, defineConfig, disables, ensurePackages, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, nextjs, node, prettier, react, regexp, resolveSubOptions, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, test, typescript, typescriptRecommended, typescriptTypeCheckedRecommended, unicorn, yaml };
|