@w5s/eslint-config 3.7.2 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1184 -196
- package/dist/index.js +37 -15
- package/dist/index.js.map +1 -1
- package/package.json +11 -14
- package/src/config/react.ts +43 -0
- package/src/config.ts +1 -0
- package/src/defineConfig.ts +19 -1
- package/src/typegen/e18e.d.ts +8 -0
- package/src/typegen/react.d.ts +768 -0
- package/src/typegen/unicorn.d.ts +423 -172
package/src/typegen/unicorn.d.ts
CHANGED
|
@@ -10,761 +10,924 @@ declare module 'eslint' {
|
|
|
10
10
|
|
|
11
11
|
export interface RuleOptions {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
13
|
+
* Prefer better DOM traversal APIs.
|
|
14
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/better-dom-traversing.md
|
|
15
15
|
*/
|
|
16
|
-
'unicorn/better-
|
|
16
|
+
'unicorn/better-dom-traversing'?: Linter.RuleEntry<[]>
|
|
17
|
+
/**
|
|
18
|
+
* Removed. Prefer `eslint-plugin-regexp`
|
|
19
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#better-regex
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
|
+
'unicorn/better-regex'?: Linter.RuleEntry<[]>
|
|
17
23
|
/**
|
|
18
24
|
* Enforce a specific parameter name in catch clauses.
|
|
19
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
25
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/catch-error-name.md
|
|
20
26
|
*/
|
|
21
27
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
22
28
|
/**
|
|
23
29
|
* Enforce consistent assertion style with `node:assert`.
|
|
24
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
30
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-assert.md
|
|
25
31
|
*/
|
|
26
32
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
33
|
+
/**
|
|
34
|
+
* Enforce consistent spelling of compound words in identifiers.
|
|
35
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-compound-words.md
|
|
36
|
+
*/
|
|
37
|
+
'unicorn/consistent-compound-words'?: Linter.RuleEntry<UnicornConsistentCompoundWords>
|
|
27
38
|
/**
|
|
28
39
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
29
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
40
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-date-clone.md
|
|
30
41
|
*/
|
|
31
42
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
32
43
|
/**
|
|
33
44
|
* Use destructured variables over properties.
|
|
34
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
45
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-destructuring.md
|
|
35
46
|
*/
|
|
36
47
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
37
48
|
/**
|
|
38
49
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
39
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
50
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-empty-array-spread.md
|
|
40
51
|
*/
|
|
41
52
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
42
53
|
/**
|
|
43
54
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
44
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
55
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-existence-index-check.md
|
|
45
56
|
*/
|
|
46
57
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
47
58
|
/**
|
|
48
59
|
* Move function definitions to the highest possible scope.
|
|
49
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
60
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-function-scoping.md
|
|
50
61
|
*/
|
|
51
62
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
63
|
+
/**
|
|
64
|
+
* Enforce consistent JSON file reads before `JSON.parse()`.
|
|
65
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-json-file-read.md
|
|
66
|
+
*/
|
|
67
|
+
'unicorn/consistent-json-file-read'?: Linter.RuleEntry<UnicornConsistentJsonFileRead>
|
|
52
68
|
/**
|
|
53
69
|
* Enforce consistent style for escaping `${` in template literals.
|
|
54
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
70
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/consistent-template-literal-escape.md
|
|
55
71
|
*/
|
|
56
72
|
'unicorn/consistent-template-literal-escape'?: Linter.RuleEntry<[]>
|
|
57
73
|
/**
|
|
58
74
|
* Enforce correct `Error` subclassing.
|
|
59
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
75
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/custom-error-definition.md
|
|
60
76
|
*/
|
|
61
77
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
78
|
+
/**
|
|
79
|
+
* Enforce consistent style for DOM element dataset access.
|
|
80
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/dom-node-dataset.md
|
|
81
|
+
*/
|
|
82
|
+
'unicorn/dom-node-dataset'?: Linter.RuleEntry<UnicornDomNodeDataset>
|
|
62
83
|
/**
|
|
63
84
|
* Enforce no spaces between braces.
|
|
64
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
85
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/empty-brace-spaces.md
|
|
65
86
|
*/
|
|
66
87
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
67
88
|
/**
|
|
68
89
|
* Enforce passing a `message` value when creating a built-in error.
|
|
69
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
90
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/error-message.md
|
|
70
91
|
*/
|
|
71
92
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
72
93
|
/**
|
|
73
94
|
* Require escape sequences to use uppercase or lowercase values.
|
|
74
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
95
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/escape-case.md
|
|
75
96
|
*/
|
|
76
97
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
77
98
|
/**
|
|
78
99
|
* Add expiration conditions to TODO comments.
|
|
79
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
100
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/expiring-todo-comments.md
|
|
80
101
|
*/
|
|
81
102
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
82
103
|
/**
|
|
83
104
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
84
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
105
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/explicit-length-check.md
|
|
85
106
|
*/
|
|
86
107
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
87
108
|
/**
|
|
88
|
-
* Enforce a case style for filenames.
|
|
89
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
109
|
+
* Enforce a case style for filenames and directory names.
|
|
110
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/filename-case.md
|
|
90
111
|
*/
|
|
91
112
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
92
113
|
/**
|
|
93
114
|
* Enforce specific import styles per module.
|
|
94
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
115
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/import-style.md
|
|
95
116
|
*/
|
|
96
117
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
97
118
|
/**
|
|
98
119
|
* Prevent usage of variables from outside the scope of isolated functions.
|
|
99
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
120
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/isolated-functions.md
|
|
100
121
|
*/
|
|
101
122
|
'unicorn/isolated-functions'?: Linter.RuleEntry<UnicornIsolatedFunctions>
|
|
102
123
|
/**
|
|
103
124
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
104
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
125
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/new-for-builtins.md
|
|
105
126
|
*/
|
|
106
127
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
107
128
|
/**
|
|
108
129
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
109
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
130
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-abusive-eslint-disable.md
|
|
110
131
|
*/
|
|
111
132
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
112
133
|
/**
|
|
113
134
|
* Disallow recursive access to `this` within getters and setters.
|
|
114
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-accessor-recursion.md
|
|
115
136
|
*/
|
|
116
137
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
117
138
|
/**
|
|
118
139
|
* Disallow anonymous functions and classes as the default export.
|
|
119
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-anonymous-default-export.md
|
|
120
141
|
*/
|
|
121
142
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
122
143
|
/**
|
|
123
144
|
* Prevent passing a function reference directly to iterator methods.
|
|
124
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-callback-reference.md
|
|
146
|
+
*/
|
|
147
|
+
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<UnicornNoArrayCallbackReference>
|
|
148
|
+
/**
|
|
149
|
+
* Disallow using reference values as `Array#fill()` values.
|
|
150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-fill-with-reference-type.md
|
|
125
151
|
*/
|
|
126
|
-
'unicorn/no-array-
|
|
152
|
+
'unicorn/no-array-fill-with-reference-type'?: Linter.RuleEntry<[]>
|
|
127
153
|
/**
|
|
128
154
|
* Prefer `for…of` over the `forEach` method.
|
|
129
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-for-each.md
|
|
130
156
|
*/
|
|
131
157
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
158
|
+
/**
|
|
159
|
+
* Disallow `.fill()` after `Array.from({length: …})`.
|
|
160
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-from-fill.md
|
|
161
|
+
*/
|
|
162
|
+
'unicorn/no-array-from-fill'?: Linter.RuleEntry<[]>
|
|
132
163
|
/**
|
|
133
164
|
* Disallow using the `this` argument in array methods.
|
|
134
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-method-this-argument.md
|
|
135
166
|
*/
|
|
136
167
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
137
168
|
/**
|
|
138
169
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
139
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-array-push-push
|
|
140
171
|
* @deprecated
|
|
141
172
|
*/
|
|
142
173
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
143
174
|
/**
|
|
144
175
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
176
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reduce.md
|
|
146
177
|
*/
|
|
147
178
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
148
179
|
/**
|
|
149
180
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
181
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-reverse.md
|
|
151
182
|
*/
|
|
152
183
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>
|
|
153
184
|
/**
|
|
154
185
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
186
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-array-sort.md
|
|
156
187
|
*/
|
|
157
188
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>
|
|
158
189
|
/**
|
|
159
190
|
* Disallow member access from await expression.
|
|
160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
191
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-expression-member.md
|
|
161
192
|
*/
|
|
162
193
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
163
194
|
/**
|
|
164
195
|
* Disallow using `await` in `Promise` method parameters.
|
|
165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-await-in-promise-methods.md
|
|
166
197
|
*/
|
|
167
198
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
199
|
+
/**
|
|
200
|
+
* Disallow unnecessary `Blob` to `File` conversion.
|
|
201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-blob-to-file.md
|
|
202
|
+
*/
|
|
203
|
+
'unicorn/no-blob-to-file'?: Linter.RuleEntry<[]>
|
|
204
|
+
/**
|
|
205
|
+
* Prefer drawing canvases directly instead of converting them to images.
|
|
206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-canvas-to-image.md
|
|
207
|
+
*/
|
|
208
|
+
'unicorn/no-canvas-to-image'?: Linter.RuleEntry<[]>
|
|
209
|
+
/**
|
|
210
|
+
* Disallow confusing uses of `Array#{splice,toSpliced}()`.
|
|
211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-confusing-array-splice.md
|
|
212
|
+
*/
|
|
213
|
+
'unicorn/no-confusing-array-splice'?: Linter.RuleEntry<[]>
|
|
168
214
|
/**
|
|
169
215
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-console-spaces.md
|
|
171
217
|
*/
|
|
172
218
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
173
219
|
/**
|
|
174
220
|
* Do not use `document.cookie` directly.
|
|
175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
221
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-document-cookie.md
|
|
176
222
|
*/
|
|
177
223
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
224
|
+
/**
|
|
225
|
+
* Disallow duplicate values in `Set` constructor array literals.
|
|
226
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-duplicate-set-values.md
|
|
227
|
+
*/
|
|
228
|
+
'unicorn/no-duplicate-set-values'?: Linter.RuleEntry<[]>
|
|
178
229
|
/**
|
|
179
230
|
* Disallow empty files.
|
|
180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
231
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-empty-file.md
|
|
181
232
|
*/
|
|
182
|
-
'unicorn/no-empty-file'?: Linter.RuleEntry<
|
|
233
|
+
'unicorn/no-empty-file'?: Linter.RuleEntry<UnicornNoEmptyFile>
|
|
234
|
+
/**
|
|
235
|
+
* Disallow exports in scripts.
|
|
236
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-exports-in-scripts.md
|
|
237
|
+
*/
|
|
238
|
+
'unicorn/no-exports-in-scripts'?: Linter.RuleEntry<[]>
|
|
183
239
|
/**
|
|
184
240
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
241
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-for-loop.md
|
|
186
242
|
*/
|
|
187
243
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
188
244
|
/**
|
|
189
245
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
190
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
246
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-hex-escape.md
|
|
191
247
|
*/
|
|
192
248
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
193
249
|
/**
|
|
194
250
|
* Disallow immediate mutation after variable assignment.
|
|
195
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-immediate-mutation.md
|
|
196
252
|
*/
|
|
197
253
|
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>
|
|
254
|
+
/**
|
|
255
|
+
* Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
|
|
256
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-incorrect-query-selector.md
|
|
257
|
+
*/
|
|
258
|
+
'unicorn/no-incorrect-query-selector'?: Linter.RuleEntry<[]>
|
|
198
259
|
/**
|
|
199
260
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
200
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
261
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-instanceof-array
|
|
201
262
|
* @deprecated
|
|
202
263
|
*/
|
|
203
264
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
204
265
|
/**
|
|
205
266
|
* Disallow `instanceof` with built-in objects
|
|
206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-instanceof-builtins.md
|
|
207
268
|
*/
|
|
208
269
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
209
270
|
/**
|
|
210
271
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
211
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-fetch-options.md
|
|
212
273
|
*/
|
|
213
274
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
275
|
+
/**
|
|
276
|
+
* Disallow invalid `accept` values on file inputs.
|
|
277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-file-input-accept.md
|
|
278
|
+
*/
|
|
279
|
+
'unicorn/no-invalid-file-input-accept'?: Linter.RuleEntry<[]>
|
|
214
280
|
/**
|
|
215
281
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
216
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-invalid-remove-event-listener.md
|
|
217
283
|
*/
|
|
218
284
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
219
285
|
/**
|
|
220
286
|
* Disallow identifiers starting with `new` or `class`.
|
|
221
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-keyword-prefix.md
|
|
222
288
|
*/
|
|
223
289
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
290
|
+
/**
|
|
291
|
+
* Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
|
|
292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-late-current-target-access.md
|
|
293
|
+
*/
|
|
294
|
+
'unicorn/no-late-current-target-access'?: Linter.RuleEntry<[]>
|
|
224
295
|
/**
|
|
225
296
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
226
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#no-length-as-slice-end
|
|
227
298
|
* @deprecated
|
|
228
299
|
*/
|
|
229
300
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
230
301
|
/**
|
|
231
302
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
303
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-lonely-if.md
|
|
233
304
|
*/
|
|
234
305
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
235
306
|
/**
|
|
236
307
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
308
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-magic-array-flat-depth.md
|
|
238
309
|
*/
|
|
239
310
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
311
|
+
/**
|
|
312
|
+
* Disallow manually wrapped comments.
|
|
313
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-manually-wrapped-comments.md
|
|
314
|
+
*/
|
|
315
|
+
'unicorn/no-manually-wrapped-comments'?: Linter.RuleEntry<[]>
|
|
240
316
|
/**
|
|
241
317
|
* Disallow named usage of default import and export.
|
|
242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
318
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-named-default.md
|
|
243
319
|
*/
|
|
244
320
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
245
321
|
/**
|
|
246
322
|
* Disallow negated conditions.
|
|
247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
323
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negated-condition.md
|
|
248
324
|
*/
|
|
249
325
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
250
326
|
/**
|
|
251
327
|
* Disallow negated expression in equality check.
|
|
252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
328
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-negation-in-equality-check.md
|
|
253
329
|
*/
|
|
254
330
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
255
331
|
/**
|
|
256
332
|
* Disallow nested ternary expressions.
|
|
257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
333
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-nested-ternary.md
|
|
258
334
|
*/
|
|
259
335
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
260
336
|
/**
|
|
261
337
|
* Disallow `new Array()`.
|
|
262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
338
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-array.md
|
|
263
339
|
*/
|
|
264
340
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
265
341
|
/**
|
|
266
342
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
343
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-new-buffer.md
|
|
268
344
|
*/
|
|
269
345
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
270
346
|
/**
|
|
271
347
|
* Disallow the use of the `null` literal.
|
|
272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
348
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-null.md
|
|
273
349
|
*/
|
|
274
350
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
275
351
|
/**
|
|
276
352
|
* Disallow the use of objects as default parameters.
|
|
277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
353
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-object-as-default-parameter.md
|
|
278
354
|
*/
|
|
279
355
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
280
356
|
/**
|
|
281
357
|
* Disallow `process.exit()`.
|
|
282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
358
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-process-exit.md
|
|
283
359
|
*/
|
|
284
360
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
285
361
|
/**
|
|
286
362
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
363
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-single-promise-in-promise-methods.md
|
|
288
364
|
*/
|
|
289
365
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
290
366
|
/**
|
|
291
367
|
* Disallow classes that only have static members.
|
|
292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
368
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-static-only-class.md
|
|
293
369
|
*/
|
|
294
370
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
295
371
|
/**
|
|
296
372
|
* Disallow `then` property.
|
|
297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
373
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-thenable.md
|
|
298
374
|
*/
|
|
299
375
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
300
376
|
/**
|
|
301
377
|
* Disallow assigning `this` to a variable.
|
|
302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
378
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-assignment.md
|
|
303
379
|
*/
|
|
304
380
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
381
|
+
/**
|
|
382
|
+
* Disallow `this` outside of classes.
|
|
383
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-this-outside-of-class.md
|
|
384
|
+
*/
|
|
385
|
+
'unicorn/no-this-outside-of-class'?: Linter.RuleEntry<[]>
|
|
305
386
|
/**
|
|
306
387
|
* Disallow comparing `undefined` using `typeof`.
|
|
307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
388
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-typeof-undefined.md
|
|
308
389
|
*/
|
|
309
390
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
310
391
|
/**
|
|
311
392
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
393
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-flat-depth.md
|
|
313
394
|
*/
|
|
314
395
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
315
396
|
/**
|
|
316
397
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
398
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-array-splice-count.md
|
|
318
399
|
*/
|
|
319
400
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
320
401
|
/**
|
|
321
402
|
* Disallow awaiting non-promise values.
|
|
322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
403
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-await.md
|
|
323
404
|
*/
|
|
324
405
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
406
|
+
/**
|
|
407
|
+
* Disallow unnecessary nested ternary expressions.
|
|
408
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-nested-ternary.md
|
|
409
|
+
*/
|
|
410
|
+
'unicorn/no-unnecessary-nested-ternary'?: Linter.RuleEntry<[]>
|
|
325
411
|
/**
|
|
326
412
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
413
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-polyfills.md
|
|
328
414
|
*/
|
|
329
415
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
330
416
|
/**
|
|
331
417
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
418
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unnecessary-slice-end.md
|
|
333
419
|
*/
|
|
334
420
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
335
421
|
/**
|
|
336
422
|
* Disallow unreadable array destructuring.
|
|
337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
423
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-array-destructuring.md
|
|
338
424
|
*/
|
|
339
425
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
340
426
|
/**
|
|
341
427
|
* Disallow unreadable IIFEs.
|
|
342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
428
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unreadable-iife.md
|
|
343
429
|
*/
|
|
344
430
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
431
|
+
/**
|
|
432
|
+
* Disallow ignoring the return value of selected array methods.
|
|
433
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-array-method-return.md
|
|
434
|
+
*/
|
|
435
|
+
'unicorn/no-unused-array-method-return'?: Linter.RuleEntry<[]>
|
|
345
436
|
/**
|
|
346
437
|
* Disallow unused object properties.
|
|
347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
438
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-unused-properties.md
|
|
348
439
|
*/
|
|
349
440
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
350
441
|
/**
|
|
351
442
|
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
443
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-collection-argument.md
|
|
353
444
|
*/
|
|
354
445
|
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>
|
|
355
446
|
/**
|
|
356
447
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
448
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-error-capture-stack-trace.md
|
|
358
449
|
*/
|
|
359
450
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
360
451
|
/**
|
|
361
452
|
* Disallow useless fallback when spreading in object literals.
|
|
362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
453
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-fallback-in-spread.md
|
|
363
454
|
*/
|
|
364
455
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
365
456
|
/**
|
|
366
457
|
* Disallow unnecessary `.toArray()` on iterators.
|
|
367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
458
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-iterator-to-array.md
|
|
368
459
|
*/
|
|
369
460
|
'unicorn/no-useless-iterator-to-array'?: Linter.RuleEntry<[]>
|
|
370
461
|
/**
|
|
371
462
|
* Disallow useless array length check.
|
|
372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
463
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-length-check.md
|
|
373
464
|
*/
|
|
374
465
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
375
466
|
/**
|
|
376
467
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
468
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-promise-resolve-reject.md
|
|
378
469
|
*/
|
|
379
470
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
380
471
|
/**
|
|
381
472
|
* Disallow unnecessary spread.
|
|
382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
473
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-spread.md
|
|
383
474
|
*/
|
|
384
475
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
385
476
|
/**
|
|
386
477
|
* Disallow useless case in switch statements.
|
|
387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
478
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-switch-case.md
|
|
388
479
|
*/
|
|
389
480
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
390
481
|
/**
|
|
391
482
|
* Disallow useless `undefined`.
|
|
392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
483
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-useless-undefined.md
|
|
393
484
|
*/
|
|
394
485
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
395
486
|
/**
|
|
396
487
|
* Disallow number literals with zero fractions or dangling dots.
|
|
397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
488
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/no-zero-fractions.md
|
|
398
489
|
*/
|
|
399
490
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
400
491
|
/**
|
|
401
492
|
* Enforce proper case for numeric literals.
|
|
402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
493
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/number-literal-case.md
|
|
403
494
|
*/
|
|
404
495
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
405
496
|
/**
|
|
406
497
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
498
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/numeric-separators-style.md
|
|
408
499
|
*/
|
|
409
500
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
410
501
|
/**
|
|
411
502
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
503
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-add-event-listener.md
|
|
413
504
|
*/
|
|
414
505
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
415
506
|
/**
|
|
416
507
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
508
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-find.md
|
|
418
509
|
*/
|
|
419
510
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
420
511
|
/**
|
|
421
512
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
513
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat.md
|
|
423
514
|
*/
|
|
424
515
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
425
516
|
/**
|
|
426
517
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
518
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-flat-map.md
|
|
428
519
|
*/
|
|
429
520
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
430
521
|
/**
|
|
431
522
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
523
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-index-of.md
|
|
433
524
|
*/
|
|
434
525
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
526
|
+
/**
|
|
527
|
+
* 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/v65.0.1/docs/rules/prefer-array-last-methods.md
|
|
529
|
+
*/
|
|
530
|
+
'unicorn/prefer-array-last-methods'?: Linter.RuleEntry<[]>
|
|
435
531
|
/**
|
|
436
532
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
533
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-array-some.md
|
|
438
534
|
*/
|
|
439
535
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
440
536
|
/**
|
|
441
537
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
538
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-at.md
|
|
443
539
|
*/
|
|
444
540
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
445
541
|
/**
|
|
446
542
|
* Prefer `BigInt` literals over the constructor.
|
|
447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
543
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-bigint-literals.md
|
|
448
544
|
*/
|
|
449
545
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>
|
|
450
546
|
/**
|
|
451
547
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
548
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-blob-reading-methods.md
|
|
453
549
|
*/
|
|
454
550
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
455
551
|
/**
|
|
456
552
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
553
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-class-fields.md
|
|
458
554
|
*/
|
|
459
555
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>
|
|
460
556
|
/**
|
|
461
557
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
558
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-classlist-toggle.md
|
|
463
559
|
*/
|
|
464
560
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>
|
|
465
561
|
/**
|
|
466
562
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
563
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-code-point.md
|
|
468
564
|
*/
|
|
469
565
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
470
566
|
/**
|
|
471
567
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
568
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-date-now.md
|
|
473
569
|
*/
|
|
474
570
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
475
571
|
/**
|
|
476
572
|
* Prefer default parameters over reassignment.
|
|
477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
573
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-default-parameters.md
|
|
478
574
|
*/
|
|
479
575
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
480
576
|
/**
|
|
481
|
-
* Prefer `
|
|
482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
577
|
+
* Prefer `Element#append()` over `Node#appendChild()`.
|
|
578
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-append.md
|
|
483
579
|
*/
|
|
484
580
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
485
581
|
/**
|
|
486
|
-
*
|
|
487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
582
|
+
* Renamed to `unicorn/dom-node-dataset`.
|
|
583
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-dom-node-dataset
|
|
584
|
+
* @deprecated
|
|
488
585
|
*/
|
|
489
586
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
490
587
|
/**
|
|
491
588
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
589
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-remove.md
|
|
493
590
|
*/
|
|
494
591
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
495
592
|
/**
|
|
496
593
|
* Prefer `.textContent` over `.innerText`.
|
|
497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
594
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-dom-node-text-content.md
|
|
498
595
|
*/
|
|
499
596
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
500
597
|
/**
|
|
501
598
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
502
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
599
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-event-target.md
|
|
503
600
|
*/
|
|
504
601
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
505
602
|
/**
|
|
506
603
|
* Prefer `export…from` when re-exporting.
|
|
507
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
604
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-export-from.md
|
|
508
605
|
*/
|
|
509
606
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
607
|
+
/**
|
|
608
|
+
* Prefer `.getOrInsertComputed()` when the default value has side effects.
|
|
609
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-get-or-insert-computed.md
|
|
610
|
+
*/
|
|
611
|
+
'unicorn/prefer-get-or-insert-computed'?: Linter.RuleEntry<[]>
|
|
510
612
|
/**
|
|
511
613
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
512
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
614
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-global-this.md
|
|
513
615
|
*/
|
|
514
616
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
617
|
+
/**
|
|
618
|
+
* Prefer HTTPS over HTTP.
|
|
619
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-https.md
|
|
620
|
+
*/
|
|
621
|
+
'unicorn/prefer-https'?: Linter.RuleEntry<[]>
|
|
515
622
|
/**
|
|
516
623
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
517
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
624
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-import-meta-properties.md
|
|
518
625
|
*/
|
|
519
626
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
520
627
|
/**
|
|
521
628
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
522
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
629
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes.md
|
|
523
630
|
*/
|
|
524
631
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
525
632
|
/**
|
|
526
|
-
* Prefer
|
|
527
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
633
|
+
* Prefer `.includes()` over repeated equality comparisons.
|
|
634
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-includes-over-repeated-comparisons.md
|
|
635
|
+
*/
|
|
636
|
+
'unicorn/prefer-includes-over-repeated-comparisons'?: Linter.RuleEntry<UnicornPreferIncludesOverRepeatedComparisons>
|
|
637
|
+
/**
|
|
638
|
+
* Prefer `Iterator.concat(…)` over temporary spread arrays.
|
|
639
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-concat.md
|
|
640
|
+
*/
|
|
641
|
+
'unicorn/prefer-iterator-concat'?: Linter.RuleEntry<[]>
|
|
642
|
+
/**
|
|
643
|
+
* Prefer moving `.toArray()` to the end of iterator helper chains.
|
|
644
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-iterator-to-array-at-end.md
|
|
645
|
+
*/
|
|
646
|
+
'unicorn/prefer-iterator-to-array-at-end'?: Linter.RuleEntry<[]>
|
|
647
|
+
/**
|
|
648
|
+
* Renamed to `unicorn/consistent-json-file-read`.
|
|
649
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/deleted-and-deprecated-rules.md#prefer-json-parse-buffer
|
|
650
|
+
* @deprecated
|
|
528
651
|
*/
|
|
529
652
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
530
653
|
/**
|
|
531
|
-
* Prefer `KeyboardEvent#key` over
|
|
532
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
654
|
+
* Prefer `KeyboardEvent#key` over deprecated keyboard event properties.
|
|
655
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-keyboard-event-key.md
|
|
533
656
|
*/
|
|
534
657
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
535
658
|
/**
|
|
536
659
|
* Prefer using a logical operator over a ternary.
|
|
537
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
660
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-logical-operator-over-ternary.md
|
|
538
661
|
*/
|
|
539
662
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
663
|
+
/**
|
|
664
|
+
* Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
|
|
665
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-abs.md
|
|
666
|
+
*/
|
|
667
|
+
'unicorn/prefer-math-abs'?: Linter.RuleEntry<[]>
|
|
540
668
|
/**
|
|
541
669
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
542
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
670
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-min-max.md
|
|
543
671
|
*/
|
|
544
672
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
545
673
|
/**
|
|
546
674
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
547
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
675
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-math-trunc.md
|
|
548
676
|
*/
|
|
549
677
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
550
678
|
/**
|
|
551
679
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
552
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
680
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-dom-apis.md
|
|
553
681
|
*/
|
|
554
682
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
555
683
|
/**
|
|
556
684
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
685
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-modern-math-apis.md
|
|
558
686
|
*/
|
|
559
687
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
560
688
|
/**
|
|
561
689
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
690
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-module.md
|
|
563
691
|
*/
|
|
564
692
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
565
693
|
/**
|
|
566
694
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
567
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
695
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-native-coercion-functions.md
|
|
568
696
|
*/
|
|
569
697
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
570
698
|
/**
|
|
571
699
|
* Prefer negative index over `.length - index` when possible.
|
|
572
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
700
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-negative-index.md
|
|
573
701
|
*/
|
|
574
702
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
575
703
|
/**
|
|
576
704
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
577
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
705
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-node-protocol.md
|
|
578
706
|
*/
|
|
579
707
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
580
708
|
/**
|
|
581
709
|
* Prefer `Number` static properties over global ones.
|
|
582
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
710
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-number-properties.md
|
|
583
711
|
*/
|
|
584
712
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
585
713
|
/**
|
|
586
714
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
587
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
715
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-object-from-entries.md
|
|
588
716
|
*/
|
|
589
717
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
590
718
|
/**
|
|
591
719
|
* Prefer omitting the `catch` binding parameter.
|
|
592
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
720
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-optional-catch-binding.md
|
|
593
721
|
*/
|
|
594
722
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
595
723
|
/**
|
|
596
724
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
597
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
725
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-prototype-methods.md
|
|
598
726
|
*/
|
|
599
727
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
600
728
|
/**
|
|
601
|
-
* Prefer `.querySelector()`
|
|
602
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
729
|
+
* Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.
|
|
730
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-query-selector.md
|
|
603
731
|
*/
|
|
604
|
-
'unicorn/prefer-query-selector'?: Linter.RuleEntry<
|
|
732
|
+
'unicorn/prefer-query-selector'?: Linter.RuleEntry<UnicornPreferQuerySelector>
|
|
733
|
+
/**
|
|
734
|
+
* Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
|
|
735
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-queue-microtask.md
|
|
736
|
+
*/
|
|
737
|
+
'unicorn/prefer-queue-microtask'?: Linter.RuleEntry<UnicornPreferQueueMicrotask>
|
|
605
738
|
/**
|
|
606
739
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
607
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
740
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-reflect-apply.md
|
|
608
741
|
*/
|
|
609
742
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
610
743
|
/**
|
|
611
744
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
612
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
745
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-regexp-test.md
|
|
613
746
|
*/
|
|
614
747
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
615
748
|
/**
|
|
616
749
|
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
617
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
750
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-response-static-json.md
|
|
618
751
|
*/
|
|
619
752
|
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>
|
|
620
753
|
/**
|
|
621
754
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
622
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
755
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-has.md
|
|
623
756
|
*/
|
|
624
|
-
'unicorn/prefer-set-has'?: Linter.RuleEntry<
|
|
757
|
+
'unicorn/prefer-set-has'?: Linter.RuleEntry<UnicornPreferSetHas>
|
|
625
758
|
/**
|
|
626
759
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
627
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
760
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-set-size.md
|
|
628
761
|
*/
|
|
629
762
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
630
763
|
/**
|
|
631
764
|
* Prefer simple conditions first in logical expressions.
|
|
632
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
765
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-simple-condition-first.md
|
|
633
766
|
*/
|
|
634
767
|
'unicorn/prefer-simple-condition-first'?: Linter.RuleEntry<[]>
|
|
635
768
|
/**
|
|
636
|
-
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
637
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
769
|
+
* 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/v65.0.1/docs/rules/prefer-single-call.md
|
|
638
771
|
*/
|
|
639
772
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
773
|
+
/**
|
|
774
|
+
* Prefer `String#split()` with a limit.
|
|
775
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-split-limit.md
|
|
776
|
+
*/
|
|
777
|
+
'unicorn/prefer-split-limit'?: Linter.RuleEntry<[]>
|
|
640
778
|
/**
|
|
641
779
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
642
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
780
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-spread.md
|
|
643
781
|
*/
|
|
644
782
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
783
|
+
/**
|
|
784
|
+
* Prefer `String#matchAll()` over `RegExp#exec()` loops.
|
|
785
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-match-all.md
|
|
786
|
+
*/
|
|
787
|
+
'unicorn/prefer-string-match-all'?: Linter.RuleEntry<[]>
|
|
788
|
+
/**
|
|
789
|
+
* Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
|
|
790
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-pad-start-end.md
|
|
791
|
+
*/
|
|
792
|
+
'unicorn/prefer-string-pad-start-end'?: Linter.RuleEntry<[]>
|
|
645
793
|
/**
|
|
646
794
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
647
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
795
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-raw.md
|
|
648
796
|
*/
|
|
649
797
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
650
798
|
/**
|
|
651
|
-
* Prefer `String#
|
|
652
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
799
|
+
* Prefer `String#repeat()` for repeated whitespace.
|
|
800
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-repeat.md
|
|
801
|
+
*/
|
|
802
|
+
'unicorn/prefer-string-repeat'?: Linter.RuleEntry<UnicornPreferStringRepeat>
|
|
803
|
+
/**
|
|
804
|
+
* Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.
|
|
805
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-replace-all.md
|
|
653
806
|
*/
|
|
654
807
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
655
808
|
/**
|
|
656
809
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
657
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
810
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-slice.md
|
|
658
811
|
*/
|
|
659
812
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
660
813
|
/**
|
|
661
814
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
662
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
815
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-starts-ends-with.md
|
|
663
816
|
*/
|
|
664
817
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
665
818
|
/**
|
|
666
819
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
667
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
820
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-string-trim-start-end.md
|
|
668
821
|
*/
|
|
669
822
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
670
823
|
/**
|
|
671
824
|
* Prefer using `structuredClone` to create a deep clone.
|
|
672
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
825
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-structured-clone.md
|
|
673
826
|
*/
|
|
674
827
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
675
828
|
/**
|
|
676
829
|
* Prefer `switch` over multiple `else-if`.
|
|
677
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
830
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-switch.md
|
|
678
831
|
*/
|
|
679
832
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
680
833
|
/**
|
|
681
834
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
682
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
835
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-ternary.md
|
|
683
836
|
*/
|
|
684
837
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
685
838
|
/**
|
|
686
839
|
* Prefer top-level await over top-level promises and async function calls.
|
|
687
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
840
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-top-level-await.md
|
|
688
841
|
*/
|
|
689
842
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
690
843
|
/**
|
|
691
844
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
692
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
845
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prefer-type-error.md
|
|
693
846
|
*/
|
|
694
847
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
695
848
|
/**
|
|
696
849
|
* Prevent abbreviations.
|
|
697
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
850
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/prevent-abbreviations.md
|
|
698
851
|
*/
|
|
699
852
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
700
853
|
/**
|
|
701
854
|
* Enforce consistent relative URL style.
|
|
702
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
855
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/relative-url-style.md
|
|
703
856
|
*/
|
|
704
857
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
705
858
|
/**
|
|
706
859
|
* Enforce using the separator argument with `Array#join()`.
|
|
707
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
860
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-array-join-separator.md
|
|
708
861
|
*/
|
|
709
862
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
863
|
+
/**
|
|
864
|
+
* Require `CSS.escape()` for interpolated values in CSS selectors.
|
|
865
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-css-escape.md
|
|
866
|
+
*/
|
|
867
|
+
'unicorn/require-css-escape'?: Linter.RuleEntry<UnicornRequireCssEscape>
|
|
710
868
|
/**
|
|
711
869
|
* Require non-empty module attributes for imports and exports
|
|
712
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
870
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-attributes.md
|
|
713
871
|
*/
|
|
714
872
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>
|
|
715
873
|
/**
|
|
716
874
|
* Require non-empty specifier list in import and export statements.
|
|
717
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
875
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-module-specifiers.md
|
|
718
876
|
*/
|
|
719
877
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
720
878
|
/**
|
|
721
879
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
722
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
880
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-number-to-fixed-digits-argument.md
|
|
723
881
|
*/
|
|
724
882
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
883
|
+
/**
|
|
884
|
+
* Require passive event listeners for high-frequency events.
|
|
885
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-passive-events.md
|
|
886
|
+
*/
|
|
887
|
+
'unicorn/require-passive-events'?: Linter.RuleEntry<[]>
|
|
725
888
|
/**
|
|
726
889
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
727
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
890
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/require-post-message-target-origin.md
|
|
728
891
|
*/
|
|
729
892
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
730
893
|
/**
|
|
731
894
|
* Enforce better string content.
|
|
732
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
895
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/string-content.md
|
|
733
896
|
*/
|
|
734
897
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
735
898
|
/**
|
|
736
899
|
* Enforce consistent brace style for `case` clauses.
|
|
737
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
900
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-braces.md
|
|
738
901
|
*/
|
|
739
902
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
740
903
|
/**
|
|
741
904
|
* Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.
|
|
742
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
905
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/switch-case-break-position.md
|
|
743
906
|
*/
|
|
744
907
|
'unicorn/switch-case-break-position'?: Linter.RuleEntry<[]>
|
|
745
908
|
/**
|
|
746
909
|
* Fix whitespace-insensitive template indentation.
|
|
747
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
910
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/template-indent.md
|
|
748
911
|
*/
|
|
749
912
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
750
913
|
/**
|
|
751
914
|
* Enforce consistent case for text encoding identifiers.
|
|
752
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
915
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/text-encoding-identifier-case.md
|
|
753
916
|
*/
|
|
754
917
|
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>
|
|
755
918
|
/**
|
|
756
919
|
* Require `new` when creating an error.
|
|
757
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
920
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/throw-new-error.md
|
|
758
921
|
*/
|
|
759
922
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
923
|
+
/**
|
|
924
|
+
* Limit the complexity of `try` blocks.
|
|
925
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v65.0.1/docs/rules/try-complexity.md
|
|
926
|
+
*/
|
|
927
|
+
'unicorn/try-complexity'?: Linter.RuleEntry<UnicornTryComplexity>
|
|
760
928
|
}
|
|
761
929
|
|
|
762
930
|
/* ======= Declarations ======= */
|
|
763
|
-
// ----- unicorn/better-regex -----
|
|
764
|
-
type UnicornBetterRegex = []|[{
|
|
765
|
-
|
|
766
|
-
sortCharacterClasses?: boolean
|
|
767
|
-
}]
|
|
768
931
|
// ----- unicorn/catch-error-name -----
|
|
769
932
|
type UnicornCatchErrorName = []|[{
|
|
770
933
|
|
|
@@ -772,11 +935,41 @@ type UnicornCatchErrorName = []|[{
|
|
|
772
935
|
|
|
773
936
|
ignore?: unknown[]
|
|
774
937
|
}]
|
|
938
|
+
// ----- unicorn/consistent-compound-words -----
|
|
939
|
+
type UnicornConsistentCompoundWords = []|[{
|
|
940
|
+
|
|
941
|
+
checkProperties?: boolean
|
|
942
|
+
|
|
943
|
+
checkVariables?: boolean
|
|
944
|
+
|
|
945
|
+
checkDefaultAndNamespaceImports?: (boolean | "internal")
|
|
946
|
+
|
|
947
|
+
checkShorthandImports?: (boolean | "internal")
|
|
948
|
+
|
|
949
|
+
checkShorthandProperties?: boolean
|
|
950
|
+
|
|
951
|
+
extendDefaultReplacements?: boolean
|
|
952
|
+
replacements?: _UnicornConsistentCompoundWords_Replacements
|
|
953
|
+
allowList?: _UnicornConsistentCompoundWords_TrueObject
|
|
954
|
+
}]
|
|
955
|
+
interface _UnicornConsistentCompoundWords_Replacements {
|
|
956
|
+
[k: string]: (false | string) | undefined
|
|
957
|
+
}
|
|
958
|
+
interface _UnicornConsistentCompoundWords_TrueObject {
|
|
959
|
+
[k: string]: true | undefined
|
|
960
|
+
}
|
|
775
961
|
// ----- unicorn/consistent-function-scoping -----
|
|
776
962
|
type UnicornConsistentFunctionScoping = []|[{
|
|
777
963
|
|
|
778
964
|
checkArrowFunctions?: boolean
|
|
779
965
|
}]
|
|
966
|
+
// ----- unicorn/consistent-json-file-read -----
|
|
967
|
+
type UnicornConsistentJsonFileRead = []|[("string" | "buffer")]
|
|
968
|
+
// ----- unicorn/dom-node-dataset -----
|
|
969
|
+
type UnicornDomNodeDataset = []|[{
|
|
970
|
+
|
|
971
|
+
preferAttributes?: boolean
|
|
972
|
+
}]
|
|
780
973
|
// ----- unicorn/escape-case -----
|
|
781
974
|
type UnicornEscapeCase = []|[("uppercase" | "lowercase")]
|
|
782
975
|
// ----- unicorn/expiring-todo-comments -----
|
|
@@ -786,9 +979,9 @@ type UnicornExpiringTodoComments = []|[{
|
|
|
786
979
|
|
|
787
980
|
ignore?: unknown[]
|
|
788
981
|
|
|
789
|
-
|
|
982
|
+
checkDates?: boolean
|
|
790
983
|
|
|
791
|
-
|
|
984
|
+
checkDatesOnPullRequests?: boolean
|
|
792
985
|
|
|
793
986
|
allowWarningComments?: boolean
|
|
794
987
|
|
|
@@ -806,6 +999,8 @@ type UnicornFilenameCase = []|[({
|
|
|
806
999
|
ignore?: unknown[]
|
|
807
1000
|
|
|
808
1001
|
multipleFileExtensions?: boolean
|
|
1002
|
+
|
|
1003
|
+
checkDirectories?: boolean
|
|
809
1004
|
} | {
|
|
810
1005
|
|
|
811
1006
|
cases?: {
|
|
@@ -822,6 +1017,8 @@ type UnicornFilenameCase = []|[({
|
|
|
822
1017
|
ignore?: unknown[]
|
|
823
1018
|
|
|
824
1019
|
multipleFileExtensions?: boolean
|
|
1020
|
+
|
|
1021
|
+
checkDirectories?: boolean
|
|
825
1022
|
})]
|
|
826
1023
|
// ----- unicorn/import-style -----
|
|
827
1024
|
type UnicornImportStyle = []|[{
|
|
@@ -857,6 +1054,11 @@ type UnicornIsolatedFunctions = []|[{
|
|
|
857
1054
|
|
|
858
1055
|
comments?: string[]
|
|
859
1056
|
}]
|
|
1057
|
+
// ----- unicorn/no-array-callback-reference -----
|
|
1058
|
+
type UnicornNoArrayCallbackReference = []|[{
|
|
1059
|
+
|
|
1060
|
+
ignore?: string[]
|
|
1061
|
+
}]
|
|
860
1062
|
// ----- unicorn/no-array-reduce -----
|
|
861
1063
|
type UnicornNoArrayReduce = []|[{
|
|
862
1064
|
|
|
@@ -870,6 +1072,11 @@ type UnicornNoArrayReverse = []|[{
|
|
|
870
1072
|
type UnicornNoArraySort = []|[{
|
|
871
1073
|
allowExpressionStatement?: boolean
|
|
872
1074
|
}]
|
|
1075
|
+
// ----- unicorn/no-empty-file -----
|
|
1076
|
+
type UnicornNoEmptyFile = []|[{
|
|
1077
|
+
|
|
1078
|
+
allowComments?: boolean
|
|
1079
|
+
}]
|
|
873
1080
|
// ----- unicorn/no-instanceof-builtins -----
|
|
874
1081
|
type UnicornNoInstanceofBuiltins = []|[{
|
|
875
1082
|
useErrorIsError?: boolean
|
|
@@ -889,6 +1096,8 @@ type UnicornNoKeywordPrefix = []|[{
|
|
|
889
1096
|
// ----- unicorn/no-null -----
|
|
890
1097
|
type UnicornNoNull = []|[{
|
|
891
1098
|
|
|
1099
|
+
checkArguments?: boolean
|
|
1100
|
+
|
|
892
1101
|
checkStrictEquality?: boolean
|
|
893
1102
|
}]
|
|
894
1103
|
// ----- unicorn/no-typeof-undefined -----
|
|
@@ -899,7 +1108,7 @@ type UnicornNoTypeofUndefined = []|[{
|
|
|
899
1108
|
// ----- unicorn/no-unnecessary-polyfills -----
|
|
900
1109
|
type UnicornNoUnnecessaryPolyfills = []|[{
|
|
901
1110
|
|
|
902
|
-
targets
|
|
1111
|
+
targets?: (string | unknown[] | {
|
|
903
1112
|
[k: string]: unknown | undefined
|
|
904
1113
|
})
|
|
905
1114
|
}]
|
|
@@ -947,6 +1156,8 @@ type UnicornNumericSeparatorsStyle = []|[{
|
|
|
947
1156
|
minimumDigits?: number
|
|
948
1157
|
|
|
949
1158
|
groupLength?: number
|
|
1159
|
+
|
|
1160
|
+
fractionGroupLength?: number
|
|
950
1161
|
}
|
|
951
1162
|
|
|
952
1163
|
onlyIfContainsSeparator?: boolean
|
|
@@ -976,7 +1187,12 @@ type UnicornPreferAt = []|[{
|
|
|
976
1187
|
// ----- unicorn/prefer-export-from -----
|
|
977
1188
|
type UnicornPreferExportFrom = []|[{
|
|
978
1189
|
|
|
979
|
-
|
|
1190
|
+
checkUsedVariables?: boolean
|
|
1191
|
+
}]
|
|
1192
|
+
// ----- unicorn/prefer-includes-over-repeated-comparisons -----
|
|
1193
|
+
type UnicornPreferIncludesOverRepeatedComparisons = []|[{
|
|
1194
|
+
|
|
1195
|
+
minimumComparisons?: number
|
|
980
1196
|
}]
|
|
981
1197
|
// ----- unicorn/prefer-number-properties -----
|
|
982
1198
|
type UnicornPreferNumberProperties = []|[{
|
|
@@ -990,11 +1206,33 @@ type UnicornPreferObjectFromEntries = []|[{
|
|
|
990
1206
|
|
|
991
1207
|
functions?: unknown[]
|
|
992
1208
|
}]
|
|
1209
|
+
// ----- unicorn/prefer-query-selector -----
|
|
1210
|
+
type UnicornPreferQuerySelector = []|[{
|
|
1211
|
+
|
|
1212
|
+
allowWithVariables?: boolean
|
|
1213
|
+
}]
|
|
1214
|
+
// ----- unicorn/prefer-queue-microtask -----
|
|
1215
|
+
type UnicornPreferQueueMicrotask = []|[{
|
|
1216
|
+
|
|
1217
|
+
checkSetImmediate?: boolean
|
|
1218
|
+
|
|
1219
|
+
checkSetTimeout?: boolean
|
|
1220
|
+
}]
|
|
1221
|
+
// ----- unicorn/prefer-set-has -----
|
|
1222
|
+
type UnicornPreferSetHas = []|[{
|
|
1223
|
+
|
|
1224
|
+
minimumItems?: number
|
|
1225
|
+
}]
|
|
993
1226
|
// ----- unicorn/prefer-single-call -----
|
|
994
1227
|
type UnicornPreferSingleCall = []|[{
|
|
995
1228
|
|
|
996
1229
|
ignore?: unknown[]
|
|
997
1230
|
}]
|
|
1231
|
+
// ----- unicorn/prefer-string-repeat -----
|
|
1232
|
+
type UnicornPreferStringRepeat = []|[{
|
|
1233
|
+
|
|
1234
|
+
minimumRepetitions?: number
|
|
1235
|
+
}]
|
|
998
1236
|
// ----- unicorn/prefer-structured-clone -----
|
|
999
1237
|
type UnicornPreferStructuredClone = []|[{
|
|
1000
1238
|
|
|
@@ -1044,6 +1282,11 @@ interface _UnicornPreventAbbreviations_BooleanObject {
|
|
|
1044
1282
|
}
|
|
1045
1283
|
// ----- unicorn/relative-url-style -----
|
|
1046
1284
|
type UnicornRelativeUrlStyle = []|[("never" | "always")]
|
|
1285
|
+
// ----- unicorn/require-css-escape -----
|
|
1286
|
+
type UnicornRequireCssEscape = []|[{
|
|
1287
|
+
|
|
1288
|
+
checkAllSelectors?: boolean
|
|
1289
|
+
}]
|
|
1047
1290
|
// ----- unicorn/string-content -----
|
|
1048
1291
|
type UnicornStringContent = []|[{
|
|
1049
1292
|
|
|
@@ -1051,9 +1294,12 @@ type UnicornStringContent = []|[{
|
|
|
1051
1294
|
[k: string]: (string | {
|
|
1052
1295
|
suggest: string
|
|
1053
1296
|
fix?: boolean
|
|
1297
|
+
caseSensitive?: boolean
|
|
1054
1298
|
message?: string
|
|
1055
1299
|
}) | undefined
|
|
1056
1300
|
}
|
|
1301
|
+
|
|
1302
|
+
selectors?: string[]
|
|
1057
1303
|
}]
|
|
1058
1304
|
// ----- unicorn/switch-case-braces -----
|
|
1059
1305
|
type UnicornSwitchCaseBraces = []|[("always" | "avoid")]
|
|
@@ -1074,4 +1320,9 @@ type UnicornTemplateIndent = []|[{
|
|
|
1074
1320
|
type UnicornTextEncodingIdentifierCase = []|[{
|
|
1075
1321
|
|
|
1076
1322
|
withDash?: boolean
|
|
1323
|
+
}]
|
|
1324
|
+
// ----- unicorn/try-complexity -----
|
|
1325
|
+
type UnicornTryComplexity = []|[{
|
|
1326
|
+
|
|
1327
|
+
max?: number
|
|
1077
1328
|
}]
|