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