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