@w5s/eslint-config 3.2.0 → 3.3.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 +366 -153
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +40 -14
- package/src/typegen/jsdoc.d.ts +27 -0
- package/src/typegen/node.d.ts +14 -0
- package/src/typegen/style.d.ts +23 -6
- package/src/typegen/test.d.ts +111 -5
- package/src/typegen/ts.d.ts +30 -0
- package/src/typegen/unicorn.d.ts +161 -142
package/src/typegen/unicorn.d.ts
CHANGED
|
@@ -11,710 +11,725 @@ declare module 'eslint' {
|
|
|
11
11
|
export interface RuleOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Improve regexes by making them shorter, consistent, and safer.
|
|
14
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
14
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/better-regex.md
|
|
15
15
|
*/
|
|
16
16
|
'unicorn/better-regex'?: Linter.RuleEntry<UnicornBetterRegex>
|
|
17
17
|
/**
|
|
18
18
|
* Enforce a specific parameter name in catch clauses.
|
|
19
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
19
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/catch-error-name.md
|
|
20
20
|
*/
|
|
21
21
|
'unicorn/catch-error-name'?: Linter.RuleEntry<UnicornCatchErrorName>
|
|
22
22
|
/**
|
|
23
23
|
* Enforce consistent assertion style with `node:assert`.
|
|
24
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
24
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-assert.md
|
|
25
25
|
*/
|
|
26
26
|
'unicorn/consistent-assert'?: Linter.RuleEntry<[]>
|
|
27
27
|
/**
|
|
28
28
|
* Prefer passing `Date` directly to the constructor when cloning.
|
|
29
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
29
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-date-clone.md
|
|
30
30
|
*/
|
|
31
31
|
'unicorn/consistent-date-clone'?: Linter.RuleEntry<[]>
|
|
32
32
|
/**
|
|
33
33
|
* Use destructured variables over properties.
|
|
34
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
34
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-destructuring.md
|
|
35
35
|
*/
|
|
36
36
|
'unicorn/consistent-destructuring'?: Linter.RuleEntry<[]>
|
|
37
37
|
/**
|
|
38
38
|
* Prefer consistent types when spreading a ternary in an array literal.
|
|
39
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
39
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-empty-array-spread.md
|
|
40
40
|
*/
|
|
41
41
|
'unicorn/consistent-empty-array-spread'?: Linter.RuleEntry<[]>
|
|
42
42
|
/**
|
|
43
43
|
* Enforce consistent style for element existence checks with `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`.
|
|
44
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
44
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-existence-index-check.md
|
|
45
45
|
*/
|
|
46
46
|
'unicorn/consistent-existence-index-check'?: Linter.RuleEntry<[]>
|
|
47
47
|
/**
|
|
48
48
|
* Move function definitions to the highest possible scope.
|
|
49
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
49
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/consistent-function-scoping.md
|
|
50
50
|
*/
|
|
51
51
|
'unicorn/consistent-function-scoping'?: Linter.RuleEntry<UnicornConsistentFunctionScoping>
|
|
52
52
|
/**
|
|
53
53
|
* Enforce correct `Error` subclassing.
|
|
54
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
54
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/custom-error-definition.md
|
|
55
55
|
*/
|
|
56
56
|
'unicorn/custom-error-definition'?: Linter.RuleEntry<[]>
|
|
57
57
|
/**
|
|
58
58
|
* Enforce no spaces between braces.
|
|
59
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
59
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/empty-brace-spaces.md
|
|
60
60
|
*/
|
|
61
61
|
'unicorn/empty-brace-spaces'?: Linter.RuleEntry<[]>
|
|
62
62
|
/**
|
|
63
63
|
* Enforce passing a `message` value when creating a built-in error.
|
|
64
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
64
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/error-message.md
|
|
65
65
|
*/
|
|
66
66
|
'unicorn/error-message'?: Linter.RuleEntry<[]>
|
|
67
67
|
/**
|
|
68
68
|
* Require escape sequences to use uppercase or lowercase values.
|
|
69
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
69
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/escape-case.md
|
|
70
70
|
*/
|
|
71
71
|
'unicorn/escape-case'?: Linter.RuleEntry<UnicornEscapeCase>
|
|
72
72
|
/**
|
|
73
73
|
* Add expiration conditions to TODO comments.
|
|
74
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
74
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/expiring-todo-comments.md
|
|
75
75
|
*/
|
|
76
76
|
'unicorn/expiring-todo-comments'?: Linter.RuleEntry<UnicornExpiringTodoComments>
|
|
77
77
|
/**
|
|
78
78
|
* Enforce explicitly comparing the `length` or `size` property of a value.
|
|
79
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
79
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/explicit-length-check.md
|
|
80
80
|
*/
|
|
81
81
|
'unicorn/explicit-length-check'?: Linter.RuleEntry<UnicornExplicitLengthCheck>
|
|
82
82
|
/**
|
|
83
83
|
* Enforce a case style for filenames.
|
|
84
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
84
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/filename-case.md
|
|
85
85
|
*/
|
|
86
86
|
'unicorn/filename-case'?: Linter.RuleEntry<UnicornFilenameCase>
|
|
87
87
|
/**
|
|
88
88
|
* Enforce specific import styles per module.
|
|
89
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
89
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/import-style.md
|
|
90
90
|
*/
|
|
91
91
|
'unicorn/import-style'?: Linter.RuleEntry<UnicornImportStyle>
|
|
92
92
|
/**
|
|
93
93
|
* Enforce the use of `new` for all builtins, except `String`, `Number`, `Boolean`, `Symbol` and `BigInt`.
|
|
94
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
94
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/new-for-builtins.md
|
|
95
95
|
*/
|
|
96
96
|
'unicorn/new-for-builtins'?: Linter.RuleEntry<[]>
|
|
97
97
|
/**
|
|
98
98
|
* Enforce specifying rules to disable in `eslint-disable` comments.
|
|
99
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
99
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-abusive-eslint-disable.md
|
|
100
100
|
*/
|
|
101
101
|
'unicorn/no-abusive-eslint-disable'?: Linter.RuleEntry<[]>
|
|
102
102
|
/**
|
|
103
103
|
* Disallow recursive access to `this` within getters and setters.
|
|
104
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
104
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-accessor-recursion.md
|
|
105
105
|
*/
|
|
106
106
|
'unicorn/no-accessor-recursion'?: Linter.RuleEntry<[]>
|
|
107
107
|
/**
|
|
108
108
|
* Disallow anonymous functions and classes as the default export.
|
|
109
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
109
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-anonymous-default-export.md
|
|
110
110
|
*/
|
|
111
111
|
'unicorn/no-anonymous-default-export'?: Linter.RuleEntry<[]>
|
|
112
112
|
/**
|
|
113
113
|
* Prevent passing a function reference directly to iterator methods.
|
|
114
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
114
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-callback-reference.md
|
|
115
115
|
*/
|
|
116
116
|
'unicorn/no-array-callback-reference'?: Linter.RuleEntry<[]>
|
|
117
117
|
/**
|
|
118
118
|
* Prefer `for…of` over the `forEach` method.
|
|
119
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
119
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-for-each.md
|
|
120
120
|
*/
|
|
121
121
|
'unicorn/no-array-for-each'?: Linter.RuleEntry<[]>
|
|
122
122
|
/**
|
|
123
123
|
* Disallow using the `this` argument in array methods.
|
|
124
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
124
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-method-this-argument.md
|
|
125
125
|
*/
|
|
126
126
|
'unicorn/no-array-method-this-argument'?: Linter.RuleEntry<[]>
|
|
127
127
|
/**
|
|
128
128
|
* Replaced by `unicorn/prefer-single-call` which covers more cases.
|
|
129
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
129
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-array-push-push
|
|
130
130
|
* @deprecated
|
|
131
131
|
*/
|
|
132
132
|
'unicorn/no-array-push-push'?: Linter.RuleEntry<[]>
|
|
133
133
|
/**
|
|
134
134
|
* Disallow `Array#reduce()` and `Array#reduceRight()`.
|
|
135
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
135
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reduce.md
|
|
136
136
|
*/
|
|
137
137
|
'unicorn/no-array-reduce'?: Linter.RuleEntry<UnicornNoArrayReduce>
|
|
138
138
|
/**
|
|
139
139
|
* Prefer `Array#toReversed()` over `Array#reverse()`.
|
|
140
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
140
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-reverse.md
|
|
141
141
|
*/
|
|
142
142
|
'unicorn/no-array-reverse'?: Linter.RuleEntry<UnicornNoArrayReverse>
|
|
143
143
|
/**
|
|
144
144
|
* Prefer `Array#toSorted()` over `Array#sort()`.
|
|
145
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
145
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-array-sort.md
|
|
146
146
|
*/
|
|
147
147
|
'unicorn/no-array-sort'?: Linter.RuleEntry<UnicornNoArraySort>
|
|
148
148
|
/**
|
|
149
149
|
* Disallow member access from await expression.
|
|
150
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
150
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-expression-member.md
|
|
151
151
|
*/
|
|
152
152
|
'unicorn/no-await-expression-member'?: Linter.RuleEntry<[]>
|
|
153
153
|
/**
|
|
154
154
|
* Disallow using `await` in `Promise` method parameters.
|
|
155
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
155
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-await-in-promise-methods.md
|
|
156
156
|
*/
|
|
157
157
|
'unicorn/no-await-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
158
158
|
/**
|
|
159
159
|
* Do not use leading/trailing space between `console.log` parameters.
|
|
160
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
160
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-console-spaces.md
|
|
161
161
|
*/
|
|
162
162
|
'unicorn/no-console-spaces'?: Linter.RuleEntry<[]>
|
|
163
163
|
/**
|
|
164
164
|
* Do not use `document.cookie` directly.
|
|
165
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
165
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-document-cookie.md
|
|
166
166
|
*/
|
|
167
167
|
'unicorn/no-document-cookie'?: Linter.RuleEntry<[]>
|
|
168
168
|
/**
|
|
169
169
|
* Disallow empty files.
|
|
170
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
170
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-empty-file.md
|
|
171
171
|
*/
|
|
172
172
|
'unicorn/no-empty-file'?: Linter.RuleEntry<[]>
|
|
173
173
|
/**
|
|
174
174
|
* Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
175
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
175
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-for-loop.md
|
|
176
176
|
*/
|
|
177
177
|
'unicorn/no-for-loop'?: Linter.RuleEntry<[]>
|
|
178
178
|
/**
|
|
179
179
|
* Enforce the use of Unicode escapes instead of hexadecimal escapes.
|
|
180
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
180
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-hex-escape.md
|
|
181
181
|
*/
|
|
182
182
|
'unicorn/no-hex-escape'?: Linter.RuleEntry<[]>
|
|
183
|
+
/**
|
|
184
|
+
* Disallow immediate mutation after variable assignment.
|
|
185
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-immediate-mutation.md
|
|
186
|
+
*/
|
|
187
|
+
'unicorn/no-immediate-mutation'?: Linter.RuleEntry<[]>
|
|
183
188
|
/**
|
|
184
189
|
* Replaced by `unicorn/no-instanceof-builtins` which covers more cases.
|
|
185
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
190
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-instanceof-array
|
|
186
191
|
* @deprecated
|
|
187
192
|
*/
|
|
188
193
|
'unicorn/no-instanceof-array'?: Linter.RuleEntry<[]>
|
|
189
194
|
/**
|
|
190
195
|
* Disallow `instanceof` with built-in objects
|
|
191
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
196
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-instanceof-builtins.md
|
|
192
197
|
*/
|
|
193
198
|
'unicorn/no-instanceof-builtins'?: Linter.RuleEntry<UnicornNoInstanceofBuiltins>
|
|
194
199
|
/**
|
|
195
200
|
* Disallow invalid options in `fetch()` and `new Request()`.
|
|
196
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
201
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-fetch-options.md
|
|
197
202
|
*/
|
|
198
203
|
'unicorn/no-invalid-fetch-options'?: Linter.RuleEntry<[]>
|
|
199
204
|
/**
|
|
200
205
|
* Prevent calling `EventTarget#removeEventListener()` with the result of an expression.
|
|
201
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
206
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-invalid-remove-event-listener.md
|
|
202
207
|
*/
|
|
203
208
|
'unicorn/no-invalid-remove-event-listener'?: Linter.RuleEntry<[]>
|
|
204
209
|
/**
|
|
205
210
|
* Disallow identifiers starting with `new` or `class`.
|
|
206
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
211
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-keyword-prefix.md
|
|
207
212
|
*/
|
|
208
213
|
'unicorn/no-keyword-prefix'?: Linter.RuleEntry<UnicornNoKeywordPrefix>
|
|
209
214
|
/**
|
|
210
215
|
* Replaced by `unicorn/no-unnecessary-slice-end` which covers more cases.
|
|
211
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
216
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/deprecated-rules.md#no-length-as-slice-end
|
|
212
217
|
* @deprecated
|
|
213
218
|
*/
|
|
214
219
|
'unicorn/no-length-as-slice-end'?: Linter.RuleEntry<[]>
|
|
215
220
|
/**
|
|
216
221
|
* Disallow `if` statements as the only statement in `if` blocks without `else`.
|
|
217
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
222
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-lonely-if.md
|
|
218
223
|
*/
|
|
219
224
|
'unicorn/no-lonely-if'?: Linter.RuleEntry<[]>
|
|
220
225
|
/**
|
|
221
226
|
* Disallow a magic number as the `depth` argument in `Array#flat(…).`
|
|
222
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
227
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-magic-array-flat-depth.md
|
|
223
228
|
*/
|
|
224
229
|
'unicorn/no-magic-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
225
230
|
/**
|
|
226
231
|
* Disallow named usage of default import and export.
|
|
227
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
232
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-named-default.md
|
|
228
233
|
*/
|
|
229
234
|
'unicorn/no-named-default'?: Linter.RuleEntry<[]>
|
|
230
235
|
/**
|
|
231
236
|
* Disallow negated conditions.
|
|
232
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
237
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negated-condition.md
|
|
233
238
|
*/
|
|
234
239
|
'unicorn/no-negated-condition'?: Linter.RuleEntry<[]>
|
|
235
240
|
/**
|
|
236
241
|
* Disallow negated expression in equality check.
|
|
237
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
242
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-negation-in-equality-check.md
|
|
238
243
|
*/
|
|
239
244
|
'unicorn/no-negation-in-equality-check'?: Linter.RuleEntry<[]>
|
|
240
245
|
/**
|
|
241
246
|
* Disallow nested ternary expressions.
|
|
242
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
247
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-nested-ternary.md
|
|
243
248
|
*/
|
|
244
249
|
'unicorn/no-nested-ternary'?: Linter.RuleEntry<[]>
|
|
245
250
|
/**
|
|
246
251
|
* Disallow `new Array()`.
|
|
247
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
252
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-array.md
|
|
248
253
|
*/
|
|
249
254
|
'unicorn/no-new-array'?: Linter.RuleEntry<[]>
|
|
250
255
|
/**
|
|
251
256
|
* Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.
|
|
252
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
257
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-new-buffer.md
|
|
253
258
|
*/
|
|
254
259
|
'unicorn/no-new-buffer'?: Linter.RuleEntry<[]>
|
|
255
260
|
/**
|
|
256
261
|
* Disallow the use of the `null` literal.
|
|
257
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
262
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-null.md
|
|
258
263
|
*/
|
|
259
264
|
'unicorn/no-null'?: Linter.RuleEntry<UnicornNoNull>
|
|
260
265
|
/**
|
|
261
266
|
* Disallow the use of objects as default parameters.
|
|
262
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
267
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-object-as-default-parameter.md
|
|
263
268
|
*/
|
|
264
269
|
'unicorn/no-object-as-default-parameter'?: Linter.RuleEntry<[]>
|
|
265
270
|
/**
|
|
266
271
|
* Disallow `process.exit()`.
|
|
267
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
272
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-process-exit.md
|
|
268
273
|
*/
|
|
269
274
|
'unicorn/no-process-exit'?: Linter.RuleEntry<[]>
|
|
270
275
|
/**
|
|
271
276
|
* Disallow passing single-element arrays to `Promise` methods.
|
|
272
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
277
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-single-promise-in-promise-methods.md
|
|
273
278
|
*/
|
|
274
279
|
'unicorn/no-single-promise-in-promise-methods'?: Linter.RuleEntry<[]>
|
|
275
280
|
/**
|
|
276
281
|
* Disallow classes that only have static members.
|
|
277
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
282
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-static-only-class.md
|
|
278
283
|
*/
|
|
279
284
|
'unicorn/no-static-only-class'?: Linter.RuleEntry<[]>
|
|
280
285
|
/**
|
|
281
286
|
* Disallow `then` property.
|
|
282
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
287
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-thenable.md
|
|
283
288
|
*/
|
|
284
289
|
'unicorn/no-thenable'?: Linter.RuleEntry<[]>
|
|
285
290
|
/**
|
|
286
291
|
* Disallow assigning `this` to a variable.
|
|
287
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
292
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-this-assignment.md
|
|
288
293
|
*/
|
|
289
294
|
'unicorn/no-this-assignment'?: Linter.RuleEntry<[]>
|
|
290
295
|
/**
|
|
291
296
|
* Disallow comparing `undefined` using `typeof`.
|
|
292
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
297
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-typeof-undefined.md
|
|
293
298
|
*/
|
|
294
299
|
'unicorn/no-typeof-undefined'?: Linter.RuleEntry<UnicornNoTypeofUndefined>
|
|
295
300
|
/**
|
|
296
301
|
* Disallow using `1` as the `depth` argument of `Array#flat()`.
|
|
297
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
302
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-flat-depth.md
|
|
298
303
|
*/
|
|
299
304
|
'unicorn/no-unnecessary-array-flat-depth'?: Linter.RuleEntry<[]>
|
|
300
305
|
/**
|
|
301
306
|
* Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.
|
|
302
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
307
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-array-splice-count.md
|
|
303
308
|
*/
|
|
304
309
|
'unicorn/no-unnecessary-array-splice-count'?: Linter.RuleEntry<[]>
|
|
305
310
|
/**
|
|
306
311
|
* Disallow awaiting non-promise values.
|
|
307
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
312
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-await.md
|
|
308
313
|
*/
|
|
309
314
|
'unicorn/no-unnecessary-await'?: Linter.RuleEntry<[]>
|
|
310
315
|
/**
|
|
311
316
|
* Enforce the use of built-in methods instead of unnecessary polyfills.
|
|
312
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
317
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-polyfills.md
|
|
313
318
|
*/
|
|
314
319
|
'unicorn/no-unnecessary-polyfills'?: Linter.RuleEntry<UnicornNoUnnecessaryPolyfills>
|
|
315
320
|
/**
|
|
316
321
|
* Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.
|
|
317
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
322
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unnecessary-slice-end.md
|
|
318
323
|
*/
|
|
319
324
|
'unicorn/no-unnecessary-slice-end'?: Linter.RuleEntry<[]>
|
|
320
325
|
/**
|
|
321
326
|
* Disallow unreadable array destructuring.
|
|
322
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
327
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-array-destructuring.md
|
|
323
328
|
*/
|
|
324
329
|
'unicorn/no-unreadable-array-destructuring'?: Linter.RuleEntry<[]>
|
|
325
330
|
/**
|
|
326
331
|
* Disallow unreadable IIFEs.
|
|
327
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
332
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unreadable-iife.md
|
|
328
333
|
*/
|
|
329
334
|
'unicorn/no-unreadable-iife'?: Linter.RuleEntry<[]>
|
|
330
335
|
/**
|
|
331
336
|
* Disallow unused object properties.
|
|
332
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
337
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-unused-properties.md
|
|
333
338
|
*/
|
|
334
339
|
'unicorn/no-unused-properties'?: Linter.RuleEntry<[]>
|
|
340
|
+
/**
|
|
341
|
+
* Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
|
|
342
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-collection-argument.md
|
|
343
|
+
*/
|
|
344
|
+
'unicorn/no-useless-collection-argument'?: Linter.RuleEntry<[]>
|
|
335
345
|
/**
|
|
336
346
|
* Disallow unnecessary `Error.captureStackTrace(…)`.
|
|
337
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
347
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-error-capture-stack-trace.md
|
|
338
348
|
*/
|
|
339
349
|
'unicorn/no-useless-error-capture-stack-trace'?: Linter.RuleEntry<[]>
|
|
340
350
|
/**
|
|
341
351
|
* Disallow useless fallback when spreading in object literals.
|
|
342
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
352
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-fallback-in-spread.md
|
|
343
353
|
*/
|
|
344
354
|
'unicorn/no-useless-fallback-in-spread'?: Linter.RuleEntry<[]>
|
|
345
355
|
/**
|
|
346
356
|
* Disallow useless array length check.
|
|
347
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
357
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-length-check.md
|
|
348
358
|
*/
|
|
349
359
|
'unicorn/no-useless-length-check'?: Linter.RuleEntry<[]>
|
|
350
360
|
/**
|
|
351
361
|
* Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
|
|
352
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
362
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-promise-resolve-reject.md
|
|
353
363
|
*/
|
|
354
364
|
'unicorn/no-useless-promise-resolve-reject'?: Linter.RuleEntry<[]>
|
|
355
365
|
/**
|
|
356
366
|
* Disallow unnecessary spread.
|
|
357
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
367
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-spread.md
|
|
358
368
|
*/
|
|
359
369
|
'unicorn/no-useless-spread'?: Linter.RuleEntry<[]>
|
|
360
370
|
/**
|
|
361
371
|
* Disallow useless case in switch statements.
|
|
362
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
372
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-switch-case.md
|
|
363
373
|
*/
|
|
364
374
|
'unicorn/no-useless-switch-case'?: Linter.RuleEntry<[]>
|
|
365
375
|
/**
|
|
366
376
|
* Disallow useless `undefined`.
|
|
367
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
377
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-useless-undefined.md
|
|
368
378
|
*/
|
|
369
379
|
'unicorn/no-useless-undefined'?: Linter.RuleEntry<UnicornNoUselessUndefined>
|
|
370
380
|
/**
|
|
371
381
|
* Disallow number literals with zero fractions or dangling dots.
|
|
372
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
382
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/no-zero-fractions.md
|
|
373
383
|
*/
|
|
374
384
|
'unicorn/no-zero-fractions'?: Linter.RuleEntry<[]>
|
|
375
385
|
/**
|
|
376
386
|
* Enforce proper case for numeric literals.
|
|
377
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
387
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/number-literal-case.md
|
|
378
388
|
*/
|
|
379
389
|
'unicorn/number-literal-case'?: Linter.RuleEntry<UnicornNumberLiteralCase>
|
|
380
390
|
/**
|
|
381
391
|
* Enforce the style of numeric separators by correctly grouping digits.
|
|
382
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
392
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/numeric-separators-style.md
|
|
383
393
|
*/
|
|
384
394
|
'unicorn/numeric-separators-style'?: Linter.RuleEntry<UnicornNumericSeparatorsStyle>
|
|
385
395
|
/**
|
|
386
396
|
* Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
387
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
397
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-add-event-listener.md
|
|
388
398
|
*/
|
|
389
399
|
'unicorn/prefer-add-event-listener'?: Linter.RuleEntry<UnicornPreferAddEventListener>
|
|
390
400
|
/**
|
|
391
401
|
* Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.
|
|
392
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
402
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-find.md
|
|
393
403
|
*/
|
|
394
404
|
'unicorn/prefer-array-find'?: Linter.RuleEntry<UnicornPreferArrayFind>
|
|
395
405
|
/**
|
|
396
406
|
* Prefer `Array#flat()` over legacy techniques to flatten arrays.
|
|
397
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
407
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat.md
|
|
398
408
|
*/
|
|
399
409
|
'unicorn/prefer-array-flat'?: Linter.RuleEntry<UnicornPreferArrayFlat>
|
|
400
410
|
/**
|
|
401
411
|
* Prefer `.flatMap(…)` over `.map(…).flat()`.
|
|
402
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
412
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-flat-map.md
|
|
403
413
|
*/
|
|
404
414
|
'unicorn/prefer-array-flat-map'?: Linter.RuleEntry<[]>
|
|
405
415
|
/**
|
|
406
416
|
* Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.
|
|
407
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
417
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-index-of.md
|
|
408
418
|
*/
|
|
409
419
|
'unicorn/prefer-array-index-of'?: Linter.RuleEntry<[]>
|
|
410
420
|
/**
|
|
411
421
|
* Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.
|
|
412
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
422
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-array-some.md
|
|
413
423
|
*/
|
|
414
424
|
'unicorn/prefer-array-some'?: Linter.RuleEntry<[]>
|
|
415
425
|
/**
|
|
416
426
|
* Prefer `.at()` method for index access and `String#charAt()`.
|
|
417
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
427
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-at.md
|
|
418
428
|
*/
|
|
419
429
|
'unicorn/prefer-at'?: Linter.RuleEntry<UnicornPreferAt>
|
|
420
430
|
/**
|
|
421
431
|
* Prefer `BigInt` literals over the constructor.
|
|
422
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
432
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-bigint-literals.md
|
|
423
433
|
*/
|
|
424
434
|
'unicorn/prefer-bigint-literals'?: Linter.RuleEntry<[]>
|
|
425
435
|
/**
|
|
426
436
|
* Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.
|
|
427
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
437
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-blob-reading-methods.md
|
|
428
438
|
*/
|
|
429
439
|
'unicorn/prefer-blob-reading-methods'?: Linter.RuleEntry<[]>
|
|
430
440
|
/**
|
|
431
441
|
* Prefer class field declarations over `this` assignments in constructors.
|
|
432
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
442
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-class-fields.md
|
|
433
443
|
*/
|
|
434
444
|
'unicorn/prefer-class-fields'?: Linter.RuleEntry<[]>
|
|
435
445
|
/**
|
|
436
446
|
* Prefer using `Element#classList.toggle()` to toggle class names.
|
|
437
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
447
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-classlist-toggle.md
|
|
438
448
|
*/
|
|
439
449
|
'unicorn/prefer-classlist-toggle'?: Linter.RuleEntry<[]>
|
|
440
450
|
/**
|
|
441
451
|
* Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.
|
|
442
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
452
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-code-point.md
|
|
443
453
|
*/
|
|
444
454
|
'unicorn/prefer-code-point'?: Linter.RuleEntry<[]>
|
|
445
455
|
/**
|
|
446
456
|
* Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.
|
|
447
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
457
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-date-now.md
|
|
448
458
|
*/
|
|
449
459
|
'unicorn/prefer-date-now'?: Linter.RuleEntry<[]>
|
|
450
460
|
/**
|
|
451
461
|
* Prefer default parameters over reassignment.
|
|
452
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
462
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-default-parameters.md
|
|
453
463
|
*/
|
|
454
464
|
'unicorn/prefer-default-parameters'?: Linter.RuleEntry<[]>
|
|
455
465
|
/**
|
|
456
466
|
* Prefer `Node#append()` over `Node#appendChild()`.
|
|
457
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
467
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-append.md
|
|
458
468
|
*/
|
|
459
469
|
'unicorn/prefer-dom-node-append'?: Linter.RuleEntry<[]>
|
|
460
470
|
/**
|
|
461
471
|
* Prefer using `.dataset` on DOM elements over calling attribute methods.
|
|
462
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
472
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-dataset.md
|
|
463
473
|
*/
|
|
464
474
|
'unicorn/prefer-dom-node-dataset'?: Linter.RuleEntry<[]>
|
|
465
475
|
/**
|
|
466
476
|
* Prefer `childNode.remove()` over `parentNode.removeChild(childNode)`.
|
|
467
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
477
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-remove.md
|
|
468
478
|
*/
|
|
469
479
|
'unicorn/prefer-dom-node-remove'?: Linter.RuleEntry<[]>
|
|
470
480
|
/**
|
|
471
481
|
* Prefer `.textContent` over `.innerText`.
|
|
472
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
482
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-dom-node-text-content.md
|
|
473
483
|
*/
|
|
474
484
|
'unicorn/prefer-dom-node-text-content'?: Linter.RuleEntry<[]>
|
|
475
485
|
/**
|
|
476
486
|
* Prefer `EventTarget` over `EventEmitter`.
|
|
477
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
487
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-event-target.md
|
|
478
488
|
*/
|
|
479
489
|
'unicorn/prefer-event-target'?: Linter.RuleEntry<[]>
|
|
480
490
|
/**
|
|
481
491
|
* Prefer `export…from` when re-exporting.
|
|
482
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
492
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-export-from.md
|
|
483
493
|
*/
|
|
484
494
|
'unicorn/prefer-export-from'?: Linter.RuleEntry<UnicornPreferExportFrom>
|
|
485
495
|
/**
|
|
486
496
|
* Prefer `globalThis` over `window`, `self`, and `global`.
|
|
487
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
497
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-global-this.md
|
|
488
498
|
*/
|
|
489
499
|
'unicorn/prefer-global-this'?: Linter.RuleEntry<[]>
|
|
490
500
|
/**
|
|
491
501
|
* Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.
|
|
492
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
502
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-import-meta-properties.md
|
|
493
503
|
*/
|
|
494
504
|
'unicorn/prefer-import-meta-properties'?: Linter.RuleEntry<[]>
|
|
495
505
|
/**
|
|
496
506
|
* Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
|
|
497
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
507
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-includes.md
|
|
498
508
|
*/
|
|
499
509
|
'unicorn/prefer-includes'?: Linter.RuleEntry<[]>
|
|
500
510
|
/**
|
|
501
511
|
* Prefer reading a JSON file as a buffer.
|
|
502
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
512
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-json-parse-buffer.md
|
|
503
513
|
*/
|
|
504
514
|
'unicorn/prefer-json-parse-buffer'?: Linter.RuleEntry<[]>
|
|
505
515
|
/**
|
|
506
516
|
* Prefer `KeyboardEvent#key` over `KeyboardEvent#keyCode`.
|
|
507
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
517
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-keyboard-event-key.md
|
|
508
518
|
*/
|
|
509
519
|
'unicorn/prefer-keyboard-event-key'?: Linter.RuleEntry<[]>
|
|
510
520
|
/**
|
|
511
521
|
* Prefer using a logical operator over a ternary.
|
|
512
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
522
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-logical-operator-over-ternary.md
|
|
513
523
|
*/
|
|
514
524
|
'unicorn/prefer-logical-operator-over-ternary'?: Linter.RuleEntry<[]>
|
|
515
525
|
/**
|
|
516
526
|
* Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
|
|
517
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
527
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-min-max.md
|
|
518
528
|
*/
|
|
519
529
|
'unicorn/prefer-math-min-max'?: Linter.RuleEntry<[]>
|
|
520
530
|
/**
|
|
521
531
|
* Enforce the use of `Math.trunc` instead of bitwise operators.
|
|
522
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
532
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-math-trunc.md
|
|
523
533
|
*/
|
|
524
534
|
'unicorn/prefer-math-trunc'?: Linter.RuleEntry<[]>
|
|
525
535
|
/**
|
|
526
536
|
* Prefer `.before()` over `.insertBefore()`, `.replaceWith()` over `.replaceChild()`, prefer one of `.before()`, `.after()`, `.append()` or `.prepend()` over `insertAdjacentText()` and `insertAdjacentElement()`.
|
|
527
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
537
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-dom-apis.md
|
|
528
538
|
*/
|
|
529
539
|
'unicorn/prefer-modern-dom-apis'?: Linter.RuleEntry<[]>
|
|
530
540
|
/**
|
|
531
541
|
* Prefer modern `Math` APIs over legacy patterns.
|
|
532
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
542
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-modern-math-apis.md
|
|
533
543
|
*/
|
|
534
544
|
'unicorn/prefer-modern-math-apis'?: Linter.RuleEntry<[]>
|
|
535
545
|
/**
|
|
536
546
|
* Prefer JavaScript modules (ESM) over CommonJS.
|
|
537
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
547
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-module.md
|
|
538
548
|
*/
|
|
539
549
|
'unicorn/prefer-module'?: Linter.RuleEntry<[]>
|
|
540
550
|
/**
|
|
541
551
|
* Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.
|
|
542
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
552
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-native-coercion-functions.md
|
|
543
553
|
*/
|
|
544
554
|
'unicorn/prefer-native-coercion-functions'?: Linter.RuleEntry<[]>
|
|
545
555
|
/**
|
|
546
556
|
* Prefer negative index over `.length - index` when possible.
|
|
547
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
557
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-negative-index.md
|
|
548
558
|
*/
|
|
549
559
|
'unicorn/prefer-negative-index'?: Linter.RuleEntry<[]>
|
|
550
560
|
/**
|
|
551
561
|
* Prefer using the `node:` protocol when importing Node.js builtin modules.
|
|
552
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
562
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-node-protocol.md
|
|
553
563
|
*/
|
|
554
564
|
'unicorn/prefer-node-protocol'?: Linter.RuleEntry<[]>
|
|
555
565
|
/**
|
|
556
566
|
* Prefer `Number` static properties over global ones.
|
|
557
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
567
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-number-properties.md
|
|
558
568
|
*/
|
|
559
569
|
'unicorn/prefer-number-properties'?: Linter.RuleEntry<UnicornPreferNumberProperties>
|
|
560
570
|
/**
|
|
561
571
|
* Prefer using `Object.fromEntries(…)` to transform a list of key-value pairs into an object.
|
|
562
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
572
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-object-from-entries.md
|
|
563
573
|
*/
|
|
564
574
|
'unicorn/prefer-object-from-entries'?: Linter.RuleEntry<UnicornPreferObjectFromEntries>
|
|
565
575
|
/**
|
|
566
576
|
* Prefer omitting the `catch` binding parameter.
|
|
567
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
577
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-optional-catch-binding.md
|
|
568
578
|
*/
|
|
569
579
|
'unicorn/prefer-optional-catch-binding'?: Linter.RuleEntry<[]>
|
|
570
580
|
/**
|
|
571
581
|
* Prefer borrowing methods from the prototype instead of the instance.
|
|
572
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
582
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-prototype-methods.md
|
|
573
583
|
*/
|
|
574
584
|
'unicorn/prefer-prototype-methods'?: Linter.RuleEntry<[]>
|
|
575
585
|
/**
|
|
576
586
|
* Prefer `.querySelector()` over `.getElementById()`, `.querySelectorAll()` over `.getElementsByClassName()` and `.getElementsByTagName()` and `.getElementsByName()`.
|
|
577
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
587
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-query-selector.md
|
|
578
588
|
*/
|
|
579
589
|
'unicorn/prefer-query-selector'?: Linter.RuleEntry<[]>
|
|
580
590
|
/**
|
|
581
591
|
* Prefer `Reflect.apply()` over `Function#apply()`.
|
|
582
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
592
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-reflect-apply.md
|
|
583
593
|
*/
|
|
584
594
|
'unicorn/prefer-reflect-apply'?: Linter.RuleEntry<[]>
|
|
585
595
|
/**
|
|
586
596
|
* Prefer `RegExp#test()` over `String#match()` and `RegExp#exec()`.
|
|
587
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
597
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-regexp-test.md
|
|
588
598
|
*/
|
|
589
599
|
'unicorn/prefer-regexp-test'?: Linter.RuleEntry<[]>
|
|
600
|
+
/**
|
|
601
|
+
* Prefer `Response.json()` over `new Response(JSON.stringify())`.
|
|
602
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-response-static-json.md
|
|
603
|
+
*/
|
|
604
|
+
'unicorn/prefer-response-static-json'?: Linter.RuleEntry<[]>
|
|
590
605
|
/**
|
|
591
606
|
* Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
|
|
592
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
607
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-has.md
|
|
593
608
|
*/
|
|
594
609
|
'unicorn/prefer-set-has'?: Linter.RuleEntry<[]>
|
|
595
610
|
/**
|
|
596
611
|
* Prefer using `Set#size` instead of `Array#length`.
|
|
597
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
612
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-set-size.md
|
|
598
613
|
*/
|
|
599
614
|
'unicorn/prefer-set-size'?: Linter.RuleEntry<[]>
|
|
600
615
|
/**
|
|
601
616
|
* Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
|
|
602
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
617
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-single-call.md
|
|
603
618
|
*/
|
|
604
619
|
'unicorn/prefer-single-call'?: Linter.RuleEntry<UnicornPreferSingleCall>
|
|
605
620
|
/**
|
|
606
621
|
* Prefer the spread operator over `Array.from(…)`, `Array#concat(…)`, `Array#{slice,toSpliced}()` and `String#split('')`.
|
|
607
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
622
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-spread.md
|
|
608
623
|
*/
|
|
609
624
|
'unicorn/prefer-spread'?: Linter.RuleEntry<[]>
|
|
610
625
|
/**
|
|
611
626
|
* Prefer using the `String.raw` tag to avoid escaping `\`.
|
|
612
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
627
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-raw.md
|
|
613
628
|
*/
|
|
614
629
|
'unicorn/prefer-string-raw'?: Linter.RuleEntry<[]>
|
|
615
630
|
/**
|
|
616
631
|
* Prefer `String#replaceAll()` over regex searches with the global flag.
|
|
617
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
632
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-replace-all.md
|
|
618
633
|
*/
|
|
619
634
|
'unicorn/prefer-string-replace-all'?: Linter.RuleEntry<[]>
|
|
620
635
|
/**
|
|
621
636
|
* Prefer `String#slice()` over `String#substr()` and `String#substring()`.
|
|
622
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
637
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-slice.md
|
|
623
638
|
*/
|
|
624
639
|
'unicorn/prefer-string-slice'?: Linter.RuleEntry<[]>
|
|
625
640
|
/**
|
|
626
641
|
* Prefer `String#startsWith()` & `String#endsWith()` over `RegExp#test()`.
|
|
627
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
642
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-starts-ends-with.md
|
|
628
643
|
*/
|
|
629
644
|
'unicorn/prefer-string-starts-ends-with'?: Linter.RuleEntry<[]>
|
|
630
645
|
/**
|
|
631
646
|
* Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.
|
|
632
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
647
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-string-trim-start-end.md
|
|
633
648
|
*/
|
|
634
649
|
'unicorn/prefer-string-trim-start-end'?: Linter.RuleEntry<[]>
|
|
635
650
|
/**
|
|
636
651
|
* Prefer using `structuredClone` to create a deep clone.
|
|
637
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
652
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-structured-clone.md
|
|
638
653
|
*/
|
|
639
654
|
'unicorn/prefer-structured-clone'?: Linter.RuleEntry<UnicornPreferStructuredClone>
|
|
640
655
|
/**
|
|
641
656
|
* Prefer `switch` over multiple `else-if`.
|
|
642
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
657
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-switch.md
|
|
643
658
|
*/
|
|
644
659
|
'unicorn/prefer-switch'?: Linter.RuleEntry<UnicornPreferSwitch>
|
|
645
660
|
/**
|
|
646
661
|
* Prefer ternary expressions over simple `if-else` statements.
|
|
647
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
662
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-ternary.md
|
|
648
663
|
*/
|
|
649
664
|
'unicorn/prefer-ternary'?: Linter.RuleEntry<UnicornPreferTernary>
|
|
650
665
|
/**
|
|
651
666
|
* Prefer top-level await over top-level promises and async function calls.
|
|
652
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
667
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-top-level-await.md
|
|
653
668
|
*/
|
|
654
669
|
'unicorn/prefer-top-level-await'?: Linter.RuleEntry<[]>
|
|
655
670
|
/**
|
|
656
671
|
* Enforce throwing `TypeError` in type checking conditions.
|
|
657
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
672
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prefer-type-error.md
|
|
658
673
|
*/
|
|
659
674
|
'unicorn/prefer-type-error'?: Linter.RuleEntry<[]>
|
|
660
675
|
/**
|
|
661
676
|
* Prevent abbreviations.
|
|
662
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
677
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/prevent-abbreviations.md
|
|
663
678
|
*/
|
|
664
679
|
'unicorn/prevent-abbreviations'?: Linter.RuleEntry<UnicornPreventAbbreviations>
|
|
665
680
|
/**
|
|
666
681
|
* Enforce consistent relative URL style.
|
|
667
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
682
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/relative-url-style.md
|
|
668
683
|
*/
|
|
669
684
|
'unicorn/relative-url-style'?: Linter.RuleEntry<UnicornRelativeUrlStyle>
|
|
670
685
|
/**
|
|
671
686
|
* Enforce using the separator argument with `Array#join()`.
|
|
672
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
687
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-array-join-separator.md
|
|
673
688
|
*/
|
|
674
689
|
'unicorn/require-array-join-separator'?: Linter.RuleEntry<[]>
|
|
675
690
|
/**
|
|
676
691
|
* Require non-empty module attributes for imports and exports
|
|
677
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
692
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-attributes.md
|
|
678
693
|
*/
|
|
679
694
|
'unicorn/require-module-attributes'?: Linter.RuleEntry<[]>
|
|
680
695
|
/**
|
|
681
696
|
* Require non-empty specifier list in import and export statements.
|
|
682
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
697
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-module-specifiers.md
|
|
683
698
|
*/
|
|
684
699
|
'unicorn/require-module-specifiers'?: Linter.RuleEntry<[]>
|
|
685
700
|
/**
|
|
686
701
|
* Enforce using the digits argument with `Number#toFixed()`.
|
|
687
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
702
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-number-to-fixed-digits-argument.md
|
|
688
703
|
*/
|
|
689
704
|
'unicorn/require-number-to-fixed-digits-argument'?: Linter.RuleEntry<[]>
|
|
690
705
|
/**
|
|
691
706
|
* Enforce using the `targetOrigin` argument with `window.postMessage()`.
|
|
692
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
707
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/require-post-message-target-origin.md
|
|
693
708
|
*/
|
|
694
709
|
'unicorn/require-post-message-target-origin'?: Linter.RuleEntry<[]>
|
|
695
710
|
/**
|
|
696
711
|
* Enforce better string content.
|
|
697
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
712
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/string-content.md
|
|
698
713
|
*/
|
|
699
714
|
'unicorn/string-content'?: Linter.RuleEntry<UnicornStringContent>
|
|
700
715
|
/**
|
|
701
716
|
* Enforce consistent brace style for `case` clauses.
|
|
702
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
717
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/switch-case-braces.md
|
|
703
718
|
*/
|
|
704
719
|
'unicorn/switch-case-braces'?: Linter.RuleEntry<UnicornSwitchCaseBraces>
|
|
705
720
|
/**
|
|
706
721
|
* Fix whitespace-insensitive template indentation.
|
|
707
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
722
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/template-indent.md
|
|
708
723
|
*/
|
|
709
724
|
'unicorn/template-indent'?: Linter.RuleEntry<UnicornTemplateIndent>
|
|
710
725
|
/**
|
|
711
726
|
* Enforce consistent case for text encoding identifiers.
|
|
712
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
727
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/text-encoding-identifier-case.md
|
|
713
728
|
*/
|
|
714
|
-
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<
|
|
729
|
+
'unicorn/text-encoding-identifier-case'?: Linter.RuleEntry<UnicornTextEncodingIdentifierCase>
|
|
715
730
|
/**
|
|
716
731
|
* Require `new` when creating an error.
|
|
717
|
-
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/
|
|
732
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v62.0.0/docs/rules/throw-new-error.md
|
|
718
733
|
*/
|
|
719
734
|
'unicorn/throw-new-error'?: Linter.RuleEntry<[]>
|
|
720
735
|
}
|
|
@@ -938,4 +953,8 @@ type UnicornTemplateIndent = []|[{
|
|
|
938
953
|
functions?: string[]
|
|
939
954
|
selectors?: string[]
|
|
940
955
|
comments?: string[]
|
|
956
|
+
}]
|
|
957
|
+
// ----- unicorn/text-encoding-identifier-case -----
|
|
958
|
+
type UnicornTextEncodingIdentifierCase = []|[{
|
|
959
|
+
withDash?: boolean
|
|
941
960
|
}]
|