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