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