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