@w5s/eslint-config 3.10.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +956 -231
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -13
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/config/unicorn.ts +1 -12
- package/src/typegen/unicorn.d.ts +999 -232
package/src/typegen/unicorn.d.ts
CHANGED
|
@@ -11,918 +11,1560 @@ declare module 'eslint' {
|
|
|
11
11
|
export interface RuleOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Prefer better DOM traversal APIs.
|
|
14
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
14
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/better-dom-traversing.md
|
|
15
15
|
*/
|
|
16
16
|
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>
|
|
17
17
|
/**
|
|
18
18
|
* Removed. Prefer `eslint-plugin-regexp`
|
|
19
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
19
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#better-regex
|
|
20
20
|
* @deprecated
|
|
21
21
|
*/
|
|
22
22
|
'unicorn/better-regex'?: Linter.RuleEntry<[]>
|
|
23
23
|
/**
|
|
24
24
|
* Enforce a specific parameter name in catch clauses.
|
|
25
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
25
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/catch-error-name.md
|
|
26
26
|
*/
|
|
27
27
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
28
|
+
/**
|
|
29
|
+
* Enforce consistent class references in static methods.
|
|
30
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/class-reference-in-static-methods.md
|
|
31
|
+
*/
|
|
32
|
+
'unicorn/class-reference-in-static-methods'?: Linter.RuleEntry<UnicornClassReferenceInStaticMethods>
|
|
33
|
+
/**
|
|
34
|
+
* Enforce better comment content.
|
|
35
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/comment-content.md
|
|
36
|
+
*/
|
|
37
|
+
'unicorn/comment-content'?: Linter.RuleEntry<UnicornCommentContent>
|
|
28
38
|
/**
|
|
29
39
|
* Enforce consistent assertion style with `node:assert`.
|
|
30
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
40
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-assert.md
|
|
31
41
|
*/
|
|
32
42
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
43
|
+
/**
|
|
44
|
+
* Enforce consistent naming for boolean names.
|
|
45
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-boolean-name.md
|
|
46
|
+
*/
|
|
47
|
+
'unicorn/consistent-boolean-name'?: Linter.RuleEntry<UnicornConsistentBooleanName>
|
|
48
|
+
/**
|
|
49
|
+
* Enforce consistent class member order.
|
|
50
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-class-member-order.md
|
|
51
|
+
*/
|
|
52
|
+
'unicorn/consistent-class-member-order'?: Linter.RuleEntry<UnicornConsistentClassMemberOrder>
|
|
33
53
|
/**
|
|
34
54
|
* Enforce consistent spelling of compound words in identifiers.
|
|
35
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
55
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-compound-words.md
|
|
36
56
|
*/
|
|
37
57
|
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>
|
|
58
|
+
/**
|
|
59
|
+
* Enforce consistent conditional object spread style.
|
|
60
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-conditional-object-spread.md
|
|
61
|
+
*/
|
|
62
|
+
'unicorn/consistent-conditional-object-spread'?: Linter.RuleEntry<UnicornConsistentConditionalObjectSpread>
|
|
38
63
|
/**
|
|
39
64
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
40
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
65
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-date-clone.md
|
|
41
66
|
*/
|
|
42
67
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
43
68
|
/**
|
|
44
69
|
* Use destructured variables over properties.
|
|
45
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
70
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-destructuring.md
|
|
46
71
|
*/
|
|
47
72
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
48
73
|
/**
|
|
49
74
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
50
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
75
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-empty-array-spread.md
|
|
51
76
|
*/
|
|
52
77
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
53
78
|
/**
|
|
54
79
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
55
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
80
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-existence-index-check.md
|
|
56
81
|
*/
|
|
57
82
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
83
|
+
/**
|
|
84
|
+
* Enforce consistent decorator position on exported classes.
|
|
85
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-export-decorator-position.md
|
|
86
|
+
*/
|
|
87
|
+
'unicorn/consistent-export-decorator-position'?: Linter.RuleEntry<UnicornConsistentExportDecoratorPosition>
|
|
58
88
|
/**
|
|
59
89
|
* Move function definitions to the highest possible scope.
|
|
60
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
90
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-function-scoping.md
|
|
61
91
|
*/
|
|
62
92
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
93
|
+
/**
|
|
94
|
+
* Enforce function syntax by role.
|
|
95
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-function-style.md
|
|
96
|
+
*/
|
|
97
|
+
'unicorn/consistent-function-style'?: Linter.RuleEntry<UnicornConsistentFunctionStyle>
|
|
63
98
|
/**
|
|
64
99
|
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
65
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
100
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-json-file-read.md
|
|
66
101
|
*/
|
|
67
102
|
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>
|
|
103
|
+
/**
|
|
104
|
+
* Enforce consistent optional chaining for same-base member access.
|
|
105
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-optional-chaining.md
|
|
106
|
+
*/
|
|
107
|
+
'unicorn/consistent-optional-chaining'?: Linter.RuleEntry<[]>
|
|
68
108
|
/**
|
|
69
109
|
* Enforce consistent style for escaping `${` in template literals.
|
|
70
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
110
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/consistent-template-literal-escape.md
|
|
71
111
|
*/
|
|
72
112
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>
|
|
73
113
|
/**
|
|
74
114
|
* Enforce correct `Error` subclassing.
|
|
75
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/custom-error-definition.md
|
|
76
116
|
*/
|
|
77
117
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
118
|
+
/**
|
|
119
|
+
* Enforce consistent default export declarations.
|
|
120
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/default-export-style.md
|
|
121
|
+
*/
|
|
122
|
+
'unicorn/default-export-style'?: Linter.RuleEntry<UnicornDefaultExportStyle>
|
|
78
123
|
/**
|
|
79
124
|
* Enforce consistent style for DOM element dataset access.
|
|
80
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/dom-node-dataset.md
|
|
81
126
|
*/
|
|
82
127
|
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>
|
|
83
128
|
/**
|
|
84
129
|
* Enforce no spaces between braces.
|
|
85
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
130
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/empty-brace-spaces.md
|
|
86
131
|
*/
|
|
87
132
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
88
133
|
/**
|
|
89
134
|
* Enforce passing a `message` value when creating a built-in error.
|
|
90
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/error-message.md
|
|
91
136
|
*/
|
|
92
137
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
93
138
|
/**
|
|
94
139
|
* Require escape sequences to use uppercase or lowercase values.
|
|
95
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/escape-case.md
|
|
96
141
|
*/
|
|
97
142
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
98
143
|
/**
|
|
99
144
|
* Add expiration conditions to TODO comments.
|
|
100
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/expiring-todo-comments.md
|
|
101
146
|
*/
|
|
102
147
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
103
148
|
/**
|
|
104
149
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
105
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/explicit-length-check.md
|
|
106
151
|
*/
|
|
107
152
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
153
|
+
/**
|
|
154
|
+
* Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.
|
|
155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/explicit-timer-delay.md
|
|
156
|
+
*/
|
|
157
|
+
'unicorn/explicit-timer-delay'?: Linter.RuleEntry<UnicornExplicitTimerDelay>
|
|
108
158
|
/**
|
|
109
159
|
* Enforce a case style for filenames and directory names.
|
|
110
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
160
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/filename-case.md
|
|
111
161
|
*/
|
|
112
162
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
163
|
+
/**
|
|
164
|
+
* Require identifiers to match a specified regular expression.
|
|
165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/id-match.md
|
|
166
|
+
*/
|
|
167
|
+
'unicorn/id-match'?: Linter.RuleEntry<UnicornIdMatch>
|
|
113
168
|
/**
|
|
114
169
|
* Enforce specific import styles per module.
|
|
115
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/import-style.md
|
|
116
171
|
*/
|
|
117
172
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
118
173
|
/**
|
|
119
174
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
120
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
175
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/isolated-functions.md
|
|
121
176
|
*/
|
|
122
177
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>
|
|
123
178
|
/**
|
|
124
|
-
*
|
|
125
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
179
|
+
* Require or disallow logical assignment operator shorthand
|
|
180
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/logical-assignment-operators.md
|
|
181
|
+
*/
|
|
182
|
+
'unicorn/logical-assignment-operators'?: Linter.RuleEntry<UnicornLogicalAssignmentOperators>
|
|
183
|
+
/**
|
|
184
|
+
* Limit the depth of nested calls.
|
|
185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/max-nested-calls.md
|
|
186
|
+
*/
|
|
187
|
+
'unicorn/max-nested-calls'?: Linter.RuleEntry<UnicornMaxNestedCalls>
|
|
188
|
+
/**
|
|
189
|
+
* Enforce replacements for variable, property, and filenames.
|
|
190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/name-replacements.md
|
|
191
|
+
*/
|
|
192
|
+
'unicorn/name-replacements'?: Linter.RuleEntry<UnicornNameReplacements>
|
|
193
|
+
/**
|
|
194
|
+
* Enforce correct use of `new` for builtin constructors.
|
|
195
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/new-for-builtins.md
|
|
126
196
|
*/
|
|
127
197
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
128
198
|
/**
|
|
129
199
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
130
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
200
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
131
201
|
*/
|
|
132
202
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
133
203
|
/**
|
|
134
204
|
* Disallow recursive access to `this` within getters and setters.
|
|
135
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
205
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-accessor-recursion.md
|
|
136
206
|
*/
|
|
137
207
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
208
|
+
/**
|
|
209
|
+
* Disallow bitwise operators where a logical operator was likely intended.
|
|
210
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-accidental-bitwise-operator.md
|
|
211
|
+
*/
|
|
212
|
+
'unicorn/no-accidental-bitwise-operator'?: Linter.RuleEntry<[]>
|
|
138
213
|
/**
|
|
139
214
|
* Disallow anonymous functions and classes as the default export.
|
|
140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
215
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-anonymous-default-export.md
|
|
141
216
|
*/
|
|
142
217
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
143
218
|
/**
|
|
144
219
|
* Prevent passing a function reference directly to iterator methods.
|
|
145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
220
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-callback-reference.md
|
|
146
221
|
*/
|
|
147
222
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>
|
|
148
223
|
/**
|
|
149
|
-
* Disallow
|
|
150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
224
|
+
* Disallow array accumulation with `Array#concat()` in loops.
|
|
225
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-concat-in-loop.md
|
|
151
226
|
*/
|
|
152
|
-
'unicorn/no-array-
|
|
227
|
+
'unicorn/no-array-concat-in-loop'?: Linter.RuleEntry<[]>
|
|
153
228
|
/**
|
|
154
|
-
*
|
|
155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
229
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
230
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-fill-with-reference-type.md
|
|
156
231
|
*/
|
|
157
|
-
'unicorn/no-array-
|
|
232
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>
|
|
158
233
|
/**
|
|
159
234
|
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
235
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-from-fill.md
|
|
161
236
|
*/
|
|
162
237
|
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>
|
|
238
|
+
/**
|
|
239
|
+
* Disallow front-of-array mutation.
|
|
240
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-front-mutation.md
|
|
241
|
+
*/
|
|
242
|
+
'unicorn/no-array-front-mutation'?: Linter.RuleEntry<[]>
|
|
163
243
|
/**
|
|
164
244
|
* Disallow using the `this` argument in array methods.
|
|
165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
245
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-method-this-argument.md
|
|
166
246
|
*/
|
|
167
247
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
168
248
|
/**
|
|
169
249
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
250
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
171
251
|
* @deprecated
|
|
172
252
|
*/
|
|
173
253
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
174
254
|
/**
|
|
175
255
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
176
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-reduce.md
|
|
177
257
|
*/
|
|
178
258
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
179
259
|
/**
|
|
180
260
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
181
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-reverse.md
|
|
182
262
|
*/
|
|
183
263
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>
|
|
184
264
|
/**
|
|
185
265
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
186
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
266
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-sort.md
|
|
187
267
|
*/
|
|
188
268
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>
|
|
269
|
+
/**
|
|
270
|
+
* Disallow sorting arrays to get the minimum or maximum value.
|
|
271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-sort-for-min-max.md
|
|
272
|
+
*/
|
|
273
|
+
'unicorn/no-array-sort-for-min-max'?: Linter.RuleEntry<[]>
|
|
274
|
+
/**
|
|
275
|
+
* Prefer `Array#toSpliced()` over `Array#splice()`.
|
|
276
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-array-splice.md
|
|
277
|
+
*/
|
|
278
|
+
'unicorn/no-array-splice'?: Linter.RuleEntry<[]>
|
|
279
|
+
/**
|
|
280
|
+
* Disallow asterisk prefixes in documentation comments.
|
|
281
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-asterisk-prefix-in-documentation-comments.md
|
|
282
|
+
*/
|
|
283
|
+
'unicorn/no-asterisk-prefix-in-documentation-comments'?: Linter.RuleEntry<[]>
|
|
189
284
|
/**
|
|
190
285
|
* Disallow member access from await expression.
|
|
191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
286
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-await-expression-member.md
|
|
192
287
|
*/
|
|
193
288
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
194
289
|
/**
|
|
195
290
|
* Disallow using `await` in `Promise` method parameters.
|
|
196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
291
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-await-in-promise-methods.md
|
|
197
292
|
*/
|
|
198
293
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
199
294
|
/**
|
|
200
295
|
* Disallow unnecessary `Blob` to `File` conversion.
|
|
201
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-blob-to-file.md
|
|
202
297
|
*/
|
|
203
298
|
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>
|
|
299
|
+
/**
|
|
300
|
+
* Disallow boolean-returning sort comparators.
|
|
301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-boolean-sort-comparator.md
|
|
302
|
+
*/
|
|
303
|
+
'unicorn/no-boolean-sort-comparator'?: Linter.RuleEntry<[]>
|
|
304
|
+
/**
|
|
305
|
+
* Disallow `break` and `continue` in nested loops and switches inside loops.
|
|
306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-break-in-nested-loop.md
|
|
307
|
+
*/
|
|
308
|
+
'unicorn/no-break-in-nested-loop'?: Linter.RuleEntry<[]>
|
|
204
309
|
/**
|
|
205
310
|
* Prefer drawing canvases directly instead of converting them to images.
|
|
206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-canvas-to-image.md
|
|
207
312
|
*/
|
|
208
313
|
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>
|
|
314
|
+
/**
|
|
315
|
+
* Disallow chained comparisons such as `a < b < c`.
|
|
316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-chained-comparison.md
|
|
317
|
+
*/
|
|
318
|
+
'unicorn/no-chained-comparison'?: Linter.RuleEntry<[]>
|
|
319
|
+
/**
|
|
320
|
+
* Disallow accessing `Map`, `Set`, `WeakMap`, and `WeakSet` entries with bracket notation.
|
|
321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-collection-bracket-access.md
|
|
322
|
+
*/
|
|
323
|
+
'unicorn/no-collection-bracket-access'?: Linter.RuleEntry<[]>
|
|
324
|
+
/**
|
|
325
|
+
* Disallow dynamic object property existence checks.
|
|
326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-computed-property-existence-check.md
|
|
327
|
+
*/
|
|
328
|
+
'unicorn/no-computed-property-existence-check'?: Linter.RuleEntry<[]>
|
|
209
329
|
/**
|
|
210
330
|
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
211
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-confusing-array-splice.md
|
|
212
332
|
*/
|
|
213
333
|
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>
|
|
334
|
+
/**
|
|
335
|
+
* Disallow confusing uses of `Array#with()`.
|
|
336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-confusing-array-with.md
|
|
337
|
+
*/
|
|
338
|
+
'unicorn/no-confusing-array-with'?: Linter.RuleEntry<[]>
|
|
214
339
|
/**
|
|
215
340
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
216
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-console-spaces.md
|
|
217
342
|
*/
|
|
218
343
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
344
|
+
/**
|
|
345
|
+
* Disallow arithmetic and bitwise operations that always evaluate to `0`.
|
|
346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-constant-zero-expression.md
|
|
347
|
+
*/
|
|
348
|
+
'unicorn/no-constant-zero-expression'?: Linter.RuleEntry<[]>
|
|
349
|
+
/**
|
|
350
|
+
* Disallow declarations before conditional early exits when they are only used after the exit.
|
|
351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-declarations-before-early-exit.md
|
|
352
|
+
*/
|
|
353
|
+
'unicorn/no-declarations-before-early-exit'?: Linter.RuleEntry<[]>
|
|
219
354
|
/**
|
|
220
355
|
* Do not use `document.cookie` directly.
|
|
221
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-document-cookie.md
|
|
222
357
|
*/
|
|
223
358
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
359
|
+
/**
|
|
360
|
+
* Disallow two comparisons of the same operands that can be combined into one.
|
|
361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-double-comparison.md
|
|
362
|
+
*/
|
|
363
|
+
'unicorn/no-double-comparison'?: Linter.RuleEntry<[]>
|
|
364
|
+
/**
|
|
365
|
+
* Disallow duplicate adjacent branches in if chains.
|
|
366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-if-branches.md
|
|
367
|
+
*/
|
|
368
|
+
'unicorn/no-duplicate-if-branches'?: Linter.RuleEntry<[]>
|
|
369
|
+
/**
|
|
370
|
+
* Disallow adjacent duplicate operands in logical expressions.
|
|
371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-logical-operands.md
|
|
372
|
+
*/
|
|
373
|
+
'unicorn/no-duplicate-logical-operands'?: Linter.RuleEntry<[]>
|
|
374
|
+
/**
|
|
375
|
+
* Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.
|
|
376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-loops.md
|
|
377
|
+
*/
|
|
378
|
+
'unicorn/no-duplicate-loops'?: Linter.RuleEntry<[]>
|
|
224
379
|
/**
|
|
225
380
|
* Disallow duplicate values in `Set` constructor array literals.
|
|
226
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-duplicate-set-values.md
|
|
227
382
|
*/
|
|
228
383
|
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>
|
|
229
384
|
/**
|
|
230
385
|
* Disallow empty files.
|
|
231
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
386
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-empty-file.md
|
|
232
387
|
*/
|
|
233
388
|
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>
|
|
389
|
+
/**
|
|
390
|
+
* Disallow assigning to built-in error properties.
|
|
391
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-error-property-assignment.md
|
|
392
|
+
*/
|
|
393
|
+
'unicorn/no-error-property-assignment'?: Linter.RuleEntry<[]>
|
|
234
394
|
/**
|
|
235
395
|
* Disallow exports in scripts.
|
|
236
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
396
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-exports-in-scripts.md
|
|
237
397
|
*/
|
|
238
398
|
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>
|
|
399
|
+
/**
|
|
400
|
+
* Prefer `for…of` over the `forEach` method.
|
|
401
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-for-each.md
|
|
402
|
+
*/
|
|
403
|
+
'unicorn/no-for-each'?: Linter.RuleEntry<[]>
|
|
239
404
|
/**
|
|
240
405
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
241
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
406
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-for-loop.md
|
|
242
407
|
*/
|
|
243
408
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
244
409
|
/**
|
|
245
|
-
*
|
|
246
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
410
|
+
* Disallow assigning properties on the global object.
|
|
411
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-global-object-property-assignment.md
|
|
412
|
+
*/
|
|
413
|
+
'unicorn/no-global-object-property-assignment'?: Linter.RuleEntry<[]>
|
|
414
|
+
/**
|
|
415
|
+
* Replaced by `unicorn/prefer-unicode-code-point-escapes` which covers more cases.
|
|
416
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-hex-escape
|
|
417
|
+
* @deprecated
|
|
247
418
|
*/
|
|
248
419
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
249
420
|
/**
|
|
250
421
|
* Disallow immediate mutation after variable assignment.
|
|
251
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
422
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-immediate-mutation.md
|
|
252
423
|
*/
|
|
253
424
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>
|
|
425
|
+
/**
|
|
426
|
+
* Disallow impossible comparisons against `.length` or `.size`.
|
|
427
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-impossible-length-comparison.md
|
|
428
|
+
*/
|
|
429
|
+
'unicorn/no-impossible-length-comparison'?: Linter.RuleEntry<[]>
|
|
254
430
|
/**
|
|
255
431
|
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
256
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
432
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-incorrect-query-selector.md
|
|
257
433
|
*/
|
|
258
434
|
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>
|
|
435
|
+
/**
|
|
436
|
+
* Disallow incorrect template literal interpolation syntax.
|
|
437
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-incorrect-template-string-interpolation.md
|
|
438
|
+
*/
|
|
439
|
+
'unicorn/no-incorrect-template-string-interpolation'?: Linter.RuleEntry<[]>
|
|
259
440
|
/**
|
|
260
441
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
261
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
442
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
262
443
|
* @deprecated
|
|
263
444
|
*/
|
|
264
445
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
265
446
|
/**
|
|
266
447
|
* Disallow `instanceof` with built-in objects
|
|
267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
448
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-instanceof-builtins.md
|
|
268
449
|
*/
|
|
269
450
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
451
|
+
/**
|
|
452
|
+
* Disallow calling functions and constructors with an invalid number of arguments.
|
|
453
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-argument-count.md
|
|
454
|
+
*/
|
|
455
|
+
'unicorn/no-invalid-argument-count'?: Linter.RuleEntry<UnicornNoInvalidArgumentCount>
|
|
456
|
+
/**
|
|
457
|
+
* Disallow comparing a single character from a string to a multi-character string.
|
|
458
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-character-comparison.md
|
|
459
|
+
*/
|
|
460
|
+
'unicorn/no-invalid-character-comparison'?: Linter.RuleEntry<[]>
|
|
270
461
|
/**
|
|
271
462
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
463
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-fetch-options.md
|
|
273
464
|
*/
|
|
274
465
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
275
466
|
/**
|
|
276
467
|
* Disallow invalid `accept` values on file inputs.
|
|
277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
468
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-file-input-accept.md
|
|
278
469
|
*/
|
|
279
470
|
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>
|
|
280
471
|
/**
|
|
281
472
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
473
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
283
474
|
*/
|
|
284
475
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
285
476
|
/**
|
|
286
477
|
* Disallow identifiers starting with `new` or `class`.
|
|
287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
478
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-keyword-prefix.md
|
|
288
479
|
*/
|
|
289
480
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
290
481
|
/**
|
|
291
482
|
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
483
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-late-current-target-access.md
|
|
293
484
|
*/
|
|
294
485
|
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>
|
|
295
486
|
/**
|
|
296
487
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
488
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
298
489
|
* @deprecated
|
|
299
490
|
*/
|
|
300
491
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
301
492
|
/**
|
|
302
493
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
303
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
494
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-lonely-if.md
|
|
304
495
|
*/
|
|
305
496
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
497
|
+
/**
|
|
498
|
+
* Disallow mutating a loop iterable during iteration.
|
|
499
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-loop-iterable-mutation.md
|
|
500
|
+
*/
|
|
501
|
+
'unicorn/no-loop-iterable-mutation'?: Linter.RuleEntry<[]>
|
|
306
502
|
/**
|
|
307
503
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
308
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
504
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
309
505
|
*/
|
|
310
506
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
311
507
|
/**
|
|
312
508
|
* Disallow manually wrapped comments.
|
|
313
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
509
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-manually-wrapped-comments.md
|
|
314
510
|
*/
|
|
315
511
|
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>
|
|
512
|
+
/**
|
|
513
|
+
* Disallow checking a Map key before accessing a different key.
|
|
514
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-mismatched-map-key.md
|
|
515
|
+
*/
|
|
516
|
+
'unicorn/no-mismatched-map-key'?: Linter.RuleEntry<[]>
|
|
517
|
+
/**
|
|
518
|
+
* Disallow misrefactored compound assignments where the target is duplicated in the right-hand side.
|
|
519
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-misrefactored-assignment.md
|
|
520
|
+
*/
|
|
521
|
+
'unicorn/no-misrefactored-assignment'?: Linter.RuleEntry<[]>
|
|
316
522
|
/**
|
|
317
523
|
* Disallow named usage of default import and export.
|
|
318
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
524
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-named-default.md
|
|
319
525
|
*/
|
|
320
526
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
527
|
+
/**
|
|
528
|
+
* Disallow negated array predicate calls.
|
|
529
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-array-predicate.md
|
|
530
|
+
*/
|
|
531
|
+
'unicorn/no-negated-array-predicate'?: Linter.RuleEntry<[]>
|
|
532
|
+
/**
|
|
533
|
+
* Disallow negated comparisons.
|
|
534
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-comparison.md
|
|
535
|
+
*/
|
|
536
|
+
'unicorn/no-negated-comparison'?: Linter.RuleEntry<UnicornNoNegatedComparison>
|
|
321
537
|
/**
|
|
322
538
|
* Disallow negated conditions.
|
|
323
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
539
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negated-condition.md
|
|
324
540
|
*/
|
|
325
541
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
326
542
|
/**
|
|
327
543
|
* Disallow negated expression in equality check.
|
|
328
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
544
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-negation-in-equality-check.md
|
|
329
545
|
*/
|
|
330
546
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
331
547
|
/**
|
|
332
548
|
* Disallow nested ternary expressions.
|
|
333
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
549
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-nested-ternary.md
|
|
334
550
|
*/
|
|
335
551
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
336
552
|
/**
|
|
337
553
|
* Disallow `new Array()`.
|
|
338
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
554
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-new-array.md
|
|
339
555
|
*/
|
|
340
556
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
341
557
|
/**
|
|
342
558
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
343
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
559
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-new-buffer.md
|
|
344
560
|
*/
|
|
345
561
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
562
|
+
/**
|
|
563
|
+
* Disallow non-function values with function-style verb prefixes.
|
|
564
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-non-function-verb-prefix.md
|
|
565
|
+
*/
|
|
566
|
+
'unicorn/no-non-function-verb-prefix'?: Linter.RuleEntry<UnicornNoNonFunctionVerbPrefix>
|
|
567
|
+
/**
|
|
568
|
+
* Disallow non-standard properties on built-in objects.
|
|
569
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-nonstandard-builtin-properties.md
|
|
570
|
+
*/
|
|
571
|
+
'unicorn/no-nonstandard-builtin-properties'?: Linter.RuleEntry<[]>
|
|
346
572
|
/**
|
|
347
573
|
* Disallow the use of the `null` literal.
|
|
348
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
574
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-null.md
|
|
349
575
|
*/
|
|
350
576
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
351
577
|
/**
|
|
352
578
|
* Disallow the use of objects as default parameters.
|
|
353
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
579
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-object-as-default-parameter.md
|
|
354
580
|
*/
|
|
355
581
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
582
|
+
/**
|
|
583
|
+
* Disallow `Object` methods with `Map` or `Set`.
|
|
584
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-object-methods-with-collections.md
|
|
585
|
+
*/
|
|
586
|
+
'unicorn/no-object-methods-with-collections'?: Linter.RuleEntry<[]>
|
|
587
|
+
/**
|
|
588
|
+
* Disallow optional chaining on undeclared variables.
|
|
589
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-optional-chaining-on-undeclared-variable.md
|
|
590
|
+
*/
|
|
591
|
+
'unicorn/no-optional-chaining-on-undeclared-variable'?: Linter.RuleEntry<[]>
|
|
356
592
|
/**
|
|
357
593
|
* Disallow `process.exit()`.
|
|
358
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
594
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-process-exit.md
|
|
359
595
|
*/
|
|
360
596
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
597
|
+
/**
|
|
598
|
+
* Disallow comparisons made redundant by an equality check in the same logical AND.
|
|
599
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-redundant-comparison.md
|
|
600
|
+
*/
|
|
601
|
+
'unicorn/no-redundant-comparison'?: Linter.RuleEntry<[]>
|
|
602
|
+
/**
|
|
603
|
+
* Disallow using the return value of `Array#push()` and `Array#unshift()`.
|
|
604
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-return-array-push.md
|
|
605
|
+
*/
|
|
606
|
+
'unicorn/no-return-array-push'?: Linter.RuleEntry<[]>
|
|
607
|
+
/**
|
|
608
|
+
* Disallow selector syntax in DOM names.
|
|
609
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-selector-as-dom-name.md
|
|
610
|
+
*/
|
|
611
|
+
'unicorn/no-selector-as-dom-name'?: Linter.RuleEntry<[]>
|
|
361
612
|
/**
|
|
362
613
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
363
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
614
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
364
615
|
*/
|
|
365
616
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
366
617
|
/**
|
|
367
618
|
* Disallow classes that only have static members.
|
|
368
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
619
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-static-only-class.md
|
|
369
620
|
*/
|
|
370
621
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
622
|
+
/**
|
|
623
|
+
* Prefer comparing values directly over subtracting and comparing to `0`.
|
|
624
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-subtraction-comparison.md
|
|
625
|
+
*/
|
|
626
|
+
'unicorn/no-subtraction-comparison'?: Linter.RuleEntry<[]>
|
|
371
627
|
/**
|
|
372
628
|
* Disallow `then` property.
|
|
373
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
629
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-thenable.md
|
|
374
630
|
*/
|
|
375
631
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
376
632
|
/**
|
|
377
633
|
* Disallow assigning `this` to a variable.
|
|
378
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
634
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-this-assignment.md
|
|
379
635
|
*/
|
|
380
636
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
381
637
|
/**
|
|
382
638
|
* Disallow `this` outside of classes.
|
|
383
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
639
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-this-outside-of-class.md
|
|
384
640
|
*/
|
|
385
641
|
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>
|
|
642
|
+
/**
|
|
643
|
+
* Disallow assigning to top-level variables from inside functions.
|
|
644
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-top-level-assignment-in-function.md
|
|
645
|
+
*/
|
|
646
|
+
'unicorn/no-top-level-assignment-in-function'?: Linter.RuleEntry<[]>
|
|
647
|
+
/**
|
|
648
|
+
* Disallow top-level side effects in exported modules.
|
|
649
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-top-level-side-effects.md
|
|
650
|
+
*/
|
|
651
|
+
'unicorn/no-top-level-side-effects'?: Linter.RuleEntry<[]>
|
|
386
652
|
/**
|
|
387
653
|
* Disallow comparing `undefined` using `typeof`.
|
|
388
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
654
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-typeof-undefined.md
|
|
389
655
|
*/
|
|
390
656
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
657
|
+
/**
|
|
658
|
+
* Disallow referencing methods without calling them.
|
|
659
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-uncalled-method.md
|
|
660
|
+
*/
|
|
661
|
+
'unicorn/no-uncalled-method'?: Linter.RuleEntry<[]>
|
|
662
|
+
/**
|
|
663
|
+
* Require class members to be declared.
|
|
664
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-undeclared-class-members.md
|
|
665
|
+
*/
|
|
666
|
+
'unicorn/no-undeclared-class-members'?: Linter.RuleEntry<[]>
|
|
391
667
|
/**
|
|
392
668
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
393
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
669
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
394
670
|
*/
|
|
395
671
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
396
672
|
/**
|
|
397
673
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
398
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
674
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
399
675
|
*/
|
|
400
676
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
401
677
|
/**
|
|
402
678
|
* Disallow awaiting non-promise values.
|
|
403
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
679
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-await.md
|
|
404
680
|
*/
|
|
405
681
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
682
|
+
/**
|
|
683
|
+
* Disallow unnecessary comparisons against boolean literals.
|
|
684
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-boolean-comparison.md
|
|
685
|
+
*/
|
|
686
|
+
'unicorn/no-unnecessary-boolean-comparison'?: Linter.RuleEntry<[]>
|
|
687
|
+
/**
|
|
688
|
+
* Disallow unnecessary `globalThis` references.
|
|
689
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-global-this.md
|
|
690
|
+
*/
|
|
691
|
+
'unicorn/no-unnecessary-global-this'?: Linter.RuleEntry<[]>
|
|
406
692
|
/**
|
|
407
693
|
* Disallow unnecessary nested ternary expressions.
|
|
408
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
694
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-nested-ternary.md
|
|
409
695
|
*/
|
|
410
696
|
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>
|
|
411
697
|
/**
|
|
412
698
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
413
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
699
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
414
700
|
*/
|
|
415
701
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
416
702
|
/**
|
|
417
703
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
418
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
704
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
419
705
|
*/
|
|
420
706
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
707
|
+
/**
|
|
708
|
+
* Disallow `Array#splice()` when simpler alternatives exist.
|
|
709
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unnecessary-splice.md
|
|
710
|
+
*/
|
|
711
|
+
'unicorn/no-unnecessary-splice'?: Linter.RuleEntry<[]>
|
|
421
712
|
/**
|
|
422
713
|
* Disallow unreadable array destructuring.
|
|
423
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
714
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
715
|
+
*/
|
|
716
|
+
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<UnicornNoUnreadableArrayDestructuring>
|
|
717
|
+
/**
|
|
718
|
+
* Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
|
|
719
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-for-of-expression.md
|
|
424
720
|
*/
|
|
425
|
-
'unicorn/no-unreadable-
|
|
721
|
+
'unicorn/no-unreadable-for-of-expression'?: Linter.RuleEntry<[]>
|
|
426
722
|
/**
|
|
427
723
|
* Disallow unreadable IIFEs.
|
|
428
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
724
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-iife.md
|
|
429
725
|
*/
|
|
430
726
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
727
|
+
/**
|
|
728
|
+
* Disallow unreadable `new` expressions.
|
|
729
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-new-expression.md
|
|
730
|
+
*/
|
|
731
|
+
'unicorn/no-unreadable-new-expression'?: Linter.RuleEntry<[]>
|
|
732
|
+
/**
|
|
733
|
+
* Disallow unreadable object destructuring.
|
|
734
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unreadable-object-destructuring.md
|
|
735
|
+
*/
|
|
736
|
+
'unicorn/no-unreadable-object-destructuring'?: Linter.RuleEntry<[]>
|
|
737
|
+
/**
|
|
738
|
+
* Prevent unsafe use of ArrayBuffer view `.buffer`.
|
|
739
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-buffer-conversion.md
|
|
740
|
+
*/
|
|
741
|
+
'unicorn/no-unsafe-buffer-conversion'?: Linter.RuleEntry<[]>
|
|
742
|
+
/**
|
|
743
|
+
* Disallow unsafe DOM HTML APIs.
|
|
744
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-dom-html.md
|
|
745
|
+
*/
|
|
746
|
+
'unicorn/no-unsafe-dom-html'?: Linter.RuleEntry<[]>
|
|
747
|
+
/**
|
|
748
|
+
* Disallow unsafe values as property keys.
|
|
749
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-property-key.md
|
|
750
|
+
*/
|
|
751
|
+
'unicorn/no-unsafe-property-key'?: Linter.RuleEntry<[]>
|
|
752
|
+
/**
|
|
753
|
+
* Disallow non-literal replacement values in `String#replace()` and `String#replaceAll()`.
|
|
754
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unsafe-string-replacement.md
|
|
755
|
+
*/
|
|
756
|
+
'unicorn/no-unsafe-string-replacement'?: Linter.RuleEntry<[]>
|
|
431
757
|
/**
|
|
432
758
|
* Disallow ignoring the return value of selected array methods.
|
|
433
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
759
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unused-array-method-return.md
|
|
434
760
|
*/
|
|
435
761
|
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>
|
|
436
762
|
/**
|
|
437
763
|
* Disallow unused object properties.
|
|
438
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
764
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-unused-properties.md
|
|
439
765
|
*/
|
|
440
766
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
767
|
+
/**
|
|
768
|
+
* Disallow unnecessary `Boolean()` casts in array predicate callbacks.
|
|
769
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-boolean-cast.md
|
|
770
|
+
*/
|
|
771
|
+
'unicorn/no-useless-boolean-cast'?: Linter.RuleEntry<[]>
|
|
772
|
+
/**
|
|
773
|
+
* Disallow useless type coercions of values that are already of the target type.
|
|
774
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-coercion.md
|
|
775
|
+
*/
|
|
776
|
+
'unicorn/no-useless-coercion'?: Linter.RuleEntry<[]>
|
|
441
777
|
/**
|
|
442
778
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
443
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
779
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-collection-argument.md
|
|
444
780
|
*/
|
|
445
781
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>
|
|
782
|
+
/**
|
|
783
|
+
* Disallow useless compound assignments such as `x += 0`.
|
|
784
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-compound-assignment.md
|
|
785
|
+
*/
|
|
786
|
+
'unicorn/no-useless-compound-assignment'?: Linter.RuleEntry<[]>
|
|
787
|
+
/**
|
|
788
|
+
* Disallow useless concatenation of literals.
|
|
789
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-concat.md
|
|
790
|
+
*/
|
|
791
|
+
'unicorn/no-useless-concat'?: Linter.RuleEntry<[]>
|
|
792
|
+
/**
|
|
793
|
+
* Disallow useless `continue` statements.
|
|
794
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-continue.md
|
|
795
|
+
*/
|
|
796
|
+
'unicorn/no-useless-continue'?: Linter.RuleEntry<[]>
|
|
797
|
+
/**
|
|
798
|
+
* Disallow unnecessary existence checks before deletion.
|
|
799
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-delete-check.md
|
|
800
|
+
*/
|
|
801
|
+
'unicorn/no-useless-delete-check'?: Linter.RuleEntry<[]>
|
|
802
|
+
/**
|
|
803
|
+
* Disallow `else` after a statement that exits.
|
|
804
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-else.md
|
|
805
|
+
*/
|
|
806
|
+
'unicorn/no-useless-else'?: Linter.RuleEntry<[]>
|
|
446
807
|
/**
|
|
447
808
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
448
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
809
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
449
810
|
*/
|
|
450
811
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
451
812
|
/**
|
|
452
813
|
* Disallow useless fallback when spreading in object literals.
|
|
453
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
814
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
454
815
|
*/
|
|
455
816
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
456
817
|
/**
|
|
457
818
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
458
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
819
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-iterator-to-array.md
|
|
459
820
|
*/
|
|
460
821
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>
|
|
461
822
|
/**
|
|
462
823
|
* Disallow useless array length check.
|
|
463
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
824
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-length-check.md
|
|
464
825
|
*/
|
|
465
826
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
827
|
+
/**
|
|
828
|
+
* Disallow unnecessary operands in logical expressions involving boolean literals.
|
|
829
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-logical-operand.md
|
|
830
|
+
*/
|
|
831
|
+
'unicorn/no-useless-logical-operand'?: Linter.RuleEntry<[]>
|
|
832
|
+
/**
|
|
833
|
+
* Disallow useless overrides of class methods.
|
|
834
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-override.md
|
|
835
|
+
*/
|
|
836
|
+
'unicorn/no-useless-override'?: Linter.RuleEntry<[]>
|
|
466
837
|
/**
|
|
467
838
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
468
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
839
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
469
840
|
*/
|
|
470
841
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
842
|
+
/**
|
|
843
|
+
* Disallow simple recursive function calls that can be replaced with a loop.
|
|
844
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-recursion.md
|
|
845
|
+
*/
|
|
846
|
+
'unicorn/no-useless-recursion'?: Linter.RuleEntry<[]>
|
|
471
847
|
/**
|
|
472
848
|
* Disallow unnecessary spread.
|
|
473
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
849
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-spread.md
|
|
474
850
|
*/
|
|
475
851
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
476
852
|
/**
|
|
477
853
|
* Disallow useless case in switch statements.
|
|
478
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
854
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-switch-case.md
|
|
479
855
|
*/
|
|
480
856
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
857
|
+
/**
|
|
858
|
+
* Disallow useless template literal expressions.
|
|
859
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-template-literals.md
|
|
860
|
+
*/
|
|
861
|
+
'unicorn/no-useless-template-literals'?: Linter.RuleEntry<[]>
|
|
481
862
|
/**
|
|
482
863
|
* Disallow useless `undefined`.
|
|
483
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
864
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-useless-undefined.md
|
|
484
865
|
*/
|
|
485
866
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
867
|
+
/**
|
|
868
|
+
* Disallow the bitwise XOR operator where exponentiation was likely intended.
|
|
869
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-xor-as-exponentiation.md
|
|
870
|
+
*/
|
|
871
|
+
'unicorn/no-xor-as-exponentiation'?: Linter.RuleEntry<[]>
|
|
486
872
|
/**
|
|
487
873
|
* Disallow number literals with zero fractions or dangling dots.
|
|
488
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
874
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/no-zero-fractions.md
|
|
489
875
|
*/
|
|
490
876
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
491
877
|
/**
|
|
492
878
|
* Enforce proper case for numeric literals.
|
|
493
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
879
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/number-literal-case.md
|
|
494
880
|
*/
|
|
495
881
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
496
882
|
/**
|
|
497
883
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
498
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
884
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/numeric-separators-style.md
|
|
499
885
|
*/
|
|
500
886
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
887
|
+
/**
|
|
888
|
+
* Require assignment operator shorthand where possible.
|
|
889
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/operator-assignment.md
|
|
890
|
+
*/
|
|
891
|
+
'unicorn/operator-assignment'?: Linter.RuleEntry<UnicornOperatorAssignment>
|
|
501
892
|
/**
|
|
502
893
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
503
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
894
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-add-event-listener.md
|
|
504
895
|
*/
|
|
505
896
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
897
|
+
/**
|
|
898
|
+
* Prefer an options object over a boolean in `.addEventListener()`.
|
|
899
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-add-event-listener-options.md
|
|
900
|
+
*/
|
|
901
|
+
'unicorn/prefer-add-event-listener-options'?: Linter.RuleEntry<[]>
|
|
506
902
|
/**
|
|
507
903
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
508
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
904
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-find.md
|
|
509
905
|
*/
|
|
510
906
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
511
907
|
/**
|
|
512
908
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
513
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
909
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-flat.md
|
|
514
910
|
*/
|
|
515
911
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
516
912
|
/**
|
|
517
|
-
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
518
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
913
|
+
* Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.
|
|
914
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-flat-map.md
|
|
519
915
|
*/
|
|
520
916
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
917
|
+
/**
|
|
918
|
+
* Prefer `Array.fromAsync()` over `for await…of` array accumulation.
|
|
919
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-from-async.md
|
|
920
|
+
*/
|
|
921
|
+
'unicorn/prefer-array-from-async'?: Linter.RuleEntry<[]>
|
|
922
|
+
/**
|
|
923
|
+
* Prefer using the `Array.from()` mapping function argument.
|
|
924
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-from-map.md
|
|
925
|
+
*/
|
|
926
|
+
'unicorn/prefer-array-from-map'?: Linter.RuleEntry<[]>
|
|
521
927
|
/**
|
|
522
928
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
523
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
929
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-index-of.md
|
|
524
930
|
*/
|
|
525
931
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
932
|
+
/**
|
|
933
|
+
* Prefer iterating an array directly or with `Array#keys()` over `Array#entries()` when the index or value is unused.
|
|
934
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-iterable-methods.md
|
|
935
|
+
*/
|
|
936
|
+
'unicorn/prefer-array-iterable-methods'?: Linter.RuleEntry<[]>
|
|
526
937
|
/**
|
|
527
938
|
* Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
|
|
528
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
939
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-last-methods.md
|
|
529
940
|
*/
|
|
530
941
|
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>
|
|
942
|
+
/**
|
|
943
|
+
* Prefer `Array#slice()` over `Array#splice()` when reading from the returned array.
|
|
944
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-slice.md
|
|
945
|
+
*/
|
|
946
|
+
'unicorn/prefer-array-slice'?: Linter.RuleEntry<[]>
|
|
531
947
|
/**
|
|
532
948
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
533
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
949
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-array-some.md
|
|
534
950
|
*/
|
|
535
951
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
536
952
|
/**
|
|
537
953
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
538
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
954
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-at.md
|
|
539
955
|
*/
|
|
540
956
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
957
|
+
/**
|
|
958
|
+
* Prefer `await` over promise chaining.
|
|
959
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-await.md
|
|
960
|
+
*/
|
|
961
|
+
'unicorn/prefer-await'?: Linter.RuleEntry<[]>
|
|
541
962
|
/**
|
|
542
963
|
* Prefer `BigInt` literals over the constructor.
|
|
543
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
964
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-bigint-literals.md
|
|
544
965
|
*/
|
|
545
966
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>
|
|
546
967
|
/**
|
|
547
968
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
548
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
969
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
549
970
|
*/
|
|
550
971
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
972
|
+
/**
|
|
973
|
+
* Prefer directly returning boolean expressions over `if` statements.
|
|
974
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-boolean-return.md
|
|
975
|
+
*/
|
|
976
|
+
'unicorn/prefer-boolean-return'?: Linter.RuleEntry<[]>
|
|
551
977
|
/**
|
|
552
978
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
553
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
979
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-class-fields.md
|
|
554
980
|
*/
|
|
555
981
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>
|
|
556
982
|
/**
|
|
557
983
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
558
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
984
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-classlist-toggle.md
|
|
559
985
|
*/
|
|
560
986
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>
|
|
561
987
|
/**
|
|
562
988
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
563
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
989
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-code-point.md
|
|
564
990
|
*/
|
|
565
991
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
992
|
+
/**
|
|
993
|
+
* Prefer early continues over whole-loop conditional wrapping.
|
|
994
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-continue.md
|
|
995
|
+
*/
|
|
996
|
+
'unicorn/prefer-continue'?: Linter.RuleEntry<UnicornPreferContinue>
|
|
566
997
|
/**
|
|
567
998
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
568
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
999
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-date-now.md
|
|
569
1000
|
*/
|
|
570
1001
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
571
1002
|
/**
|
|
572
1003
|
* Prefer default parameters over reassignment.
|
|
573
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1004
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-default-parameters.md
|
|
574
1005
|
*/
|
|
575
1006
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
1007
|
+
/**
|
|
1008
|
+
* Prefer direct iteration over default iterator method calls.
|
|
1009
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-direct-iteration.md
|
|
1010
|
+
*/
|
|
1011
|
+
'unicorn/prefer-direct-iteration'?: Linter.RuleEntry<[]>
|
|
1012
|
+
/**
|
|
1013
|
+
* Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
|
|
1014
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dispose.md
|
|
1015
|
+
*/
|
|
1016
|
+
'unicorn/prefer-dispose'?: Linter.RuleEntry<[]>
|
|
576
1017
|
/**
|
|
577
1018
|
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
578
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1019
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-append.md
|
|
579
1020
|
*/
|
|
580
1021
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
581
1022
|
/**
|
|
582
1023
|
* Renamed to `unicorn/dom-node-dataset`.
|
|
583
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1024
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
584
1025
|
* @deprecated
|
|
585
1026
|
*/
|
|
586
1027
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
1028
|
+
/**
|
|
1029
|
+
* Prefer `.getHTML()` and `.setHTML()` over `.innerHTML`.
|
|
1030
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-html-methods.md
|
|
1031
|
+
*/
|
|
1032
|
+
'unicorn/prefer-dom-node-html-methods'?: Linter.RuleEntry<[]>
|
|
587
1033
|
/**
|
|
588
1034
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
589
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1035
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-remove.md
|
|
590
1036
|
*/
|
|
591
1037
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
592
1038
|
/**
|
|
593
1039
|
* Prefer `.textContent` over `.innerText`.
|
|
594
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1040
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
595
1041
|
*/
|
|
596
1042
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
1043
|
+
/**
|
|
1044
|
+
* Prefer early returns over full-function conditional wrapping.
|
|
1045
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-early-return.md
|
|
1046
|
+
*/
|
|
1047
|
+
'unicorn/prefer-early-return'?: Linter.RuleEntry<UnicornPreferEarlyReturn>
|
|
1048
|
+
/**
|
|
1049
|
+
* Prefer `else if` over adjacent `if` statements with related conditions.
|
|
1050
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-else-if.md
|
|
1051
|
+
*/
|
|
1052
|
+
'unicorn/prefer-else-if'?: Linter.RuleEntry<[]>
|
|
597
1053
|
/**
|
|
598
1054
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
599
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1055
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-event-target.md
|
|
600
1056
|
*/
|
|
601
1057
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
602
1058
|
/**
|
|
603
1059
|
* Prefer `export…from` when re-exporting.
|
|
604
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1060
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-export-from.md
|
|
605
1061
|
*/
|
|
606
1062
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
1063
|
+
/**
|
|
1064
|
+
* Prefer flat `Math.min()` and `Math.max()` calls over nested calls.
|
|
1065
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-flat-math-min-max.md
|
|
1066
|
+
*/
|
|
1067
|
+
'unicorn/prefer-flat-math-min-max'?: Linter.RuleEntry<[]>
|
|
607
1068
|
/**
|
|
608
1069
|
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
609
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1070
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-get-or-insert-computed.md
|
|
610
1071
|
*/
|
|
611
1072
|
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>
|
|
1073
|
+
/**
|
|
1074
|
+
* Prefer global numeric constants over `Number` static properties.
|
|
1075
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-global-number-constants.md
|
|
1076
|
+
*/
|
|
1077
|
+
'unicorn/prefer-global-number-constants'?: Linter.RuleEntry<[]>
|
|
612
1078
|
/**
|
|
613
1079
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
614
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1080
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-global-this.md
|
|
615
1081
|
*/
|
|
616
1082
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
1083
|
+
/**
|
|
1084
|
+
* Prefer `.has()` when checking existence.
|
|
1085
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-has-check.md
|
|
1086
|
+
*/
|
|
1087
|
+
'unicorn/prefer-has-check'?: Linter.RuleEntry<[]>
|
|
1088
|
+
/**
|
|
1089
|
+
* Prefer moving code shared by all branches of an `if` statement out of the branches.
|
|
1090
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-hoisting-branch-code.md
|
|
1091
|
+
*/
|
|
1092
|
+
'unicorn/prefer-hoisting-branch-code'?: Linter.RuleEntry<[]>
|
|
617
1093
|
/**
|
|
618
1094
|
* Prefer HTTPS over HTTP.
|
|
619
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1095
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-https.md
|
|
620
1096
|
*/
|
|
621
1097
|
'unicorn/prefer-https'?: Linter.RuleEntry<[]>
|
|
1098
|
+
/**
|
|
1099
|
+
* Prefer identifiers over string literals in import and export specifiers.
|
|
1100
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-identifier-import-export-specifiers.md
|
|
1101
|
+
*/
|
|
1102
|
+
'unicorn/prefer-identifier-import-export-specifiers'?: Linter.RuleEntry<[]>
|
|
622
1103
|
/**
|
|
623
1104
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
624
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1105
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-import-meta-properties.md
|
|
625
1106
|
*/
|
|
626
1107
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
627
1108
|
/**
|
|
628
1109
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
629
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1110
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-includes.md
|
|
630
1111
|
*/
|
|
631
1112
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
632
1113
|
/**
|
|
633
1114
|
* Prefer `.includes()` over repeated equality comparisons.
|
|
634
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
635
1116
|
*/
|
|
636
1117
|
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>
|
|
1118
|
+
/**
|
|
1119
|
+
* Prefer passing iterables directly to constructors instead of filling empty collections.
|
|
1120
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterable-in-constructor.md
|
|
1121
|
+
*/
|
|
1122
|
+
'unicorn/prefer-iterable-in-constructor'?: Linter.RuleEntry<[]>
|
|
637
1123
|
/**
|
|
638
1124
|
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
639
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-concat.md
|
|
640
1126
|
*/
|
|
641
1127
|
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>
|
|
1128
|
+
/**
|
|
1129
|
+
* Prefer `Iterator#toArray()` over temporary arrays from iterator spreads.
|
|
1130
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-to-array.md
|
|
1131
|
+
*/
|
|
1132
|
+
'unicorn/prefer-iterator-to-array'?: Linter.RuleEntry<[]>
|
|
642
1133
|
/**
|
|
643
1134
|
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
644
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-iterator-to-array-at-end.md
|
|
645
1136
|
*/
|
|
646
1137
|
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>
|
|
647
1138
|
/**
|
|
648
1139
|
* Renamed to `unicorn/consistent-json-file-read`.
|
|
649
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
650
1141
|
* @deprecated
|
|
651
1142
|
*/
|
|
652
1143
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
653
1144
|
/**
|
|
654
1145
|
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
655
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1146
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
656
1147
|
*/
|
|
657
1148
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
1149
|
+
/**
|
|
1150
|
+
* Prefer `location.assign()` over assigning to `location.href`.
|
|
1151
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-location-assign.md
|
|
1152
|
+
*/
|
|
1153
|
+
'unicorn/prefer-location-assign'?: Linter.RuleEntry<[]>
|
|
658
1154
|
/**
|
|
659
1155
|
* Prefer using a logical operator over a ternary.
|
|
660
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1156
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
661
1157
|
*/
|
|
662
1158
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
1159
|
+
/**
|
|
1160
|
+
* Prefer `new Map()` over `Object.fromEntries()` when using the result as a map.
|
|
1161
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-map-from-entries.md
|
|
1162
|
+
*/
|
|
1163
|
+
'unicorn/prefer-map-from-entries'?: Linter.RuleEntry<[]>
|
|
663
1164
|
/**
|
|
664
1165
|
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
665
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1166
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-abs.md
|
|
666
1167
|
*/
|
|
667
1168
|
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>
|
|
1169
|
+
/**
|
|
1170
|
+
* Prefer `Math` constants over their approximate numeric values.
|
|
1171
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-constants.md
|
|
1172
|
+
*/
|
|
1173
|
+
'unicorn/prefer-math-constants'?: Linter.RuleEntry<[]>
|
|
668
1174
|
/**
|
|
669
1175
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
670
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1176
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-min-max.md
|
|
671
1177
|
*/
|
|
672
1178
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
673
1179
|
/**
|
|
674
|
-
*
|
|
675
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1180
|
+
* Prefer `Math.trunc()` for truncating numbers.
|
|
1181
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-math-trunc.md
|
|
676
1182
|
*/
|
|
677
1183
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
678
1184
|
/**
|
|
679
|
-
* Prefer
|
|
680
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1185
|
+
* Prefer moving ternaries into the minimal varying part of an expression.
|
|
1186
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-minimal-ternary.md
|
|
1187
|
+
*/
|
|
1188
|
+
'unicorn/prefer-minimal-ternary'?: Linter.RuleEntry<UnicornPreferMinimalTernary>
|
|
1189
|
+
/**
|
|
1190
|
+
* Prefer modern DOM APIs.
|
|
1191
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
681
1192
|
*/
|
|
682
1193
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
683
1194
|
/**
|
|
684
1195
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
685
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-modern-math-apis.md
|
|
686
1197
|
*/
|
|
687
1198
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
688
1199
|
/**
|
|
689
1200
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
690
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-module.md
|
|
691
1202
|
*/
|
|
692
1203
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
693
1204
|
/**
|
|
694
1205
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
695
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
696
1207
|
*/
|
|
697
1208
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
698
1209
|
/**
|
|
699
1210
|
* Prefer negative index over `.length - index` when possible.
|
|
700
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-negative-index.md
|
|
701
1212
|
*/
|
|
702
1213
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
703
1214
|
/**
|
|
704
1215
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
705
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-node-protocol.md
|
|
706
1217
|
*/
|
|
707
1218
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
708
1219
|
/**
|
|
709
|
-
* Prefer `Number`
|
|
710
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1220
|
+
* Prefer `Number()` over `parseFloat()` and base-10 `parseInt()`.
|
|
1221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-coercion.md
|
|
1222
|
+
*/
|
|
1223
|
+
'unicorn/prefer-number-coercion'?: Linter.RuleEntry<[]>
|
|
1224
|
+
/**
|
|
1225
|
+
* Prefer `Number.isSafeInteger()` over integer checks.
|
|
1226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-is-safe-integer.md
|
|
1227
|
+
*/
|
|
1228
|
+
'unicorn/prefer-number-is-safe-integer'?: Linter.RuleEntry<[]>
|
|
1229
|
+
/**
|
|
1230
|
+
* Prefer `Number` static methods over global functions and optionally static properties over global constants.
|
|
1231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-number-properties.md
|
|
711
1232
|
*/
|
|
712
1233
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
1234
|
+
/**
|
|
1235
|
+
* Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.
|
|
1236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-define-properties.md
|
|
1237
|
+
*/
|
|
1238
|
+
'unicorn/prefer-object-define-properties'?: Linter.RuleEntry<[]>
|
|
1239
|
+
/**
|
|
1240
|
+
* Prefer object destructuring defaults over default object literals with spread.
|
|
1241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-destructuring-defaults.md
|
|
1242
|
+
*/
|
|
1243
|
+
'unicorn/prefer-object-destructuring-defaults'?: Linter.RuleEntry<[]>
|
|
713
1244
|
/**
|
|
714
1245
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
715
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1246
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-from-entries.md
|
|
716
1247
|
*/
|
|
717
1248
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
1249
|
+
/**
|
|
1250
|
+
* Prefer the most specific `Object` iterable method.
|
|
1251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-object-iterable-methods.md
|
|
1252
|
+
*/
|
|
1253
|
+
'unicorn/prefer-object-iterable-methods'?: Linter.RuleEntry<[]>
|
|
718
1254
|
/**
|
|
719
1255
|
* Prefer omitting the `catch` binding parameter.
|
|
720
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
721
1257
|
*/
|
|
722
1258
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
1259
|
+
/**
|
|
1260
|
+
* Prefer `Path2D` for repeatedly drawn canvas paths.
|
|
1261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-path2d.md
|
|
1262
|
+
*/
|
|
1263
|
+
'unicorn/prefer-path2d'?: Linter.RuleEntry<[]>
|
|
1264
|
+
/**
|
|
1265
|
+
* Prefer private class fields over the underscore-prefix convention.
|
|
1266
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-private-class-fields.md
|
|
1267
|
+
*/
|
|
1268
|
+
'unicorn/prefer-private-class-fields'?: Linter.RuleEntry<[]>
|
|
1269
|
+
/**
|
|
1270
|
+
* Prefer `Promise.withResolvers()` when extracting resolver functions from `new Promise()`.
|
|
1271
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-promise-with-resolvers.md
|
|
1272
|
+
*/
|
|
1273
|
+
'unicorn/prefer-promise-with-resolvers'?: Linter.RuleEntry<[]>
|
|
723
1274
|
/**
|
|
724
1275
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
725
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1276
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-prototype-methods.md
|
|
726
1277
|
*/
|
|
727
1278
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
728
1279
|
/**
|
|
729
1280
|
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
730
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1281
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-query-selector.md
|
|
731
1282
|
*/
|
|
732
1283
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>
|
|
733
1284
|
/**
|
|
734
1285
|
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
735
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1286
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-queue-microtask.md
|
|
736
1287
|
*/
|
|
737
1288
|
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>
|
|
738
1289
|
/**
|
|
739
1290
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
740
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1291
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-reflect-apply.md
|
|
741
1292
|
*/
|
|
742
1293
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
743
1294
|
/**
|
|
744
|
-
* Prefer `RegExp
|
|
745
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1295
|
+
* Prefer `RegExp.escape()` for escaping strings to use in regular expressions.
|
|
1296
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-regexp-escape.md
|
|
1297
|
+
*/
|
|
1298
|
+
'unicorn/prefer-regexp-escape'?: Linter.RuleEntry<[]>
|
|
1299
|
+
/**
|
|
1300
|
+
* Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.
|
|
1301
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-regexp-test.md
|
|
746
1302
|
*/
|
|
747
1303
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
748
1304
|
/**
|
|
749
1305
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
750
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1306
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-response-static-json.md
|
|
751
1307
|
*/
|
|
752
1308
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>
|
|
1309
|
+
/**
|
|
1310
|
+
* Prefer `:scope` when using element query selector methods.
|
|
1311
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-scoped-selector.md
|
|
1312
|
+
*/
|
|
1313
|
+
'unicorn/prefer-scoped-selector'?: Linter.RuleEntry<[]>
|
|
753
1314
|
/**
|
|
754
1315
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
755
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1316
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-set-has.md
|
|
756
1317
|
*/
|
|
757
1318
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>
|
|
758
1319
|
/**
|
|
759
1320
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
760
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1321
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-set-size.md
|
|
761
1322
|
*/
|
|
762
1323
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
1324
|
+
/**
|
|
1325
|
+
* Prefer arrow function properties over methods with a single return.
|
|
1326
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-short-arrow-method.md
|
|
1327
|
+
*/
|
|
1328
|
+
'unicorn/prefer-short-arrow-method'?: Linter.RuleEntry<[]>
|
|
763
1329
|
/**
|
|
764
1330
|
* Prefer simple conditions first in logical expressions.
|
|
765
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1331
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-simple-condition-first.md
|
|
766
1332
|
*/
|
|
767
1333
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>
|
|
1334
|
+
/**
|
|
1335
|
+
* Prefer a simple comparison function for `Array#sort()`.
|
|
1336
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-simple-sort-comparator.md
|
|
1337
|
+
*/
|
|
1338
|
+
'unicorn/prefer-simple-sort-comparator'?: Linter.RuleEntry<[]>
|
|
1339
|
+
/**
|
|
1340
|
+
* Prefer a single `Array#some()` or `Array#every()` with a combined predicate.
|
|
1341
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-array-predicate.md
|
|
1342
|
+
*/
|
|
1343
|
+
'unicorn/prefer-single-array-predicate'?: Linter.RuleEntry<[]>
|
|
768
1344
|
/**
|
|
769
1345
|
* Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
770
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1346
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-call.md
|
|
771
1347
|
*/
|
|
772
1348
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
1349
|
+
/**
|
|
1350
|
+
* Prefer a single object destructuring declaration per local const source.
|
|
1351
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-object-destructuring.md
|
|
1352
|
+
*/
|
|
1353
|
+
'unicorn/prefer-single-object-destructuring'?: Linter.RuleEntry<[]>
|
|
1354
|
+
/**
|
|
1355
|
+
* Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.
|
|
1356
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-single-replace.md
|
|
1357
|
+
*/
|
|
1358
|
+
'unicorn/prefer-single-replace'?: Linter.RuleEntry<[]>
|
|
1359
|
+
/**
|
|
1360
|
+
* Prefer declaring variables in the smallest possible scope.
|
|
1361
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-smaller-scope.md
|
|
1362
|
+
*/
|
|
1363
|
+
'unicorn/prefer-smaller-scope'?: Linter.RuleEntry<[]>
|
|
773
1364
|
/**
|
|
774
1365
|
* Prefer `String#split()` with a limit.
|
|
775
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1366
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-split-limit.md
|
|
776
1367
|
*/
|
|
777
1368
|
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>
|
|
778
1369
|
/**
|
|
779
|
-
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()
|
|
780
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1370
|
+
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()`, and trivial `for…of` copies.
|
|
1371
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-spread.md
|
|
781
1372
|
*/
|
|
782
1373
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
783
1374
|
/**
|
|
784
1375
|
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
785
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1376
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-match-all.md
|
|
786
1377
|
*/
|
|
787
1378
|
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>
|
|
788
1379
|
/**
|
|
789
1380
|
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
790
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1381
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-pad-start-end.md
|
|
791
1382
|
*/
|
|
792
1383
|
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>
|
|
793
1384
|
/**
|
|
794
1385
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
795
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1386
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-raw.md
|
|
796
1387
|
*/
|
|
797
1388
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
798
1389
|
/**
|
|
799
1390
|
* Prefer `String#repeat()` for repeated whitespace.
|
|
800
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1391
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-repeat.md
|
|
801
1392
|
*/
|
|
802
1393
|
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>
|
|
803
1394
|
/**
|
|
804
1395
|
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
805
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1396
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-replace-all.md
|
|
806
1397
|
*/
|
|
807
1398
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
808
1399
|
/**
|
|
809
1400
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
810
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1401
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-slice.md
|
|
811
1402
|
*/
|
|
812
1403
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
813
1404
|
/**
|
|
814
|
-
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
815
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1405
|
+
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()` and `String#indexOf() === 0`.
|
|
1406
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
816
1407
|
*/
|
|
817
1408
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
818
1409
|
/**
|
|
819
1410
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
820
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1411
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
821
1412
|
*/
|
|
822
1413
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
823
1414
|
/**
|
|
824
1415
|
* Prefer using `structuredClone` to create a deep clone.
|
|
825
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1416
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-structured-clone.md
|
|
826
1417
|
*/
|
|
827
1418
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
828
1419
|
/**
|
|
829
1420
|
* Prefer `switch` over multiple `else-if`.
|
|
830
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1421
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-switch.md
|
|
831
1422
|
*/
|
|
832
1423
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
833
1424
|
/**
|
|
834
|
-
* Prefer
|
|
835
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1425
|
+
* Prefer `Temporal` over `Date`.
|
|
1426
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-temporal.md
|
|
1427
|
+
*/
|
|
1428
|
+
'unicorn/prefer-temporal'?: Linter.RuleEntry<UnicornPreferTemporal>
|
|
1429
|
+
/**
|
|
1430
|
+
* Prefer ternary expressions over simple `if` statements that return or assign values.
|
|
1431
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-ternary.md
|
|
836
1432
|
*/
|
|
837
1433
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
838
1434
|
/**
|
|
839
1435
|
* Prefer top-level await over top-level promises and async function calls.
|
|
840
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1436
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-top-level-await.md
|
|
841
1437
|
*/
|
|
842
1438
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
843
1439
|
/**
|
|
844
1440
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
845
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1441
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-type-error.md
|
|
846
1442
|
*/
|
|
847
1443
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
848
1444
|
/**
|
|
849
|
-
*
|
|
850
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1445
|
+
* Require type literals to be last in union types.
|
|
1446
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-type-literal-last.md
|
|
1447
|
+
*/
|
|
1448
|
+
'unicorn/prefer-type-literal-last'?: Linter.RuleEntry<[]>
|
|
1449
|
+
/**
|
|
1450
|
+
* Prefer `Uint8Array#toBase64()` and `Uint8Array.fromBase64()` over `atob()`, `btoa()`, and `Buffer` base64 conversions.
|
|
1451
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-uint8array-base64.md
|
|
1452
|
+
*/
|
|
1453
|
+
'unicorn/prefer-uint8array-base64'?: Linter.RuleEntry<[]>
|
|
1454
|
+
/**
|
|
1455
|
+
* Prefer the unary minus operator over multiplying or dividing by `-1`.
|
|
1456
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-unary-minus.md
|
|
1457
|
+
*/
|
|
1458
|
+
'unicorn/prefer-unary-minus'?: Linter.RuleEntry<[]>
|
|
1459
|
+
/**
|
|
1460
|
+
* Prefer Unicode code point escapes over legacy escape sequences.
|
|
1461
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-unicode-code-point-escapes.md
|
|
1462
|
+
*/
|
|
1463
|
+
'unicorn/prefer-unicode-code-point-escapes'?: Linter.RuleEntry<[]>
|
|
1464
|
+
/**
|
|
1465
|
+
* Prefer `URL.canParse()` over constructing a `URL` in a try/catch for validation.
|
|
1466
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-url-can-parse.md
|
|
851
1467
|
*/
|
|
852
|
-
'unicorn/
|
|
1468
|
+
'unicorn/prefer-url-can-parse'?: Linter.RuleEntry<[]>
|
|
1469
|
+
/**
|
|
1470
|
+
* Prefer `URL#href` over stringifying a `URL`.
|
|
1471
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-url-href.md
|
|
1472
|
+
*/
|
|
1473
|
+
'unicorn/prefer-url-href'?: Linter.RuleEntry<[]>
|
|
1474
|
+
/**
|
|
1475
|
+
* Prefer putting the condition in the while statement.
|
|
1476
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/prefer-while-loop-condition.md
|
|
1477
|
+
*/
|
|
1478
|
+
'unicorn/prefer-while-loop-condition'?: Linter.RuleEntry<[]>
|
|
1479
|
+
/**
|
|
1480
|
+
* Renamed to `unicorn/name-replacements`.
|
|
1481
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/deleted-and-deprecated-rules.md#prevent-abbreviations
|
|
1482
|
+
* @deprecated
|
|
1483
|
+
*/
|
|
1484
|
+
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<[]>
|
|
853
1485
|
/**
|
|
854
1486
|
* Enforce consistent relative URL style.
|
|
855
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1487
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/relative-url-style.md
|
|
856
1488
|
*/
|
|
857
1489
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
858
1490
|
/**
|
|
859
1491
|
* Enforce using the separator argument with `Array#join()`.
|
|
860
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1492
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-array-join-separator.md
|
|
861
1493
|
*/
|
|
862
1494
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
1495
|
+
/**
|
|
1496
|
+
* Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
|
|
1497
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-array-sort-compare.md
|
|
1498
|
+
*/
|
|
1499
|
+
'unicorn/require-array-sort-compare'?: Linter.RuleEntry<[]>
|
|
863
1500
|
/**
|
|
864
1501
|
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
865
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1502
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-css-escape.md
|
|
866
1503
|
*/
|
|
867
1504
|
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>
|
|
868
1505
|
/**
|
|
869
1506
|
* Require non-empty module attributes for imports and exports
|
|
870
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1507
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-module-attributes.md
|
|
871
1508
|
*/
|
|
872
1509
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>
|
|
873
1510
|
/**
|
|
874
1511
|
* Require non-empty specifier list in import and export statements.
|
|
875
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1512
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-module-specifiers.md
|
|
876
1513
|
*/
|
|
877
1514
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
878
1515
|
/**
|
|
879
1516
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
880
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1517
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
881
1518
|
*/
|
|
882
1519
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
883
1520
|
/**
|
|
884
1521
|
* Require passive event listeners for high-frequency events.
|
|
885
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1522
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-passive-events.md
|
|
886
1523
|
*/
|
|
887
1524
|
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>
|
|
888
1525
|
/**
|
|
889
1526
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
890
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1527
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-post-message-target-origin.md
|
|
891
1528
|
*/
|
|
892
1529
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
1530
|
+
/**
|
|
1531
|
+
* Require boolean-returning Proxy traps to return booleans.
|
|
1532
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/require-proxy-trap-boolean-return.md
|
|
1533
|
+
*/
|
|
1534
|
+
'unicorn/require-proxy-trap-boolean-return'?: Linter.RuleEntry<[]>
|
|
893
1535
|
/**
|
|
894
1536
|
* Enforce better string content.
|
|
895
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1537
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/string-content.md
|
|
896
1538
|
*/
|
|
897
1539
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
898
1540
|
/**
|
|
899
1541
|
* Enforce consistent brace style for `case` clauses.
|
|
900
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1542
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/switch-case-braces.md
|
|
901
1543
|
*/
|
|
902
1544
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
903
1545
|
/**
|
|
904
1546
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
905
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1547
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/switch-case-break-position.md
|
|
906
1548
|
*/
|
|
907
1549
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>
|
|
908
1550
|
/**
|
|
909
1551
|
* Fix whitespace-insensitive template indentation.
|
|
910
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1552
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/template-indent.md
|
|
911
1553
|
*/
|
|
912
1554
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
913
1555
|
/**
|
|
914
1556
|
* Enforce consistent case for text encoding identifiers.
|
|
915
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1557
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/text-encoding-identifier-case.md
|
|
916
1558
|
*/
|
|
917
1559
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>
|
|
918
1560
|
/**
|
|
919
1561
|
* Require `new` when creating an error.
|
|
920
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1562
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/throw-new-error.md
|
|
921
1563
|
*/
|
|
922
1564
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
923
1565
|
/**
|
|
924
1566
|
* Limit the complexity of `try` blocks.
|
|
925
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
1567
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/try-complexity.md
|
|
926
1568
|
*/
|
|
927
1569
|
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>
|
|
928
1570
|
}
|
|
@@ -935,6 +1577,42 @@ type UnicornCatchErrorName = []|[{
|
|
|
935
1577
|
|
|
936
1578
|
ignore?: unknown[]
|
|
937
1579
|
}]
|
|
1580
|
+
// ----- unicorn/class-reference-in-static-methods -----
|
|
1581
|
+
type UnicornClassReferenceInStaticMethods = []|[{
|
|
1582
|
+
|
|
1583
|
+
preferThis?: boolean
|
|
1584
|
+
|
|
1585
|
+
preferSuper?: boolean
|
|
1586
|
+
}]
|
|
1587
|
+
// ----- unicorn/comment-content -----
|
|
1588
|
+
type UnicornCommentContent = []|[{
|
|
1589
|
+
|
|
1590
|
+
checkUniformCase?: boolean
|
|
1591
|
+
|
|
1592
|
+
extendDefaultReplacements?: boolean
|
|
1593
|
+
|
|
1594
|
+
replacements?: {
|
|
1595
|
+
[k: string]: (false | string | {
|
|
1596
|
+
replacement: string
|
|
1597
|
+
caseSensitive?: boolean
|
|
1598
|
+
}) | undefined
|
|
1599
|
+
}
|
|
1600
|
+
}]
|
|
1601
|
+
// ----- unicorn/consistent-boolean-name -----
|
|
1602
|
+
type UnicornConsistentBooleanName = []|[{
|
|
1603
|
+
|
|
1604
|
+
checkProperties?: boolean
|
|
1605
|
+
|
|
1606
|
+
prefixes?: {
|
|
1607
|
+
|
|
1608
|
+
[k: string]: boolean | undefined
|
|
1609
|
+
}
|
|
1610
|
+
}]
|
|
1611
|
+
// ----- unicorn/consistent-class-member-order -----
|
|
1612
|
+
type UnicornConsistentClassMemberOrder = []|[{
|
|
1613
|
+
|
|
1614
|
+
order?: [("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method"), ("static-field" | "static-block" | "static-method" | "private-field" | "public-field" | "constructor" | "private-method" | "public-method")]
|
|
1615
|
+
}]
|
|
938
1616
|
// ----- unicorn/consistent-compound-words -----
|
|
939
1617
|
type UnicornConsistentCompoundWords = []|[{
|
|
940
1618
|
|
|
@@ -958,13 +1636,32 @@ interface _UnicornConsistentCompoundWords_Replacements {
|
|
|
958
1636
|
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
959
1637
|
[k: string]: true | undefined
|
|
960
1638
|
}
|
|
1639
|
+
// ----- unicorn/consistent-conditional-object-spread -----
|
|
1640
|
+
type UnicornConsistentConditionalObjectSpread = []|[("logical" | "ternary")]
|
|
1641
|
+
// ----- unicorn/consistent-export-decorator-position -----
|
|
1642
|
+
type UnicornConsistentExportDecoratorPosition = []|[("above" | "before" | "after")]
|
|
961
1643
|
// ----- unicorn/consistent-function-scoping -----
|
|
962
1644
|
type UnicornConsistentFunctionScoping = []|[{
|
|
963
1645
|
|
|
964
1646
|
checkArrowFunctions?: boolean
|
|
965
1647
|
}]
|
|
1648
|
+
// ----- unicorn/consistent-function-style -----
|
|
1649
|
+
type UnicornConsistentFunctionStyle = []|[{
|
|
1650
|
+
default?: ("declaration" | "function-expression" | "arrow-function" | "ignore")
|
|
1651
|
+
namedFunctions?: ("declaration" | "function-expression" | "arrow-function" | "ignore")
|
|
1652
|
+
namedExports?: ("declaration" | "function-expression" | "arrow-function" | "ignore")
|
|
1653
|
+
callbacks?: ("function-expression" | "arrow-function" | "ignore")
|
|
1654
|
+
objectProperties?: ("method" | "function-expression" | "arrow-function" | "ignore")
|
|
1655
|
+
reassignedVariables?: ("function-expression" | "arrow-function" | "ignore")
|
|
1656
|
+
typedVariables?: ("function-expression" | "arrow-function" | "ignore")
|
|
1657
|
+
}]
|
|
966
1658
|
// ----- unicorn/consistent-json-file-read -----
|
|
967
1659
|
type UnicornConsistentJsonFileRead = []|[("string" | "buffer")]
|
|
1660
|
+
// ----- unicorn/default-export-style -----
|
|
1661
|
+
type UnicornDefaultExportStyle = []|[{
|
|
1662
|
+
functions?: ("inline" | "separate" | "ignore")
|
|
1663
|
+
classes?: ("inline" | "separate" | "ignore")
|
|
1664
|
+
}]
|
|
968
1665
|
// ----- unicorn/dom-node-dataset -----
|
|
969
1666
|
type UnicornDomNodeDataset = []|[{
|
|
970
1667
|
|
|
@@ -991,10 +1688,12 @@ type UnicornExpiringTodoComments = []|[{
|
|
|
991
1688
|
type UnicornExplicitLengthCheck = []|[{
|
|
992
1689
|
"non-zero"?: ("greater-than" | "not-equal")
|
|
993
1690
|
}]
|
|
1691
|
+
// ----- unicorn/explicit-timer-delay -----
|
|
1692
|
+
type UnicornExplicitTimerDelay = []|[("always" | "never")]
|
|
994
1693
|
// ----- unicorn/filename-case -----
|
|
995
1694
|
type UnicornFilenameCase = []|[({
|
|
996
1695
|
|
|
997
|
-
case?: ("camelCase" | "snakeCase" | "kebabCase" | "pascalCase")
|
|
1696
|
+
case?: ("camelCase" | "camelCaseWithAcronyms" | "snakeCase" | "kebabCase" | "pascalCase")
|
|
998
1697
|
|
|
999
1698
|
ignore?: unknown[]
|
|
1000
1699
|
|
|
@@ -1007,6 +1706,8 @@ type UnicornFilenameCase = []|[({
|
|
|
1007
1706
|
|
|
1008
1707
|
camelCase?: boolean
|
|
1009
1708
|
|
|
1709
|
+
camelCaseWithAcronyms?: boolean
|
|
1710
|
+
|
|
1010
1711
|
snakeCase?: boolean
|
|
1011
1712
|
|
|
1012
1713
|
kebabCase?: boolean
|
|
@@ -1020,6 +1721,15 @@ type UnicornFilenameCase = []|[({
|
|
|
1020
1721
|
|
|
1021
1722
|
checkDirectories?: boolean
|
|
1022
1723
|
})]
|
|
1724
|
+
// ----- unicorn/id-match -----
|
|
1725
|
+
type UnicornIdMatch = []|[string]|[string, {
|
|
1726
|
+
properties?: boolean
|
|
1727
|
+
classFields?: boolean
|
|
1728
|
+
onlyDeclarations?: boolean
|
|
1729
|
+
ignoreDestructuring?: boolean
|
|
1730
|
+
|
|
1731
|
+
checkNamedSpecifiers?: boolean
|
|
1732
|
+
}]
|
|
1023
1733
|
// ----- unicorn/import-style -----
|
|
1024
1734
|
type UnicornImportStyle = []|[{
|
|
1025
1735
|
|
|
@@ -1054,6 +1764,48 @@ type UnicornIsolatedFunctions = []|[{
|
|
|
1054
1764
|
|
|
1055
1765
|
comments?: string[]
|
|
1056
1766
|
}]
|
|
1767
|
+
// ----- unicorn/logical-assignment-operators -----
|
|
1768
|
+
type UnicornLogicalAssignmentOperators = (([]|["always"]|["always", {
|
|
1769
|
+
enforceForIfStatements?: boolean
|
|
1770
|
+
}] | ["never"]) & unknown[])
|
|
1771
|
+
// ----- unicorn/max-nested-calls -----
|
|
1772
|
+
type UnicornMaxNestedCalls = []|[{
|
|
1773
|
+
|
|
1774
|
+
max?: number
|
|
1775
|
+
}]
|
|
1776
|
+
// ----- unicorn/name-replacements -----
|
|
1777
|
+
type UnicornNameReplacements = []|[{
|
|
1778
|
+
|
|
1779
|
+
checkProperties?: boolean
|
|
1780
|
+
|
|
1781
|
+
checkVariables?: boolean
|
|
1782
|
+
|
|
1783
|
+
checkDefaultAndNamespaceImports?: (boolean | string)
|
|
1784
|
+
|
|
1785
|
+
checkShorthandImports?: (boolean | string)
|
|
1786
|
+
|
|
1787
|
+
checkShorthandProperties?: boolean
|
|
1788
|
+
|
|
1789
|
+
checkFilenames?: boolean
|
|
1790
|
+
|
|
1791
|
+
extendDefaultReplacements?: boolean
|
|
1792
|
+
replacements?: _UnicornNameReplacements_NameReplacements
|
|
1793
|
+
|
|
1794
|
+
extendDefaultAllowList?: boolean
|
|
1795
|
+
allowList?: _UnicornNameReplacements_BooleanObject
|
|
1796
|
+
|
|
1797
|
+
ignore?: unknown[]
|
|
1798
|
+
}]
|
|
1799
|
+
type _UnicornNameReplacementsReplacements = (false | _UnicornNameReplacements_BooleanObject) | undefined
|
|
1800
|
+
interface _UnicornNameReplacements_NameReplacements {
|
|
1801
|
+
[k: string]: _UnicornNameReplacementsReplacements | undefined
|
|
1802
|
+
}
|
|
1803
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
1804
|
+
[k: string]: boolean | undefined
|
|
1805
|
+
}
|
|
1806
|
+
interface _UnicornNameReplacements_BooleanObject {
|
|
1807
|
+
[k: string]: boolean | undefined
|
|
1808
|
+
}
|
|
1057
1809
|
// ----- unicorn/no-array-callback-reference -----
|
|
1058
1810
|
type UnicornNoArrayCallbackReference = []|[{
|
|
1059
1811
|
|
|
@@ -1084,6 +1836,13 @@ type UnicornNoInstanceofBuiltins = []|[{
|
|
|
1084
1836
|
include?: string[]
|
|
1085
1837
|
exclude?: string[]
|
|
1086
1838
|
}]
|
|
1839
|
+
// ----- unicorn/no-invalid-argument-count -----
|
|
1840
|
+
type UnicornNoInvalidArgumentCount = []|[{
|
|
1841
|
+
[k: string]: (number | [number, ...(number)[]] | {
|
|
1842
|
+
min?: number
|
|
1843
|
+
max?: number
|
|
1844
|
+
}) | undefined
|
|
1845
|
+
}]
|
|
1087
1846
|
// ----- unicorn/no-keyword-prefix -----
|
|
1088
1847
|
type UnicornNoKeywordPrefix = []|[{
|
|
1089
1848
|
|
|
@@ -1093,6 +1852,16 @@ type UnicornNoKeywordPrefix = []|[{
|
|
|
1093
1852
|
|
|
1094
1853
|
onlyCamelCase?: boolean
|
|
1095
1854
|
}]
|
|
1855
|
+
// ----- unicorn/no-negated-comparison -----
|
|
1856
|
+
type UnicornNoNegatedComparison = []|[{
|
|
1857
|
+
|
|
1858
|
+
checkLogicalExpressions?: boolean
|
|
1859
|
+
}]
|
|
1860
|
+
// ----- unicorn/no-non-function-verb-prefix -----
|
|
1861
|
+
type UnicornNoNonFunctionVerbPrefix = []|[{
|
|
1862
|
+
|
|
1863
|
+
verbs?: string[]
|
|
1864
|
+
}]
|
|
1096
1865
|
// ----- unicorn/no-null -----
|
|
1097
1866
|
type UnicornNoNull = []|[{
|
|
1098
1867
|
|
|
@@ -1112,6 +1881,11 @@ type UnicornNoUnnecessaryPolyfills = []|[{
|
|
|
1112
1881
|
[k: string]: unknown | undefined
|
|
1113
1882
|
})
|
|
1114
1883
|
}]
|
|
1884
|
+
// ----- unicorn/no-unreadable-array-destructuring -----
|
|
1885
|
+
type UnicornNoUnreadableArrayDestructuring = []|[{
|
|
1886
|
+
|
|
1887
|
+
maximumIgnoredElements?: number
|
|
1888
|
+
}]
|
|
1115
1889
|
// ----- unicorn/no-useless-undefined -----
|
|
1116
1890
|
type UnicornNoUselessUndefined = []|[{
|
|
1117
1891
|
|
|
@@ -1162,6 +1936,8 @@ type UnicornNumericSeparatorsStyle = []|[{
|
|
|
1162
1936
|
|
|
1163
1937
|
onlyIfContainsSeparator?: boolean
|
|
1164
1938
|
}]
|
|
1939
|
+
// ----- unicorn/operator-assignment -----
|
|
1940
|
+
type UnicornOperatorAssignment = []|[("always" | "never")]
|
|
1165
1941
|
// ----- unicorn/prefer-add-event-listener -----
|
|
1166
1942
|
type UnicornPreferAddEventListener = []|[{
|
|
1167
1943
|
|
|
@@ -1184,6 +1960,16 @@ type UnicornPreferAt = []|[{
|
|
|
1184
1960
|
|
|
1185
1961
|
checkAllIndexAccess?: boolean
|
|
1186
1962
|
}]
|
|
1963
|
+
// ----- unicorn/prefer-continue -----
|
|
1964
|
+
type UnicornPreferContinue = []|[{
|
|
1965
|
+
|
|
1966
|
+
maximumStatements?: number
|
|
1967
|
+
}]
|
|
1968
|
+
// ----- unicorn/prefer-early-return -----
|
|
1969
|
+
type UnicornPreferEarlyReturn = []|[{
|
|
1970
|
+
|
|
1971
|
+
maximumStatements?: number
|
|
1972
|
+
}]
|
|
1187
1973
|
// ----- unicorn/prefer-export-from -----
|
|
1188
1974
|
type UnicornPreferExportFrom = []|[{
|
|
1189
1975
|
|
|
@@ -1194,6 +1980,11 @@ type UnicornPreferIncludesOverRepeatedComparisons = []|[{
|
|
|
1194
1980
|
|
|
1195
1981
|
minimumComparisons?: number
|
|
1196
1982
|
}]
|
|
1983
|
+
// ----- unicorn/prefer-minimal-ternary -----
|
|
1984
|
+
type UnicornPreferMinimalTernary = []|[{
|
|
1985
|
+
|
|
1986
|
+
checkComputedMemberAccess?: boolean
|
|
1987
|
+
}]
|
|
1197
1988
|
// ----- unicorn/prefer-number-properties -----
|
|
1198
1989
|
type UnicornPreferNumberProperties = []|[{
|
|
1199
1990
|
|
|
@@ -1245,41 +2036,17 @@ type UnicornPreferSwitch = []|[{
|
|
|
1245
2036
|
|
|
1246
2037
|
emptyDefaultCase?: ("no-default-comment" | "do-nothing-comment" | "no-default-case")
|
|
1247
2038
|
}]
|
|
1248
|
-
// ----- unicorn/prefer-
|
|
1249
|
-
type
|
|
1250
|
-
// ----- unicorn/prevent-abbreviations -----
|
|
1251
|
-
type UnicornPreventAbbreviations = []|[{
|
|
2039
|
+
// ----- unicorn/prefer-temporal -----
|
|
2040
|
+
type UnicornPreferTemporal = []|[{
|
|
1252
2041
|
|
|
1253
|
-
|
|
2042
|
+
checkDateNow?: boolean
|
|
1254
2043
|
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
checkDefaultAndNamespaceImports?: (boolean | string)
|
|
1258
|
-
|
|
1259
|
-
checkShorthandImports?: (boolean | string)
|
|
1260
|
-
|
|
1261
|
-
checkShorthandProperties?: boolean
|
|
1262
|
-
|
|
1263
|
-
checkFilenames?: boolean
|
|
1264
|
-
|
|
1265
|
-
extendDefaultReplacements?: boolean
|
|
1266
|
-
replacements?: _UnicornPreventAbbreviations_Abbreviations
|
|
2044
|
+
checkReferences?: boolean
|
|
1267
2045
|
|
|
1268
|
-
|
|
1269
|
-
allowList?: _UnicornPreventAbbreviations_BooleanObject
|
|
1270
|
-
|
|
1271
|
-
ignore?: unknown[]
|
|
2046
|
+
checkMethods?: boolean
|
|
1272
2047
|
}]
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
[k: string]: _UnicornPreventAbbreviationsReplacements | undefined
|
|
1276
|
-
}
|
|
1277
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
1278
|
-
[k: string]: boolean | undefined
|
|
1279
|
-
}
|
|
1280
|
-
interface _UnicornPreventAbbreviations_BooleanObject {
|
|
1281
|
-
[k: string]: boolean | undefined
|
|
1282
|
-
}
|
|
2048
|
+
// ----- unicorn/prefer-ternary -----
|
|
2049
|
+
type UnicornPreferTernary = []|[("always" | "only-single-line")]
|
|
1283
2050
|
// ----- unicorn/relative-url-style -----
|
|
1284
2051
|
type UnicornRelativeUrlStyle = []|[("never" | "always")]
|
|
1285
2052
|
// ----- unicorn/require-css-escape -----
|
|
@@ -1302,7 +2069,7 @@ type UnicornStringContent = []|[{
|
|
|
1302
2069
|
selectors?: string[]
|
|
1303
2070
|
}]
|
|
1304
2071
|
// ----- unicorn/switch-case-braces -----
|
|
1305
|
-
type UnicornSwitchCaseBraces = []|[("always" | "avoid")]
|
|
2072
|
+
type UnicornSwitchCaseBraces = []|[("always" | "avoid" | "single-statement")]
|
|
1306
2073
|
// ----- unicorn/template-indent -----
|
|
1307
2074
|
type UnicornTemplateIndent = []|[{
|
|
1308
2075
|
|