@luxass/eslint-config 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +197 -141
- package/dist/index.js +3 -7
- package/package.json +13 -13
package/dist/index.d.ts
CHANGED
|
@@ -1276,7 +1276,7 @@ interface RuleOptions {
|
|
|
1276
1276
|
* Reports invalid alignment of JSDoc block asterisks.
|
|
1277
1277
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-alignment.md#repos-sticky-header
|
|
1278
1278
|
*/
|
|
1279
|
-
'jsdoc/check-alignment'?: Linter.RuleEntry<
|
|
1279
|
+
'jsdoc/check-alignment'?: Linter.RuleEntry<JsdocCheckAlignment>;
|
|
1280
1280
|
/**
|
|
1281
1281
|
* Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
|
|
1282
1282
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-examples.md#repos-sticky-header
|
|
@@ -1547,6 +1547,11 @@ interface RuleOptions {
|
|
|
1547
1547
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/text-escaping.md#repos-sticky-header
|
|
1548
1548
|
*/
|
|
1549
1549
|
'jsdoc/text-escaping'?: Linter.RuleEntry<JsdocTextEscaping>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Formats JSDoc type values.
|
|
1552
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/type-formatting.md#repos-sticky-header
|
|
1553
|
+
*/
|
|
1554
|
+
'jsdoc/type-formatting'?: Linter.RuleEntry<JsdocTypeFormatting>;
|
|
1550
1555
|
/**
|
|
1551
1556
|
* Requires all types to be valid JSDoc or Closure compiler types without syntax errors.
|
|
1552
1557
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md#repos-sticky-header
|
|
@@ -3280,6 +3285,11 @@ interface RuleOptions {
|
|
|
3280
3285
|
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
3281
3286
|
*/
|
|
3282
3287
|
'prefer-template'?: Linter.RuleEntry<[]>;
|
|
3288
|
+
/**
|
|
3289
|
+
* Disallow losing originally caught error when re-throwing custom errors
|
|
3290
|
+
* @see https://eslint.org/docs/latest/rules/preserve-caught-error
|
|
3291
|
+
*/
|
|
3292
|
+
'preserve-caught-error'?: Linter.RuleEntry<PreserveCaughtError>;
|
|
3283
3293
|
/**
|
|
3284
3294
|
* Require quotes around object literal property names
|
|
3285
3295
|
* @see https://eslint.org/docs/latest/rules/quote-props
|
|
@@ -6004,690 +6014,710 @@ interface RuleOptions {
|
|
|
6004
6014
|
'unicode-bom'?: Linter.RuleEntry<UnicodeBom>;
|
|
6005
6015
|
/**
|
|
6006
6016
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
6007
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6017
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/better-regex.md
|
|
6008
6018
|
*/
|
|
6009
6019
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>;
|
|
6010
6020
|
/**
|
|
6011
6021
|
* Enforce a specific parameter name in catch clauses.
|
|
6012
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6022
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/catch-error-name.md
|
|
6013
6023
|
*/
|
|
6014
6024
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>;
|
|
6015
6025
|
/**
|
|
6016
6026
|
* Enforce consistent assertion style with `node:assert`.
|
|
6017
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6027
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-assert.md
|
|
6018
6028
|
*/
|
|
6019
6029
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>;
|
|
6020
6030
|
/**
|
|
6021
6031
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
6022
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6032
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-date-clone.md
|
|
6023
6033
|
*/
|
|
6024
6034
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>;
|
|
6025
6035
|
/**
|
|
6026
6036
|
* Use destructured variables over properties.
|
|
6027
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6037
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-destructuring.md
|
|
6028
6038
|
*/
|
|
6029
6039
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>;
|
|
6030
6040
|
/**
|
|
6031
6041
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
6032
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6042
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-empty-array-spread.md
|
|
6033
6043
|
*/
|
|
6034
6044
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>;
|
|
6035
6045
|
/**
|
|
6036
6046
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
6037
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6047
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-existence-index-check.md
|
|
6038
6048
|
*/
|
|
6039
6049
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>;
|
|
6040
6050
|
/**
|
|
6041
6051
|
* Move function definitions to the highest possible scope.
|
|
6042
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6052
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/consistent-function-scoping.md
|
|
6043
6053
|
*/
|
|
6044
6054
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>;
|
|
6045
6055
|
/**
|
|
6046
6056
|
* Enforce correct `Error` subclassing.
|
|
6047
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6057
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/custom-error-definition.md
|
|
6048
6058
|
*/
|
|
6049
6059
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>;
|
|
6050
6060
|
/**
|
|
6051
6061
|
* Enforce no spaces between braces.
|
|
6052
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6062
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/empty-brace-spaces.md
|
|
6053
6063
|
*/
|
|
6054
6064
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>;
|
|
6055
6065
|
/**
|
|
6056
6066
|
* Enforce passing a `message` value when creating a built-in error.
|
|
6057
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6067
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/error-message.md
|
|
6058
6068
|
*/
|
|
6059
6069
|
'unicorn/error-message'?: Linter.RuleEntry<[]>;
|
|
6060
6070
|
/**
|
|
6061
6071
|
* Require escape sequences to use uppercase or lowercase values.
|
|
6062
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6072
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/escape-case.md
|
|
6063
6073
|
*/
|
|
6064
6074
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>;
|
|
6065
6075
|
/**
|
|
6066
6076
|
* Add expiration conditions to TODO comments.
|
|
6067
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6077
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/expiring-todo-comments.md
|
|
6068
6078
|
*/
|
|
6069
6079
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>;
|
|
6070
6080
|
/**
|
|
6071
6081
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
6072
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6082
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/explicit-length-check.md
|
|
6073
6083
|
*/
|
|
6074
6084
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>;
|
|
6075
6085
|
/**
|
|
6076
6086
|
* Enforce a case style for filenames.
|
|
6077
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6087
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/filename-case.md
|
|
6078
6088
|
*/
|
|
6079
6089
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>;
|
|
6080
6090
|
/**
|
|
6081
6091
|
* Enforce specific import styles per module.
|
|
6082
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6092
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/import-style.md
|
|
6083
6093
|
*/
|
|
6084
6094
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>;
|
|
6085
6095
|
/**
|
|
6086
6096
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
6087
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6097
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/new-for-builtins.md
|
|
6088
6098
|
*/
|
|
6089
6099
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>;
|
|
6090
6100
|
/**
|
|
6091
6101
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
6092
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6102
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-abusive-eslint-disable.md
|
|
6093
6103
|
*/
|
|
6094
6104
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>;
|
|
6095
6105
|
/**
|
|
6096
6106
|
* Disallow recursive access to `this` within getters and setters.
|
|
6097
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6107
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-accessor-recursion.md
|
|
6098
6108
|
*/
|
|
6099
6109
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>;
|
|
6100
6110
|
/**
|
|
6101
6111
|
* Disallow anonymous functions and classes as the default export.
|
|
6102
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6112
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-anonymous-default-export.md
|
|
6103
6113
|
*/
|
|
6104
6114
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>;
|
|
6105
6115
|
/**
|
|
6106
6116
|
* Prevent passing a function reference directly to iterator methods.
|
|
6107
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6117
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-callback-reference.md
|
|
6108
6118
|
*/
|
|
6109
6119
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>;
|
|
6110
6120
|
/**
|
|
6111
6121
|
* Prefer `for…of` over the `forEach` method.
|
|
6112
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6122
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-for-each.md
|
|
6113
6123
|
*/
|
|
6114
6124
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>;
|
|
6115
6125
|
/**
|
|
6116
6126
|
* Disallow using the `this` argument in array methods.
|
|
6117
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6127
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-method-this-argument.md
|
|
6118
6128
|
*/
|
|
6119
6129
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>;
|
|
6120
6130
|
/**
|
|
6121
6131
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
6122
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6132
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-array-push-push
|
|
6123
6133
|
* @deprecated
|
|
6124
6134
|
*/
|
|
6125
6135
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>;
|
|
6126
6136
|
/**
|
|
6127
6137
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
6128
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6138
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-reduce.md
|
|
6129
6139
|
*/
|
|
6130
6140
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>;
|
|
6131
6141
|
/**
|
|
6132
6142
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
6133
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6143
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-reverse.md
|
|
6134
6144
|
*/
|
|
6135
6145
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>;
|
|
6146
|
+
/**
|
|
6147
|
+
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
6148
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-array-sort.md
|
|
6149
|
+
*/
|
|
6150
|
+
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>;
|
|
6136
6151
|
/**
|
|
6137
6152
|
* Disallow member access from await expression.
|
|
6138
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6153
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-await-expression-member.md
|
|
6139
6154
|
*/
|
|
6140
6155
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>;
|
|
6141
6156
|
/**
|
|
6142
6157
|
* Disallow using `await` in `Promise` method parameters.
|
|
6143
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6158
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-await-in-promise-methods.md
|
|
6144
6159
|
*/
|
|
6145
6160
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6146
6161
|
/**
|
|
6147
6162
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
6148
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6163
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-console-spaces.md
|
|
6149
6164
|
*/
|
|
6150
6165
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>;
|
|
6151
6166
|
/**
|
|
6152
6167
|
* Do not use `document.cookie` directly.
|
|
6153
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6168
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-document-cookie.md
|
|
6154
6169
|
*/
|
|
6155
6170
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>;
|
|
6156
6171
|
/**
|
|
6157
6172
|
* Disallow empty files.
|
|
6158
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6173
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-empty-file.md
|
|
6159
6174
|
*/
|
|
6160
6175
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>;
|
|
6161
6176
|
/**
|
|
6162
6177
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
6163
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6178
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-for-loop.md
|
|
6164
6179
|
*/
|
|
6165
6180
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>;
|
|
6166
6181
|
/**
|
|
6167
6182
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
6168
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6183
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-hex-escape.md
|
|
6169
6184
|
*/
|
|
6170
6185
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>;
|
|
6171
6186
|
/**
|
|
6172
6187
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
6173
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6188
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-instanceof-array
|
|
6174
6189
|
* @deprecated
|
|
6175
6190
|
*/
|
|
6176
6191
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>;
|
|
6177
6192
|
/**
|
|
6178
6193
|
* Disallow `instanceof` with built-in objects
|
|
6179
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6194
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-instanceof-builtins.md
|
|
6180
6195
|
*/
|
|
6181
6196
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>;
|
|
6182
6197
|
/**
|
|
6183
6198
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
6184
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6199
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-invalid-fetch-options.md
|
|
6185
6200
|
*/
|
|
6186
6201
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>;
|
|
6187
6202
|
/**
|
|
6188
6203
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
6189
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6204
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-invalid-remove-event-listener.md
|
|
6190
6205
|
*/
|
|
6191
6206
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>;
|
|
6192
6207
|
/**
|
|
6193
6208
|
* Disallow identifiers starting with `new` or `class`.
|
|
6194
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6209
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-keyword-prefix.md
|
|
6195
6210
|
*/
|
|
6196
6211
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>;
|
|
6197
6212
|
/**
|
|
6198
6213
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
6199
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6214
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/deprecated-rules.md#no-length-as-slice-end
|
|
6200
6215
|
* @deprecated
|
|
6201
6216
|
*/
|
|
6202
6217
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>;
|
|
6203
6218
|
/**
|
|
6204
6219
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
6205
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6220
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-lonely-if.md
|
|
6206
6221
|
*/
|
|
6207
6222
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>;
|
|
6208
6223
|
/**
|
|
6209
6224
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
6210
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6225
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-magic-array-flat-depth.md
|
|
6211
6226
|
*/
|
|
6212
6227
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6213
6228
|
/**
|
|
6214
6229
|
* Disallow named usage of default import and export.
|
|
6215
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6230
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-named-default.md
|
|
6216
6231
|
*/
|
|
6217
6232
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>;
|
|
6218
6233
|
/**
|
|
6219
6234
|
* Disallow negated conditions.
|
|
6220
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6235
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-negated-condition.md
|
|
6221
6236
|
*/
|
|
6222
6237
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>;
|
|
6223
6238
|
/**
|
|
6224
6239
|
* Disallow negated expression in equality check.
|
|
6225
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6240
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-negation-in-equality-check.md
|
|
6226
6241
|
*/
|
|
6227
6242
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>;
|
|
6228
6243
|
/**
|
|
6229
6244
|
* Disallow nested ternary expressions.
|
|
6230
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6245
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-nested-ternary.md
|
|
6231
6246
|
*/
|
|
6232
6247
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>;
|
|
6233
6248
|
/**
|
|
6234
6249
|
* Disallow `new Array()`.
|
|
6235
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6250
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-new-array.md
|
|
6236
6251
|
*/
|
|
6237
6252
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>;
|
|
6238
6253
|
/**
|
|
6239
6254
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
6240
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6255
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-new-buffer.md
|
|
6241
6256
|
*/
|
|
6242
6257
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>;
|
|
6243
6258
|
/**
|
|
6244
6259
|
* Disallow the use of the `null` literal.
|
|
6245
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6260
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-null.md
|
|
6246
6261
|
*/
|
|
6247
6262
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>;
|
|
6248
6263
|
/**
|
|
6249
6264
|
* Disallow the use of objects as default parameters.
|
|
6250
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6265
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-object-as-default-parameter.md
|
|
6251
6266
|
*/
|
|
6252
6267
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>;
|
|
6253
6268
|
/**
|
|
6254
6269
|
* Disallow `process.exit()`.
|
|
6255
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6270
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-process-exit.md
|
|
6256
6271
|
*/
|
|
6257
6272
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>;
|
|
6258
6273
|
/**
|
|
6259
6274
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
6260
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6275
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-single-promise-in-promise-methods.md
|
|
6261
6276
|
*/
|
|
6262
6277
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>;
|
|
6263
6278
|
/**
|
|
6264
6279
|
* Disallow classes that only have static members.
|
|
6265
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6280
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-static-only-class.md
|
|
6266
6281
|
*/
|
|
6267
6282
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>;
|
|
6268
6283
|
/**
|
|
6269
6284
|
* Disallow `then` property.
|
|
6270
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6285
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-thenable.md
|
|
6271
6286
|
*/
|
|
6272
6287
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>;
|
|
6273
6288
|
/**
|
|
6274
6289
|
* Disallow assigning `this` to a variable.
|
|
6275
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6290
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-this-assignment.md
|
|
6276
6291
|
*/
|
|
6277
6292
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>;
|
|
6278
6293
|
/**
|
|
6279
6294
|
* Disallow comparing `undefined` using `typeof`.
|
|
6280
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6295
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-typeof-undefined.md
|
|
6281
6296
|
*/
|
|
6282
6297
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>;
|
|
6283
6298
|
/**
|
|
6284
6299
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
6285
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6300
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-array-flat-depth.md
|
|
6286
6301
|
*/
|
|
6287
6302
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>;
|
|
6288
6303
|
/**
|
|
6289
6304
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
6290
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6305
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-array-splice-count.md
|
|
6291
6306
|
*/
|
|
6292
6307
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>;
|
|
6293
6308
|
/**
|
|
6294
6309
|
* Disallow awaiting non-promise values.
|
|
6295
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6310
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-await.md
|
|
6296
6311
|
*/
|
|
6297
6312
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>;
|
|
6298
6313
|
/**
|
|
6299
6314
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
6300
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6315
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-polyfills.md
|
|
6301
6316
|
*/
|
|
6302
6317
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>;
|
|
6303
6318
|
/**
|
|
6304
6319
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
6305
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6320
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unnecessary-slice-end.md
|
|
6306
6321
|
*/
|
|
6307
6322
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>;
|
|
6308
6323
|
/**
|
|
6309
6324
|
* Disallow unreadable array destructuring.
|
|
6310
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6325
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unreadable-array-destructuring.md
|
|
6311
6326
|
*/
|
|
6312
6327
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>;
|
|
6313
6328
|
/**
|
|
6314
6329
|
* Disallow unreadable IIFEs.
|
|
6315
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6330
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unreadable-iife.md
|
|
6316
6331
|
*/
|
|
6317
6332
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>;
|
|
6318
6333
|
/**
|
|
6319
6334
|
* Disallow unused object properties.
|
|
6320
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6335
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-unused-properties.md
|
|
6321
6336
|
*/
|
|
6322
6337
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>;
|
|
6323
6338
|
/**
|
|
6324
6339
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
6325
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6340
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-error-capture-stack-trace.md
|
|
6326
6341
|
*/
|
|
6327
6342
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>;
|
|
6328
6343
|
/**
|
|
6329
6344
|
* Disallow useless fallback when spreading in object literals.
|
|
6330
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6345
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-fallback-in-spread.md
|
|
6331
6346
|
*/
|
|
6332
6347
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>;
|
|
6333
6348
|
/**
|
|
6334
6349
|
* Disallow useless array length check.
|
|
6335
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6350
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-length-check.md
|
|
6336
6351
|
*/
|
|
6337
6352
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>;
|
|
6338
6353
|
/**
|
|
6339
6354
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
6340
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6355
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-promise-resolve-reject.md
|
|
6341
6356
|
*/
|
|
6342
6357
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>;
|
|
6343
6358
|
/**
|
|
6344
6359
|
* Disallow unnecessary spread.
|
|
6345
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6360
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-spread.md
|
|
6346
6361
|
*/
|
|
6347
6362
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>;
|
|
6348
6363
|
/**
|
|
6349
6364
|
* Disallow useless case in switch statements.
|
|
6350
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6365
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-switch-case.md
|
|
6351
6366
|
*/
|
|
6352
6367
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>;
|
|
6353
6368
|
/**
|
|
6354
6369
|
* Disallow useless `undefined`.
|
|
6355
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6370
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-useless-undefined.md
|
|
6356
6371
|
*/
|
|
6357
6372
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>;
|
|
6358
6373
|
/**
|
|
6359
6374
|
* Disallow number literals with zero fractions or dangling dots.
|
|
6360
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6375
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/no-zero-fractions.md
|
|
6361
6376
|
*/
|
|
6362
6377
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>;
|
|
6363
6378
|
/**
|
|
6364
6379
|
* Enforce proper case for numeric literals.
|
|
6365
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6380
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/number-literal-case.md
|
|
6366
6381
|
*/
|
|
6367
6382
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>;
|
|
6368
6383
|
/**
|
|
6369
6384
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
6370
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6385
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/numeric-separators-style.md
|
|
6371
6386
|
*/
|
|
6372
6387
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>;
|
|
6373
6388
|
/**
|
|
6374
6389
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
6375
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6390
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-add-event-listener.md
|
|
6376
6391
|
*/
|
|
6377
6392
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>;
|
|
6378
6393
|
/**
|
|
6379
6394
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
6380
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6395
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-find.md
|
|
6381
6396
|
*/
|
|
6382
6397
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>;
|
|
6383
6398
|
/**
|
|
6384
6399
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
6385
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6400
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-flat.md
|
|
6386
6401
|
*/
|
|
6387
6402
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>;
|
|
6388
6403
|
/**
|
|
6389
6404
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
6390
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6405
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-flat-map.md
|
|
6391
6406
|
*/
|
|
6392
6407
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>;
|
|
6393
6408
|
/**
|
|
6394
6409
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
6395
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6410
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-index-of.md
|
|
6396
6411
|
*/
|
|
6397
6412
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>;
|
|
6398
6413
|
/**
|
|
6399
6414
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
6400
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6415
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-array-some.md
|
|
6401
6416
|
*/
|
|
6402
6417
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>;
|
|
6403
6418
|
/**
|
|
6404
6419
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
6405
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6420
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-at.md
|
|
6406
6421
|
*/
|
|
6407
6422
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>;
|
|
6423
|
+
/**
|
|
6424
|
+
* Prefer `BigInt` literals over the constructor.
|
|
6425
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-bigint-literals.md
|
|
6426
|
+
*/
|
|
6427
|
+
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>;
|
|
6408
6428
|
/**
|
|
6409
6429
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
6410
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6430
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-blob-reading-methods.md
|
|
6411
6431
|
*/
|
|
6412
6432
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>;
|
|
6413
6433
|
/**
|
|
6414
6434
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
6415
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6435
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-class-fields.md
|
|
6416
6436
|
*/
|
|
6417
6437
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>;
|
|
6438
|
+
/**
|
|
6439
|
+
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
6440
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-classlist-toggle.md
|
|
6441
|
+
*/
|
|
6442
|
+
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>;
|
|
6418
6443
|
/**
|
|
6419
6444
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
6420
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6445
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-code-point.md
|
|
6421
6446
|
*/
|
|
6422
6447
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>;
|
|
6423
6448
|
/**
|
|
6424
6449
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
6425
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6450
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-date-now.md
|
|
6426
6451
|
*/
|
|
6427
6452
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>;
|
|
6428
6453
|
/**
|
|
6429
6454
|
* Prefer default parameters over reassignment.
|
|
6430
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6455
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-default-parameters.md
|
|
6431
6456
|
*/
|
|
6432
6457
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>;
|
|
6433
6458
|
/**
|
|
6434
6459
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
6435
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6460
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-append.md
|
|
6436
6461
|
*/
|
|
6437
6462
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>;
|
|
6438
6463
|
/**
|
|
6439
6464
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
6440
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6465
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-dataset.md
|
|
6441
6466
|
*/
|
|
6442
6467
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>;
|
|
6443
6468
|
/**
|
|
6444
6469
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
6445
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6470
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-remove.md
|
|
6446
6471
|
*/
|
|
6447
6472
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>;
|
|
6448
6473
|
/**
|
|
6449
6474
|
* Prefer `.textContent` over `.innerText`.
|
|
6450
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6475
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-dom-node-text-content.md
|
|
6451
6476
|
*/
|
|
6452
6477
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>;
|
|
6453
6478
|
/**
|
|
6454
6479
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
6455
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6480
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-event-target.md
|
|
6456
6481
|
*/
|
|
6457
6482
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>;
|
|
6458
6483
|
/**
|
|
6459
6484
|
* Prefer `export…from` when re-exporting.
|
|
6460
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6485
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-export-from.md
|
|
6461
6486
|
*/
|
|
6462
6487
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>;
|
|
6463
6488
|
/**
|
|
6464
6489
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
6465
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6490
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-global-this.md
|
|
6466
6491
|
*/
|
|
6467
6492
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>;
|
|
6468
6493
|
/**
|
|
6469
6494
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
6470
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6495
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-import-meta-properties.md
|
|
6471
6496
|
*/
|
|
6472
6497
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>;
|
|
6473
6498
|
/**
|
|
6474
6499
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
6475
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6500
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-includes.md
|
|
6476
6501
|
*/
|
|
6477
6502
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>;
|
|
6478
6503
|
/**
|
|
6479
6504
|
* Prefer reading a JSON file as a buffer.
|
|
6480
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6505
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-json-parse-buffer.md
|
|
6481
6506
|
*/
|
|
6482
6507
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>;
|
|
6483
6508
|
/**
|
|
6484
6509
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
6485
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6510
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-keyboard-event-key.md
|
|
6486
6511
|
*/
|
|
6487
6512
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>;
|
|
6488
6513
|
/**
|
|
6489
6514
|
* Prefer using a logical operator over a ternary.
|
|
6490
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6515
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-logical-operator-over-ternary.md
|
|
6491
6516
|
*/
|
|
6492
6517
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>;
|
|
6493
6518
|
/**
|
|
6494
6519
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
6495
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6520
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-math-min-max.md
|
|
6496
6521
|
*/
|
|
6497
6522
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>;
|
|
6498
6523
|
/**
|
|
6499
6524
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
6500
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6525
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-math-trunc.md
|
|
6501
6526
|
*/
|
|
6502
6527
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>;
|
|
6503
6528
|
/**
|
|
6504
6529
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
6505
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6530
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-modern-dom-apis.md
|
|
6506
6531
|
*/
|
|
6507
6532
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>;
|
|
6508
6533
|
/**
|
|
6509
6534
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
6510
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6535
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-modern-math-apis.md
|
|
6511
6536
|
*/
|
|
6512
6537
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>;
|
|
6513
6538
|
/**
|
|
6514
6539
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
6515
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6540
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-module.md
|
|
6516
6541
|
*/
|
|
6517
6542
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>;
|
|
6518
6543
|
/**
|
|
6519
6544
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
6520
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6545
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-native-coercion-functions.md
|
|
6521
6546
|
*/
|
|
6522
6547
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>;
|
|
6523
6548
|
/**
|
|
6524
6549
|
* Prefer negative index over `.length - index` when possible.
|
|
6525
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6550
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-negative-index.md
|
|
6526
6551
|
*/
|
|
6527
6552
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>;
|
|
6528
6553
|
/**
|
|
6529
6554
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
6530
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6555
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-node-protocol.md
|
|
6531
6556
|
*/
|
|
6532
6557
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>;
|
|
6533
6558
|
/**
|
|
6534
6559
|
* Prefer `Number` static properties over global ones.
|
|
6535
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6560
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-number-properties.md
|
|
6536
6561
|
*/
|
|
6537
6562
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>;
|
|
6538
6563
|
/**
|
|
6539
6564
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
6540
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6565
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-object-from-entries.md
|
|
6541
6566
|
*/
|
|
6542
6567
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>;
|
|
6543
6568
|
/**
|
|
6544
6569
|
* Prefer omitting the `catch` binding parameter.
|
|
6545
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6570
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-optional-catch-binding.md
|
|
6546
6571
|
*/
|
|
6547
6572
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>;
|
|
6548
6573
|
/**
|
|
6549
6574
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
6550
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6575
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-prototype-methods.md
|
|
6551
6576
|
*/
|
|
6552
6577
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>;
|
|
6553
6578
|
/**
|
|
6554
6579
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
6555
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6580
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-query-selector.md
|
|
6556
6581
|
*/
|
|
6557
6582
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>;
|
|
6558
6583
|
/**
|
|
6559
6584
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
6560
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6585
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-reflect-apply.md
|
|
6561
6586
|
*/
|
|
6562
6587
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>;
|
|
6563
6588
|
/**
|
|
6564
6589
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
6565
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6590
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-regexp-test.md
|
|
6566
6591
|
*/
|
|
6567
6592
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>;
|
|
6568
6593
|
/**
|
|
6569
6594
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
6570
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6595
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-set-has.md
|
|
6571
6596
|
*/
|
|
6572
6597
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>;
|
|
6573
6598
|
/**
|
|
6574
6599
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
6575
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6600
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-set-size.md
|
|
6576
6601
|
*/
|
|
6577
6602
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>;
|
|
6578
6603
|
/**
|
|
6579
6604
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
6580
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6605
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-single-call.md
|
|
6581
6606
|
*/
|
|
6582
6607
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>;
|
|
6583
6608
|
/**
|
|
6584
6609
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
6585
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6610
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-spread.md
|
|
6586
6611
|
*/
|
|
6587
6612
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>;
|
|
6588
6613
|
/**
|
|
6589
6614
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
6590
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6615
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-raw.md
|
|
6591
6616
|
*/
|
|
6592
6617
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>;
|
|
6593
6618
|
/**
|
|
6594
6619
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
6595
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6620
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-replace-all.md
|
|
6596
6621
|
*/
|
|
6597
6622
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>;
|
|
6598
6623
|
/**
|
|
6599
6624
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
6600
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6625
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-slice.md
|
|
6601
6626
|
*/
|
|
6602
6627
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>;
|
|
6603
6628
|
/**
|
|
6604
6629
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
6605
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6630
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-starts-ends-with.md
|
|
6606
6631
|
*/
|
|
6607
6632
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>;
|
|
6608
6633
|
/**
|
|
6609
6634
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
6610
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6635
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-string-trim-start-end.md
|
|
6611
6636
|
*/
|
|
6612
6637
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>;
|
|
6613
6638
|
/**
|
|
6614
6639
|
* Prefer using `structuredClone` to create a deep clone.
|
|
6615
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6640
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-structured-clone.md
|
|
6616
6641
|
*/
|
|
6617
6642
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>;
|
|
6618
6643
|
/**
|
|
6619
6644
|
* Prefer `switch` over multiple `else-if`.
|
|
6620
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6645
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-switch.md
|
|
6621
6646
|
*/
|
|
6622
6647
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>;
|
|
6623
6648
|
/**
|
|
6624
6649
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
6625
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6650
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-ternary.md
|
|
6626
6651
|
*/
|
|
6627
6652
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>;
|
|
6628
6653
|
/**
|
|
6629
6654
|
* Prefer top-level await over top-level promises and async function calls.
|
|
6630
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-top-level-await.md
|
|
6631
6656
|
*/
|
|
6632
6657
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>;
|
|
6633
6658
|
/**
|
|
6634
6659
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
6635
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prefer-type-error.md
|
|
6636
6661
|
*/
|
|
6637
6662
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>;
|
|
6638
6663
|
/**
|
|
6639
6664
|
* Prevent abbreviations.
|
|
6640
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/prevent-abbreviations.md
|
|
6641
6666
|
*/
|
|
6642
6667
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>;
|
|
6643
6668
|
/**
|
|
6644
6669
|
* Enforce consistent relative URL style.
|
|
6645
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/relative-url-style.md
|
|
6646
6671
|
*/
|
|
6647
6672
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>;
|
|
6648
6673
|
/**
|
|
6649
6674
|
* Enforce using the separator argument with `Array#join()`.
|
|
6650
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-array-join-separator.md
|
|
6651
6676
|
*/
|
|
6652
6677
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>;
|
|
6678
|
+
/**
|
|
6679
|
+
* Require non-empty module attributes for imports and exports
|
|
6680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-module-attributes.md
|
|
6681
|
+
*/
|
|
6682
|
+
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>;
|
|
6653
6683
|
/**
|
|
6654
6684
|
* Require non-empty specifier list in import and export statements.
|
|
6655
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-module-specifiers.md
|
|
6656
6686
|
*/
|
|
6657
6687
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>;
|
|
6658
6688
|
/**
|
|
6659
6689
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
6660
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-number-to-fixed-digits-argument.md
|
|
6661
6691
|
*/
|
|
6662
6692
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>;
|
|
6663
6693
|
/**
|
|
6664
6694
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
6665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/require-post-message-target-origin.md
|
|
6666
6696
|
*/
|
|
6667
6697
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>;
|
|
6668
6698
|
/**
|
|
6669
6699
|
* Enforce better string content.
|
|
6670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/string-content.md
|
|
6671
6701
|
*/
|
|
6672
6702
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>;
|
|
6673
6703
|
/**
|
|
6674
6704
|
* Enforce consistent brace style for `case` clauses.
|
|
6675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/switch-case-braces.md
|
|
6676
6706
|
*/
|
|
6677
6707
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>;
|
|
6678
6708
|
/**
|
|
6679
6709
|
* Fix whitespace-insensitive template indentation.
|
|
6680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/template-indent.md
|
|
6681
6711
|
*/
|
|
6682
6712
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>;
|
|
6683
6713
|
/**
|
|
6684
6714
|
* Enforce consistent case for text encoding identifiers.
|
|
6685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/text-encoding-identifier-case.md
|
|
6686
6716
|
*/
|
|
6687
6717
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<[]>;
|
|
6688
6718
|
/**
|
|
6689
6719
|
* Require `new` when creating an error.
|
|
6690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
6720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v61.0.2/docs/rules/throw-new-error.md
|
|
6691
6721
|
*/
|
|
6692
6722
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>;
|
|
6693
6723
|
/**
|
|
@@ -8138,7 +8168,6 @@ interface RuleOptions {
|
|
|
8138
8168
|
*/
|
|
8139
8169
|
'yoda'?: Linter.RuleEntry<Yoda>;
|
|
8140
8170
|
}
|
|
8141
|
-
|
|
8142
8171
|
/* ======= Declarations ======= */
|
|
8143
8172
|
// ----- accessor-pairs -----
|
|
8144
8173
|
type AccessorPairs = [] | [{
|
|
@@ -8515,6 +8544,10 @@ type IndentLegacy = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
8515
8544
|
type InitDeclarations = ([] | ["always"] | [] | ["never"] | ["never", {
|
|
8516
8545
|
ignoreForLoopInit?: boolean;
|
|
8517
8546
|
}]);
|
|
8547
|
+
// ----- jsdoc/check-alignment -----
|
|
8548
|
+
type JsdocCheckAlignment = [] | [{
|
|
8549
|
+
innerIndent?: number;
|
|
8550
|
+
}];
|
|
8518
8551
|
// ----- jsdoc/check-examples -----
|
|
8519
8552
|
type JsdocCheckExamples = [] | [{
|
|
8520
8553
|
allowInlineConfig?: boolean;
|
|
@@ -8804,6 +8837,7 @@ type JsdocRequireJsdoc = [] | [{
|
|
|
8804
8837
|
enableFixer?: boolean;
|
|
8805
8838
|
exemptEmptyConstructors?: boolean;
|
|
8806
8839
|
exemptEmptyFunctions?: boolean;
|
|
8840
|
+
exemptOverloadedImplementations?: boolean;
|
|
8807
8841
|
fixerMessage?: string;
|
|
8808
8842
|
minLineCount?: number;
|
|
8809
8843
|
publicOnly?: (boolean | {
|
|
@@ -8820,6 +8854,7 @@ type JsdocRequireJsdoc = [] | [{
|
|
|
8820
8854
|
FunctionExpression?: boolean;
|
|
8821
8855
|
MethodDefinition?: boolean;
|
|
8822
8856
|
};
|
|
8857
|
+
skipInterveningOverloadedDeclarations?: boolean;
|
|
8823
8858
|
}];
|
|
8824
8859
|
// ----- jsdoc/require-param -----
|
|
8825
8860
|
type JsdocRequireParam = [] | [{
|
|
@@ -8972,6 +9007,21 @@ type JsdocTextEscaping = [] | [{
|
|
|
8972
9007
|
escapeHTML?: boolean;
|
|
8973
9008
|
escapeMarkdown?: boolean;
|
|
8974
9009
|
}];
|
|
9010
|
+
// ----- jsdoc/type-formatting -----
|
|
9011
|
+
type JsdocTypeFormatting = [] | [{
|
|
9012
|
+
arrayBrackets?: ("angle" | "square");
|
|
9013
|
+
enableFixer?: boolean;
|
|
9014
|
+
genericDot?: boolean;
|
|
9015
|
+
objectFieldIndent?: string;
|
|
9016
|
+
objectFieldQuote?: ("double" | "single" | null);
|
|
9017
|
+
objectFieldSeparator?: ("comma" | "comma-and-linebreak" | "linebreak" | "semicolon" | "semicolon-and-linebreak");
|
|
9018
|
+
objectFieldSeparatorTrailingPunctuation?: boolean;
|
|
9019
|
+
propertyQuotes?: ("double" | "single" | null);
|
|
9020
|
+
separatorForSingleObjectField?: boolean;
|
|
9021
|
+
stringQuotes?: ("double" | "single");
|
|
9022
|
+
typeBracketSpacing?: string;
|
|
9023
|
+
unionSpacing?: string;
|
|
9024
|
+
}];
|
|
8975
9025
|
// ----- jsdoc/valid-types -----
|
|
8976
9026
|
type JsdocValidTypes = [] | [{
|
|
8977
9027
|
allowEmptyNamepaths?: boolean;
|
|
@@ -12356,6 +12406,10 @@ type PreferReflect = [] | [{
|
|
|
12356
12406
|
type PreferRegexLiterals = [] | [{
|
|
12357
12407
|
disallowRedundantWrapping?: boolean;
|
|
12358
12408
|
}];
|
|
12409
|
+
// ----- preserve-caught-error -----
|
|
12410
|
+
type PreserveCaughtError = [] | [{
|
|
12411
|
+
requireCatchParameter?: boolean;
|
|
12412
|
+
}];
|
|
12359
12413
|
// ----- quote-props -----
|
|
12360
12414
|
type QuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
12361
12415
|
keywords?: boolean;
|
|
@@ -12382,8 +12436,6 @@ type ReactHooksExhaustiveDeps = [] | [{
|
|
|
12382
12436
|
// ----- react-naming-convention/component-name -----
|
|
12383
12437
|
type ReactNamingConventionComponentName = [] | [(("PascalCase" | "CONSTANT_CASE") | {
|
|
12384
12438
|
allowAllCaps?: boolean;
|
|
12385
|
-
allowLeadingUnderscore?: boolean;
|
|
12386
|
-
allowNamespace?: boolean;
|
|
12387
12439
|
excepts?: string[];
|
|
12388
12440
|
rule?: ("PascalCase" | "CONSTANT_CASE");
|
|
12389
12441
|
})];
|
|
@@ -15123,6 +15175,10 @@ type UnicornNoArrayReduce = [] | [{
|
|
|
15123
15175
|
type UnicornNoArrayReverse = [] | [{
|
|
15124
15176
|
allowExpressionStatement?: boolean;
|
|
15125
15177
|
}];
|
|
15178
|
+
// ----- unicorn/no-array-sort -----
|
|
15179
|
+
type UnicornNoArraySort = [] | [{
|
|
15180
|
+
allowExpressionStatement?: boolean;
|
|
15181
|
+
}];
|
|
15126
15182
|
// ----- unicorn/no-instanceof-builtins -----
|
|
15127
15183
|
type UnicornNoInstanceofBuiltins = [] | [{
|
|
15128
15184
|
useErrorIsError?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -127,8 +127,7 @@ const parserPlain = {
|
|
|
127
127
|
* Combine array and non-array configs into a single array.
|
|
128
128
|
*/
|
|
129
129
|
async function combine(...configs$1) {
|
|
130
|
-
|
|
131
|
-
return resolved.flat();
|
|
130
|
+
return (await Promise.all(configs$1)).flat();
|
|
132
131
|
}
|
|
133
132
|
/**
|
|
134
133
|
* Rename plugin prefixes in a rule object.
|
|
@@ -235,9 +234,7 @@ async function ensure(packages) {
|
|
|
235
234
|
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
236
235
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
237
236
|
if (nonExistingPackages.length === 0) return;
|
|
238
|
-
|
|
239
|
-
const result = await p.confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` });
|
|
240
|
-
if (result) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
237
|
+
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
241
238
|
}
|
|
242
239
|
/**
|
|
243
240
|
* Resolve sub-options from a config options object.
|
|
@@ -530,10 +527,9 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
530
527
|
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
531
528
|
useTabs: indent === "tab"
|
|
532
529
|
}, options.dprintOptions || {});
|
|
533
|
-
const pluginFormat = await interop(import("eslint-plugin-format"));
|
|
534
530
|
const configs$1 = [{
|
|
535
531
|
name: "luxass/formatter/setup",
|
|
536
|
-
plugins: { format:
|
|
532
|
+
plugins: { format: await interop(import("eslint-plugin-format")) }
|
|
537
533
|
}];
|
|
538
534
|
if (options.css) configs$1.push({
|
|
539
535
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.2",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -85,28 +85,28 @@
|
|
|
85
85
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
86
86
|
"@eslint/markdown": "^7.2.0",
|
|
87
87
|
"@stylistic/eslint-plugin": "^5.3.1",
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
89
|
-
"@typescript-eslint/parser": "^8.
|
|
90
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
89
|
+
"@typescript-eslint/parser": "^8.43.0",
|
|
90
|
+
"@vitest/eslint-plugin": "^1.3.9",
|
|
91
91
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
92
92
|
"eslint-flat-config-utils": "^2.1.1",
|
|
93
93
|
"eslint-merge-processors": "^2.0.0",
|
|
94
94
|
"eslint-plugin-antfu": "^3.1.1",
|
|
95
95
|
"eslint-plugin-command": "^3.3.1",
|
|
96
96
|
"eslint-plugin-import-lite": "^0.3.0",
|
|
97
|
-
"eslint-plugin-jsdoc": "^
|
|
97
|
+
"eslint-plugin-jsdoc": "^56.1.2",
|
|
98
98
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
99
99
|
"eslint-plugin-n": "^17.21.3",
|
|
100
100
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
101
101
|
"eslint-plugin-pnpm": "^1.1.1",
|
|
102
102
|
"eslint-plugin-regexp": "^2.10.0",
|
|
103
103
|
"eslint-plugin-toml": "^0.12.0",
|
|
104
|
-
"eslint-plugin-unicorn": "^
|
|
104
|
+
"eslint-plugin-unicorn": "^61.0.2",
|
|
105
105
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
106
106
|
"eslint-plugin-vue": "^10.4.0",
|
|
107
107
|
"eslint-plugin-yml": "^1.18.0",
|
|
108
108
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
109
|
-
"globals": "^16.
|
|
109
|
+
"globals": "^16.4.0",
|
|
110
110
|
"jsonc-eslint-parser": "^2.4.0",
|
|
111
111
|
"local-pkg": "^1.1.2",
|
|
112
112
|
"parse-gitignore": "^2.0.0",
|
|
@@ -115,13 +115,13 @@
|
|
|
115
115
|
"yaml-eslint-parser": "^1.3.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
118
|
+
"@eslint-react/eslint-plugin": "^1.53.1",
|
|
119
119
|
"@eslint/config-inspector": "^1.2.0",
|
|
120
120
|
"@types/node": "^22.17.1",
|
|
121
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
122
|
-
"@unocss/eslint-plugin": "^66.5.
|
|
121
|
+
"@typescript-eslint/rule-tester": "^8.43.0",
|
|
122
|
+
"@unocss/eslint-plugin": "^66.5.1",
|
|
123
123
|
"astro-eslint-parser": "^1.2.2",
|
|
124
|
-
"eslint": "^9.
|
|
124
|
+
"eslint": "^9.35.0",
|
|
125
125
|
"eslint-plugin-astro": "^1.3.1",
|
|
126
126
|
"eslint-plugin-format": "^1.0.1",
|
|
127
127
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -131,10 +131,10 @@
|
|
|
131
131
|
"jiti": "^2.5.1",
|
|
132
132
|
"prettier-plugin-astro": "^0.14.1",
|
|
133
133
|
"tailwindcss": "3.4.17",
|
|
134
|
-
"tsdown": "^0.
|
|
134
|
+
"tsdown": "^0.15.1",
|
|
135
135
|
"tsx": "^4.20.5",
|
|
136
136
|
"typescript": "^5.9.2",
|
|
137
|
-
"unocss": "^66.5.
|
|
137
|
+
"unocss": "^66.5.1",
|
|
138
138
|
"vitest": "^3.2.4",
|
|
139
139
|
"vue": "^3.5.21"
|
|
140
140
|
},
|