@newsteam/eslint-config 1.2.19 → 1.2.20

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 (36) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +1 -0
  3. package/dist/plugins/sort-react-dependency-arrays.d.ts.map +1 -1
  4. package/dist/plugins/sort-react-dependency-arrays.js +33 -32
  5. package/dist/rules/css-modules.js +4 -4
  6. package/dist/rules/import-newlines.js +1 -1
  7. package/dist/rules/import-x.js +7 -7
  8. package/dist/rules/index.d.ts.map +1 -1
  9. package/dist/rules/index.js +19 -14
  10. package/dist/rules/next.js +1 -1
  11. package/dist/rules/react-19-upgrade.d.ts.map +1 -1
  12. package/dist/rules/react-19-upgrade.js +4 -0
  13. package/dist/rules/react-hooks.d.ts.map +1 -1
  14. package/dist/rules/react-hooks.js +1 -2
  15. package/dist/rules/react-performance.d.ts +3 -0
  16. package/dist/rules/react-performance.d.ts.map +1 -0
  17. package/dist/rules/{react-perf.js → react-performance.js} +1 -1
  18. package/dist/rules/react.d.ts.map +1 -1
  19. package/dist/rules/react.js +14 -12
  20. package/dist/rules/security.js +6 -6
  21. package/dist/rules/stylistic.js +2 -2
  22. package/dist/rules/typescript.js +1 -1
  23. package/dist/rules/unicorn.d.ts.map +1 -1
  24. package/dist/rules/unicorn.js +1212 -73
  25. package/dist/settings.d.ts +2 -2
  26. package/dist/settings.d.ts.map +1 -1
  27. package/dist/settings.js +2 -2
  28. package/package.json +30 -28
  29. package/dist/rules/no-unsanitized.d.ts +0 -3
  30. package/dist/rules/no-unsanitized.d.ts.map +0 -1
  31. package/dist/rules/no-unsanitized.js +0 -38
  32. package/dist/rules/react-compiler.d.ts +0 -3
  33. package/dist/rules/react-compiler.d.ts.map +0 -1
  34. package/dist/rules/react-compiler.js +0 -14
  35. package/dist/rules/react-perf.d.ts +0 -3
  36. package/dist/rules/react-perf.d.ts.map +0 -1
@@ -21,11 +21,11 @@ export const unicornPluginConfig = {
21
21
  },
22
22
  rules: {
23
23
  /*
24
- * Enforce the use of regex shorthands to improve readability. (fixable)
24
+ * Prefer more readable and robust DOM traversal APIs.
25
25
  *
26
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
26
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-dom-traversing.md
27
27
  */
28
- "unicorn/better-regex": "warn",
28
+ "unicorn/better-dom-traversing": "warn",
29
29
  /*
30
30
  * Enforce a specific parameter name in catch clauses.
31
31
  *
@@ -37,12 +37,78 @@ export const unicornPluginConfig = {
37
37
  name: "error",
38
38
  },
39
39
  ],
40
+ /*
41
+ * Enforce consistent class references in static methods.
42
+ *
43
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/class-reference-in-static-methods.md
44
+ */
45
+ "unicorn/class-reference-in-static-methods": "warn",
46
+ /*
47
+ * Enforce better comment content.
48
+ *
49
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/comment-content.md
50
+ */
51
+ "unicorn/comment-content": "warn",
40
52
  /*
41
53
  * Enforce consistent assertion style with node:assert
42
54
  *
43
55
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-assert.md
44
56
  */
45
57
  "unicorn/consistent-assert": "warn",
58
+ /*
59
+ * Enforce consistent naming for boolean names.
60
+ *
61
+ * Off for now because it's lacking some features we need (that the docs say it should have).
62
+ *
63
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-boolean-name.md
64
+ */
65
+ "unicorn/consistent-boolean-name": [
66
+ "off",
67
+ {
68
+ // This needs ignore: ["value"], but even though the docs say that exists, it doesn't yet
69
+ prefixes: {
70
+ allow: true,
71
+ enable: true,
72
+ includes: true,
73
+ use: true,
74
+ },
75
+ },
76
+ ],
77
+ /*
78
+ * Enforce consistent class member order.
79
+ *
80
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-class-member-order.md
81
+ */
82
+ "unicorn/consistent-class-member-order": [
83
+ "warn",
84
+ {
85
+ order: [
86
+ "static-field",
87
+ "public-field",
88
+ "private-field",
89
+ "static-block",
90
+ "constructor",
91
+ "static-method",
92
+ "public-method",
93
+ "private-method",
94
+ ],
95
+ },
96
+ ],
97
+ /*
98
+ * Enforce consistent spelling of compound words in identifiers.
99
+ *
100
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-compound-words.md
101
+ */
102
+ "unicorn/consistent-compound-words": "warn",
103
+ /*
104
+ * Enforce consistent conditional object spread style.
105
+ *
106
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-conditional-object-spread.md
107
+ */
108
+ "unicorn/consistent-conditional-object-spread": [
109
+ "warn",
110
+ "ternary",
111
+ ],
46
112
  /*
47
113
  * Prefer passing Date directly to the constructor when cloning
48
114
  *
@@ -67,24 +133,78 @@ export const unicornPluginConfig = {
67
133
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
68
134
  */
69
135
  "unicorn/consistent-existence-index-check": "warn",
136
+ /*
137
+ * Enforce consistent decorator position on exported classes.
138
+ *
139
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-export-decorator-position.md
140
+ */
141
+ "unicorn/consistent-export-decorator-position": "warn",
70
142
  /*
71
143
  * Move function definitions to the highest possible scope.
72
144
  *
73
145
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
74
146
  */
75
147
  "unicorn/consistent-function-scoping": "warn",
148
+ /*
149
+ * Enforce function syntax by role.
150
+ *
151
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-style.md
152
+ */
153
+ "unicorn/consistent-function-style": [
154
+ "warn",
155
+ {
156
+ // FUCK YEAH ARROW FUNCTIONS
157
+ callbacks: "arrow-function",
158
+ default: "arrow-function",
159
+ namedExports: "arrow-function",
160
+ namedFunctions: "arrow-function",
161
+ objectProperties: "arrow-function",
162
+ reassignedVariables: "arrow-function",
163
+ typedVariables: "arrow-function",
164
+ },
165
+ ],
166
+ /*
167
+ * Enforce consistent JSON file reads before `JSON.parse()`.
168
+ *
169
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-json-file-read.md
170
+ */
171
+ "unicorn/consistent-json-file-read": "warn",
172
+ /*
173
+ * Enforce consistent optional chaining for same-base member access.
174
+ *
175
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-optional-chaining.md
176
+ */
177
+ "unicorn/consistent-optional-chaining": "warn",
76
178
  /*
77
179
  * Enforce consistent style for escaping ${ in template literals.
78
180
  *
79
181
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-template-literal-escape.md
80
182
  */
81
183
  "unicorn/consistent-template-literal-escape": "warn",
184
+ /*
185
+ * Enforce consistent labels on tuple type elements.
186
+ *
187
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-tuple-labels.md
188
+ */
189
+ "unicorn/consistent-tuple-labels": "warn",
82
190
  /*
83
191
  * Enforce correct Error subclassing. (fixable)
84
192
  *
85
193
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
86
194
  */
87
195
  "unicorn/custom-error-definition": "warn",
196
+ /*
197
+ * Enforce consistent default export declarations.
198
+ *
199
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/default-export-style.md
200
+ */
201
+ "unicorn/default-export-style": "warn",
202
+ /*
203
+ * Enforce consistent style for DOM element dataset access.
204
+ *
205
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/dom-node-dataset.md
206
+ */
207
+ "unicorn/dom-node-dataset": "warn",
88
208
  /*
89
209
  * Enforce no spaces between braces. (fixable)
90
210
  *
@@ -115,6 +235,12 @@ export const unicornPluginConfig = {
115
235
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
116
236
  */
117
237
  "unicorn/explicit-length-check": "warn",
238
+ /*
239
+ * Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.
240
+ *
241
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-timer-delay.md
242
+ */
243
+ "unicorn/explicit-timer-delay": "warn",
118
244
  /*
119
245
  * Enforce a case style for filenames.
120
246
  *
@@ -126,6 +252,14 @@ export const unicornPluginConfig = {
126
252
  case: "kebabCase",
127
253
  },
128
254
  ],
255
+ /*
256
+ * Require identifiers to match a specified regular expression.
257
+ *
258
+ * Wasn't on when it was handled by the ESLint config, turning it on isn't great.
259
+ *
260
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/id-match.md
261
+ */
262
+ "unicorn/id-match": "off",
129
263
  /*
130
264
  * Enforce specific import styles per module
131
265
  *
@@ -140,6 +274,82 @@ export const unicornPluginConfig = {
140
274
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/isolated-functions.md
141
275
  */
142
276
  "unicorn/isolated-functions": "warn",
277
+ /*
278
+ * Require or disallow logical assignment operator shorthand
279
+ *
280
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/logical-assignment-operators.md
281
+ */
282
+ "unicorn/logical-assignment-operators": [
283
+ "warn",
284
+ "always",
285
+ ],
286
+ /*
287
+ * Limit the depth of nested calls.
288
+ *
289
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/max-nested-calls.md
290
+ */
291
+ "unicorn/max-nested-calls": [
292
+ "warn",
293
+ {
294
+ max: 3,
295
+ },
296
+ ],
297
+ /*
298
+ * Enforce replacements for variable, property, and filenames.
299
+ *
300
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/name-replacements.md
301
+ */
302
+ "unicorn/name-replacements": [
303
+ "warn",
304
+ {
305
+ ignore: [
306
+ /^arg*/ui,
307
+ /^utils*/ui,
308
+ ],
309
+ replacements: {
310
+ args: {
311
+ // This is a reserved keyword in some cases - don't replace into this
312
+ arguments: false,
313
+ },
314
+ deps: {
315
+ // Term isn't overloaded - allow abbreviation
316
+ dependencies: false,
317
+ },
318
+ dev: {
319
+ // Term isn't overloaded - allow abbreviation
320
+ development: false,
321
+ },
322
+ doc: {
323
+ // Term isn't overloaded - allow abbreviation
324
+ document: false,
325
+ },
326
+ docs: {
327
+ // Term isn't overloaded - allow abbreviation
328
+ documents: false,
329
+ },
330
+ env: {
331
+ // Term isn't overloaded - allow abbreviation
332
+ environment: false,
333
+ },
334
+ envs: {
335
+ // Term isn't overloaded - allow abbreviation
336
+ environments: false,
337
+ },
338
+ param: {
339
+ // This is used extremely frequently in react-router-dom and we don't want to change it
340
+ parameter: false,
341
+ },
342
+ params: {
343
+ // This is used extremely frequently in react-router-dom and we don't want to change it
344
+ parameters: false,
345
+ },
346
+ props: {
347
+ // This is used extremely frequently in react and we don't want to change it
348
+ properties: false,
349
+ },
350
+ },
351
+ },
352
+ ],
143
353
  /*
144
354
  * Enforce the use of new for all builtins, except String, Number and Boolean. (fixable)
145
355
  *
@@ -158,6 +368,12 @@ export const unicornPluginConfig = {
158
368
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accessor-recursion.md
159
369
  */
160
370
  "unicorn/no-accessor-recursion": "warn",
371
+ /*
372
+ * Disallow bitwise operators where a logical operator was likely intended.
373
+ *
374
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accidental-bitwise-operator.md
375
+ */
376
+ "unicorn/no-accidental-bitwise-operator": "warn",
161
377
  /*
162
378
  * Disallow anonymous functions and classes as the default export
163
379
  *
@@ -170,6 +386,18 @@ export const unicornPluginConfig = {
170
386
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
171
387
  */
172
388
  "unicorn/no-array-callback-reference": "warn",
389
+ /*
390
+ * Disallow array accumulation with `Array#concat()` in loops.
391
+ *
392
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-concat-in-loop.md
393
+ */
394
+ "unicorn/no-array-concat-in-loop": "warn",
395
+ /*
396
+ * Disallow using reference values as `Array#fill()` values.
397
+ *
398
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-fill-with-reference-type.md
399
+ */
400
+ "unicorn/no-array-fill-with-reference-type": "warn",
173
401
  /*
174
402
  * Prefer for...of over Array#forEach(...)
175
403
  *
@@ -179,6 +407,18 @@ export const unicornPluginConfig = {
179
407
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
180
408
  */
181
409
  "unicorn/no-array-for-each": "off",
410
+ /*
411
+ * Disallow `.fill()` after `Array.from({length: …})`.
412
+ *
413
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-from-fill.md
414
+ */
415
+ "unicorn/no-array-from-fill": "warn",
416
+ /*
417
+ * Disallow front-of-array mutation.
418
+ *
419
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-front-mutation.md
420
+ */
421
+ "unicorn/no-array-front-mutation": "warn",
182
422
  /*
183
423
  * Disallow using the this argument in array methods
184
424
  *
@@ -203,6 +443,30 @@ export const unicornPluginConfig = {
203
443
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort.md
204
444
  */
205
445
  "unicorn/no-array-sort": "warn",
446
+ /*
447
+ * Disallow sorting arrays to get the minimum or maximum value.
448
+ *
449
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort-for-min-max.md
450
+ */
451
+ "unicorn/no-array-sort-for-min-max": "warn",
452
+ /*
453
+ * Prefer `Array#toSpliced()` over `Array#splice()`.
454
+ *
455
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-splice.md
456
+ */
457
+ "unicorn/no-array-splice": "warn",
458
+ /*
459
+ * Disallow asterisk prefixes in documentation comments.
460
+ *
461
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-asterisk-prefix-in-documentation-comments.md
462
+ */
463
+ "unicorn/no-asterisk-prefix-in-documentation-comments": "warn",
464
+ /*
465
+ * Disallow async functions as `Promise#finally()` callbacks.
466
+ *
467
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-async-promise-finally.md
468
+ */
469
+ "unicorn/no-async-promise-finally": "warn",
206
470
  /*
207
471
  * Forbid member access from await expression
208
472
  *
@@ -215,24 +479,142 @@ export const unicornPluginConfig = {
215
479
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-in-promise-methods.md
216
480
  */
217
481
  "unicorn/no-await-in-promise-methods": "warn",
482
+ /*
483
+ * Disallow unnecessary `Blob` to `File` conversion.
484
+ *
485
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-blob-to-file.md
486
+ */
487
+ "unicorn/no-blob-to-file": "warn",
488
+ /*
489
+ * Disallow boolean-returning sort comparators.
490
+ *
491
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-boolean-sort-comparator.md
492
+ */
493
+ "unicorn/no-boolean-sort-comparator": "warn",
494
+ /*
495
+ * Disallow `break` and `continue` in nested loops and switches inside loops.
496
+ *
497
+ * Off for now because fixing it is a bit tough
498
+ *
499
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-break-in-nested-loop.md
500
+ */
501
+ "unicorn/no-break-in-nested-loop": "off",
502
+ /*
503
+ * Prefer drawing canvases directly instead of converting them to images.
504
+ *
505
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-canvas-to-image.md
506
+ */
507
+ "unicorn/no-canvas-to-image": "warn",
508
+ /*
509
+ * Disallow chained comparisons such as `a < b < c`.
510
+ *
511
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-chained-comparison.md
512
+ */
513
+ "unicorn/no-chained-comparison": "warn",
514
+ /*
515
+ * Disallow accessing `Map`, `Set`, `WeakMap`, and `WeakSet` entries with bracket notation.
516
+ *
517
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-collection-bracket-access.md
518
+ */
519
+ "unicorn/no-collection-bracket-access": "warn",
520
+ /*
521
+ * Disallow dynamic object property existence checks.
522
+ *
523
+ * Off for now - bit difficult to fix
524
+ *
525
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-computed-property-existence-check.md
526
+ */
527
+ "unicorn/no-computed-property-existence-check": "off",
528
+ /*
529
+ * Disallow confusing uses of `Array#{splice,toSpliced}()`.
530
+ *
531
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-confusing-array-splice.md
532
+ */
533
+ "unicorn/no-confusing-array-splice": "warn",
534
+ /*
535
+ * Disallow confusing uses of `Array#with()`.
536
+ *
537
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-confusing-array-with.md
538
+ */
539
+ "unicorn/no-confusing-array-with": "warn",
218
540
  /*
219
541
  * Do not use leading/trailing space between console.log parameters. (fixable)
220
542
  *
221
543
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md
222
544
  */
223
545
  "unicorn/no-console-spaces": "warn",
546
+ /*
547
+ * Disallow arithmetic and bitwise operations that always evaluate to `0`.
548
+ *
549
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-constant-zero-expression.md
550
+ */
551
+ "unicorn/no-constant-zero-expression": "warn",
552
+ /*
553
+ * Disallow declarations before conditional early exits when they are only used after the exit.
554
+ *
555
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-declarations-before-early-exit.md
556
+ */
557
+ "unicorn/no-declarations-before-early-exit": "warn",
224
558
  /*
225
559
  * Do not use document.cookie directly
226
560
  *
227
561
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-document-cookie.md
228
562
  */
229
563
  "unicorn/no-document-cookie": "warn",
564
+ /*
565
+ * Disallow two comparisons of the same operands that can be combined into one.
566
+ *
567
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-double-comparison.md
568
+ */
569
+ "unicorn/no-double-comparison": "warn",
570
+ /*
571
+ * Disallow duplicate adjacent branches in if chains.
572
+ *
573
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-duplicate-if-branches.md
574
+ */
575
+ "unicorn/no-duplicate-if-branches": "warn",
576
+ /*
577
+ * Disallow adjacent duplicate operands in logical expressions.
578
+ *
579
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-duplicate-logical-operands.md
580
+ */
581
+ "unicorn/no-duplicate-logical-operands": "warn",
582
+ /*
583
+ * Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.
584
+ *
585
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-duplicate-loops.md
586
+ */
587
+ "unicorn/no-duplicate-loops": "warn",
588
+ /*
589
+ * Disallow duplicate values in `Set` constructor array literals.
590
+ *
591
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-duplicate-set-values.md
592
+ */
593
+ "unicorn/no-duplicate-set-values": "warn",
230
594
  /*
231
595
  * Disallow empty files
232
596
  *
233
597
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
234
598
  */
235
599
  "unicorn/no-empty-file": "warn",
600
+ /*
601
+ * Disallow assigning to built-in error properties.
602
+ *
603
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-error-property-assignment.md
604
+ */
605
+ "unicorn/no-error-property-assignment": "warn",
606
+ /*
607
+ * Disallow exports in scripts.
608
+ *
609
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-exports-in-scripts.md
610
+ */
611
+ "unicorn/no-exports-in-scripts": "warn",
612
+ /*
613
+ * Prefer `for…of` over the `forEach` method.
614
+ *
615
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-each.md
616
+ */
617
+ "unicorn/no-for-each": "warn",
236
618
  /*
237
619
  * Do not use a for loop that can be replaced with a for-of loop
238
620
  *
@@ -240,17 +622,35 @@ export const unicornPluginConfig = {
240
622
  */
241
623
  "unicorn/no-for-loop": "warn",
242
624
  /*
243
- * Enforce the use of unicode escapes instead of hexadecimal escapes. (fixable)
625
+ * Disallow assigning properties on the global object.
244
626
  *
245
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
627
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-global-object-property-assignment.md
246
628
  */
247
- "unicorn/no-hex-escape": "warn",
629
+ "unicorn/no-global-object-property-assignment": "warn",
248
630
  /*
249
631
  * Disallow immediate mutation after variable assignment
250
632
  *
251
633
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-immediate-mutation.md
252
634
  */
253
635
  "unicorn/no-immediate-mutation": "warn",
636
+ /*
637
+ * Disallow impossible comparisons against `.length` or `.size`.
638
+ *
639
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-impossible-length-comparison.md
640
+ */
641
+ "unicorn/no-impossible-length-comparison": "warn",
642
+ /*
643
+ * Disallow incorrect `querySelector()` and `querySelectorAll()` usage.
644
+ *
645
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-incorrect-query-selector.md
646
+ */
647
+ "unicorn/no-incorrect-query-selector": "warn",
648
+ /*
649
+ * Disallow incorrect template literal interpolation syntax.
650
+ *
651
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-incorrect-template-string-interpolation.md
652
+ */
653
+ "unicorn/no-incorrect-template-string-interpolation": "warn",
254
654
  /*
255
655
  * Require Array.isArray() instead of instanceof Array
256
656
  *
@@ -262,42 +662,114 @@ export const unicornPluginConfig = {
262
662
  strategy: "loose",
263
663
  },
264
664
  ],
665
+ /*
666
+ * Disallow calling functions with an invalid number of arguments.
667
+ *
668
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-argument-count.md
669
+ */
670
+ "unicorn/no-invalid-argument-count": "warn",
671
+ /*
672
+ * Disallow comparing a single character from a string to a multi-character string.
673
+ *
674
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-character-comparison.md
675
+ */
676
+ "unicorn/no-invalid-character-comparison": "warn",
265
677
  /*
266
678
  * Disallow invalid options in fetch() and new Request()
267
679
  *
268
680
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md
269
681
  */
270
682
  "unicorn/no-invalid-fetch-options": "warn",
683
+ /*
684
+ * Disallow invalid `accept` values on file inputs.
685
+ *
686
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-file-input-accept.md
687
+ */
688
+ "unicorn/no-invalid-file-input-accept": "warn",
271
689
  /*
272
690
  * Prevent calling EventTarget#removeEventListener() with the result of an expression
273
691
  *
274
692
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
275
693
  */
276
694
  "unicorn/no-invalid-remove-event-listener": "warn",
695
+ /*
696
+ * Disallow invalid implementations of well-known symbol methods.
697
+ *
698
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-well-known-symbol-methods.md
699
+ */
700
+ "unicorn/no-invalid-well-known-symbol-methods": "warn",
277
701
  /*
278
702
  * Disallow identifiers starting with new or class
279
703
  *
280
704
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
281
705
  */
282
706
  "unicorn/no-keyword-prefix": "off",
707
+ /*
708
+ * Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.
709
+ *
710
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-late-current-target-access.md
711
+ */
712
+ "unicorn/no-late-current-target-access": "warn",
713
+ /*
714
+ * Disallow event-control method calls after the synchronous event dispatch has finished.
715
+ *
716
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-late-event-control.md
717
+ */
718
+ "unicorn/no-late-event-control": "warn",
283
719
  /*
284
720
  * Disallow if statements as the only statement in if blocks without else
285
721
  *
286
722
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
287
723
  */
288
724
  "unicorn/no-lonely-if": "warn",
725
+ /*
726
+ * Disallow mutating a loop iterable during iteration.
727
+ *
728
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-loop-iterable-mutation.md
729
+ */
730
+ "unicorn/no-loop-iterable-mutation": "warn",
289
731
  /*
290
732
  * Disallow a magic number as the depth argument in Array#flat(…).
291
733
  *
292
734
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md
293
735
  */
294
736
  "unicorn/no-magic-array-flat-depth": "warn",
737
+ /*
738
+ * Disallow manually wrapped comments.
739
+ *
740
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-manually-wrapped-comments.md
741
+ */
742
+ "unicorn/no-manually-wrapped-comments": "warn",
743
+ /*
744
+ * Disallow checking a Map key before accessing a different key.
745
+ *
746
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-mismatched-map-key.md
747
+ */
748
+ "unicorn/no-mismatched-map-key": "warn",
749
+ /*
750
+ * Disallow misrefactored compound assignments where the target is duplicated in the right-hand side.
751
+ *
752
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-misrefactored-assignment.md
753
+ */
754
+ "unicorn/no-misrefactored-assignment": "warn",
295
755
  /*
296
756
  * Disallow named usage of default import and export
297
757
  *
298
758
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-named-default.md
299
759
  */
300
760
  "unicorn/no-named-default": "warn",
761
+ /*
762
+ * Disallow negated array predicate calls.
763
+ *
764
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-array-predicate.md
765
+ */
766
+ "unicorn/no-negated-array-predicate": "warn",
767
+ /*
768
+ * Disallow negated comparisons.
769
+ *
770
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-comparison.md
771
+ */
772
+ "unicorn/no-negated-comparison": "warn",
301
773
  /*
302
774
  * Disallow negated conditions
303
775
  *
@@ -332,6 +804,18 @@ export const unicornPluginConfig = {
332
804
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
333
805
  */
334
806
  "unicorn/no-new-buffer": "warn",
807
+ /*
808
+ * Disallow non-function values with function-style verb prefixes.
809
+ *
810
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-non-function-verb-prefix.md
811
+ */
812
+ "unicorn/no-non-function-verb-prefix": "warn",
813
+ /*
814
+ * Disallow non-standard properties on built-in objects.
815
+ *
816
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nonstandard-builtin-properties.md
817
+ */
818
+ "unicorn/no-nonstandard-builtin-properties": "warn",
335
819
  /*
336
820
  * Disallow the use of the null literal, to encourage using undefined instead.
337
821
  *
@@ -344,6 +828,18 @@ export const unicornPluginConfig = {
344
828
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-as-default-parameter.md
345
829
  */
346
830
  "unicorn/no-object-as-default-parameter": "warn",
831
+ /*
832
+ * Disallow `Object` methods with `Map` or `Set`.
833
+ *
834
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-methods-with-collections.md
835
+ */
836
+ "unicorn/no-object-methods-with-collections": "warn",
837
+ /*
838
+ * Disallow optional chaining on undeclared variables.
839
+ *
840
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-optional-chaining-on-undeclared-variable.md
841
+ */
842
+ "unicorn/no-optional-chaining-on-undeclared-variable": "warn",
347
843
  /*
348
844
  * Disallow process.exit().
349
845
  *
@@ -352,6 +848,24 @@ export const unicornPluginConfig = {
352
848
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
353
849
  */
354
850
  "unicorn/no-process-exit": "off",
851
+ /*
852
+ * Disallow comparisons made redundant by an equality check in the same logical AND.
853
+ *
854
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-redundant-comparison.md
855
+ */
856
+ "unicorn/no-redundant-comparison": "warn",
857
+ /*
858
+ * Disallow returning the result of `Array#push()` with arguments.
859
+ *
860
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-return-array-push.md
861
+ */
862
+ "unicorn/no-return-array-push": "warn",
863
+ /*
864
+ * Disallow selector syntax in DOM names.
865
+ *
866
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-selector-as-dom-name.md
867
+ */
868
+ "unicorn/no-selector-as-dom-name": "warn",
355
869
  /*
356
870
  * Disallow passing single-element arrays to Promise methods
357
871
  *
@@ -364,6 +878,12 @@ export const unicornPluginConfig = {
364
878
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
365
879
  */
366
880
  "unicorn/no-static-only-class": "warn",
881
+ /*
882
+ * Prefer comparing values directly over subtracting and comparing to `0`.
883
+ *
884
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-subtraction-comparison.md
885
+ */
886
+ "unicorn/no-subtraction-comparison": "warn",
367
887
  /*
368
888
  * Disallow then property
369
889
  *
@@ -376,18 +896,54 @@ export const unicornPluginConfig = {
376
896
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
377
897
  */
378
898
  "unicorn/no-this-assignment": "warn",
899
+ /*
900
+ * Disallow `this` outside of classes.
901
+ *
902
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-outside-of-class.md
903
+ */
904
+ "unicorn/no-this-outside-of-class": "warn",
905
+ /*
906
+ * Disallow assigning to top-level variables from inside functions.
907
+ *
908
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-top-level-assignment-in-function.md
909
+ */
910
+ "unicorn/no-top-level-assignment-in-function": "warn",
911
+ /*
912
+ * Disallow top-level side effects in exported modules.
913
+ *
914
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-top-level-side-effects.md
915
+ */
916
+ "unicorn/no-top-level-side-effects": "warn",
379
917
  /*
380
918
  * Disallow comparing undefined using typeof
381
919
  *
382
920
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
383
921
  */
384
922
  "unicorn/no-typeof-undefined": "warn",
923
+ /*
924
+ * Disallow referencing methods without calling them.
925
+ *
926
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-uncalled-method.md
927
+ */
928
+ "unicorn/no-uncalled-method": "warn",
929
+ /*
930
+ * Require class members to be declared.
931
+ *
932
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-undeclared-class-members.md
933
+ */
934
+ "unicorn/no-undeclared-class-members": "warn",
385
935
  /*
386
936
  * Disallow using 1 as the depth argument of Array#flat()
387
937
  *
388
938
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-flat-depth.md
389
939
  */
390
940
  "unicorn/no-unnecessary-array-flat-depth": "warn",
941
+ /*
942
+ * Disallow `Array#flatMap()` callbacks that only wrap a single item.
943
+ *
944
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-flat-map.md
945
+ */
946
+ "unicorn/no-unnecessary-array-flat-map": "warn",
391
947
  /*
392
948
  * Disallow using .length or Infinity as the deleteCount or skipCount argument of Array#{splice,toSpliced}()
393
949
  *
@@ -400,6 +956,30 @@ export const unicornPluginConfig = {
400
956
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
401
957
  */
402
958
  "unicorn/no-unnecessary-await": "warn",
959
+ /*
960
+ * Disallow unnecessary comparisons against boolean literals.
961
+ *
962
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-boolean-comparison.md
963
+ */
964
+ "unicorn/no-unnecessary-boolean-comparison": "warn",
965
+ /*
966
+ * Disallow unnecessary options in `fetch()` and `new Request()`.
967
+ *
968
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-fetch-options.md
969
+ */
970
+ "unicorn/no-unnecessary-fetch-options": "warn",
971
+ /*
972
+ * Disallow unnecessary `globalThis` references.
973
+ *
974
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-global-this.md
975
+ */
976
+ "unicorn/no-unnecessary-global-this": "warn",
977
+ /*
978
+ * Disallow unnecessary nested ternary expressions.
979
+ *
980
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-nested-ternary.md
981
+ */
982
+ "unicorn/no-unnecessary-nested-ternary": "warn",
403
983
  /*
404
984
  * Enforce the use of built-in methods instead of unnecessary polyfills
405
985
  *
@@ -412,30 +992,132 @@ export const unicornPluginConfig = {
412
992
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-slice-end.md
413
993
  */
414
994
  "unicorn/no-unnecessary-slice-end": "warn",
995
+ /*
996
+ * Disallow `Array#splice()` when simpler alternatives exist.
997
+ *
998
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-splice.md
999
+ */
1000
+ "unicorn/no-unnecessary-splice": "warn",
415
1001
  /*
416
1002
  * Disallow unreadable array destructuring.
417
1003
  *
418
1004
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md
419
1005
  */
420
1006
  "unicorn/no-unreadable-array-destructuring": "warn",
1007
+ /*
1008
+ * Disallow unreadable iterable expressions in `for…of` and `for await…of` loop headers.
1009
+ *
1010
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-for-of-expression.md
1011
+ */
1012
+ "unicorn/no-unreadable-for-of-expression": "warn",
421
1013
  /*
422
1014
  * Disallow unreadable IIFEs
423
1015
  *
424
1016
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
425
1017
  */
426
1018
  "unicorn/no-unreadable-iife": "warn",
1019
+ /*
1020
+ * Disallow unreadable `new` expressions.
1021
+ *
1022
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-new-expression.md
1023
+ */
1024
+ "unicorn/no-unreadable-new-expression": "warn",
1025
+ /*
1026
+ * Disallow unreadable object destructuring.
1027
+ *
1028
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-object-destructuring.md
1029
+ */
1030
+ "unicorn/no-unreadable-object-destructuring": "warn",
1031
+ /*
1032
+ * Prevent unsafe use of ArrayBuffer view `.buffer`.
1033
+ *
1034
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-buffer-conversion.md
1035
+ */
1036
+ "unicorn/no-unsafe-buffer-conversion": "warn",
1037
+ /*
1038
+ * Disallow unsafe DOM HTML APIs.
1039
+ *
1040
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-dom-html.md
1041
+ */
1042
+ "unicorn/no-unsafe-dom-html": "warn",
1043
+ /*
1044
+ * Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.
1045
+ *
1046
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-promise-all-settled-values.md
1047
+ */
1048
+ "unicorn/no-unsafe-promise-all-settled-values": "warn",
1049
+ /*
1050
+ * Disallow unsafe values as property keys.
1051
+ *
1052
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-property-key.md
1053
+ */
1054
+ "unicorn/no-unsafe-property-key": "warn",
1055
+ /*
1056
+ * Disallow non-literal replacement values in `String#replace()` and `String#replaceAll()`.
1057
+ *
1058
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unsafe-string-replacement.md
1059
+ */
1060
+ "unicorn/no-unsafe-string-replacement": "warn",
1061
+ /*
1062
+ * Disallow ignoring the return value of selected array methods.
1063
+ *
1064
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-array-method-return.md
1065
+ */
1066
+ "unicorn/no-unused-array-method-return": "warn",
427
1067
  /*
428
1068
  * Disallow unused object properties.
429
1069
  *
430
1070
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md
431
1071
  */
432
1072
  "unicorn/no-unused-properties": "warn",
1073
+ /*
1074
+ * Disallow unnecessary `Boolean()` casts in array predicate callbacks.
1075
+ *
1076
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-boolean-cast.md
1077
+ */
1078
+ "unicorn/no-useless-boolean-cast": "warn",
1079
+ /*
1080
+ * Disallow useless type coercions of values that are already of the target type.
1081
+ *
1082
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-coercion.md
1083
+ */
1084
+ "unicorn/no-useless-coercion": "warn",
433
1085
  /*
434
1086
  * Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
435
1087
  *
436
1088
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md
437
1089
  */
438
1090
  "unicorn/no-useless-collection-argument": "warn",
1091
+ /*
1092
+ * Disallow useless compound assignments such as `x += 0`.
1093
+ *
1094
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-compound-assignment.md
1095
+ */
1096
+ "unicorn/no-useless-compound-assignment": "warn",
1097
+ /*
1098
+ * Disallow useless concatenation of literals.
1099
+ *
1100
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-concat.md
1101
+ */
1102
+ "unicorn/no-useless-concat": "warn",
1103
+ /*
1104
+ * Disallow useless `continue` statements.
1105
+ *
1106
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-continue.md
1107
+ */
1108
+ "unicorn/no-useless-continue": "warn",
1109
+ /*
1110
+ * Disallow unnecessary existence checks before deletion.
1111
+ *
1112
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-delete-check.md
1113
+ */
1114
+ "unicorn/no-useless-delete-check": "warn",
1115
+ /*
1116
+ * Disallow `else` after a statement that exits.
1117
+ *
1118
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-else.md
1119
+ */
1120
+ "unicorn/no-useless-else": "warn",
439
1121
  /*
440
1122
  * Disallow unnecessary Error.captureStackTrace(…)
441
1123
  *
@@ -460,12 +1142,30 @@ export const unicornPluginConfig = {
460
1142
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
461
1143
  */
462
1144
  "unicorn/no-useless-length-check": "warn",
1145
+ /*
1146
+ * Disallow unnecessary operands in logical expressions involving boolean literals.
1147
+ *
1148
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-logical-operand.md
1149
+ */
1150
+ "unicorn/no-useless-logical-operand": "warn",
1151
+ /*
1152
+ * Disallow useless overrides of class methods.
1153
+ *
1154
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-override.md
1155
+ */
1156
+ "unicorn/no-useless-override": "warn",
463
1157
  /*
464
1158
  * Disallow returning/yielding Promise.resolve/reject() in async functions or promise callbacks
465
1159
  *
466
1160
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
467
1161
  */
468
1162
  "unicorn/no-useless-promise-resolve-reject": "warn",
1163
+ /*
1164
+ * Disallow simple recursive function calls that can be replaced with a loop.
1165
+ *
1166
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-recursion.md
1167
+ */
1168
+ "unicorn/no-useless-recursion": "warn",
469
1169
  /*
470
1170
  * Disallow useless spread
471
1171
  *
@@ -478,6 +1178,12 @@ export const unicornPluginConfig = {
478
1178
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
479
1179
  */
480
1180
  "unicorn/no-useless-switch-case": "warn",
1181
+ /*
1182
+ * Disallow useless template literal expressions.
1183
+ *
1184
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-template-literals.md
1185
+ */
1186
+ "unicorn/no-useless-template-literals": "warn",
481
1187
  /*
482
1188
  * Disallow useless undefined
483
1189
  *
@@ -486,6 +1192,12 @@ export const unicornPluginConfig = {
486
1192
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
487
1193
  */
488
1194
  "unicorn/no-useless-undefined": "off",
1195
+ /*
1196
+ * Disallow the bitwise XOR operator where exponentiation was likely intended.
1197
+ *
1198
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-xor-as-exponentiation.md
1199
+ */
1200
+ "unicorn/no-xor-as-exponentiation": "warn",
489
1201
  /*
490
1202
  * Disallow number literals with zero fractions or dangling dots
491
1203
  *
@@ -504,12 +1216,42 @@ export const unicornPluginConfig = {
504
1216
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
505
1217
  */
506
1218
  "unicorn/numeric-separators-style": "warn",
1219
+ /*
1220
+ * Require assignment operator shorthand where possible.
1221
+ *
1222
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/operator-assignment.md
1223
+ */
1224
+ "unicorn/operator-assignment": "warn",
1225
+ /*
1226
+ * Prefer `AbortSignal.any()` over manually forwarding abort events between signals.
1227
+ *
1228
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-abort-signal-any.md
1229
+ */
1230
+ "unicorn/prefer-abort-signal-any": "warn",
1231
+ /*
1232
+ * Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.
1233
+ *
1234
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-abort-signal-timeout.md
1235
+ */
1236
+ "unicorn/prefer-abort-signal-timeout": "warn",
507
1237
  /*
508
1238
  * Prefer addEventListener over on-functions. (fixable)
509
1239
  *
510
1240
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
511
1241
  */
512
1242
  "unicorn/prefer-add-event-listener": "warn",
1243
+ /*
1244
+ * Prefer an options object over a boolean in `.addEventListener()`.
1245
+ *
1246
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener-options.md
1247
+ */
1248
+ "unicorn/prefer-add-event-listener-options": "warn",
1249
+ /*
1250
+ * Prefer `AggregateError` when throwing collected errors.
1251
+ *
1252
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-aggregate-error.md
1253
+ */
1254
+ "unicorn/prefer-aggregate-error": "warn",
513
1255
  /*
514
1256
  * Prefer .find(...) over the first element from .filter(...)
515
1257
  *
@@ -527,13 +1269,49 @@ export const unicornPluginConfig = {
527
1269
  *
528
1270
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
529
1271
  */
530
- "unicorn/prefer-array-flat-map": "warn",
1272
+ "unicorn/prefer-array-flat-map": "warn",
1273
+ /*
1274
+ * Prefer `Array.fromAsync()` over `for await…of` array accumulation.
1275
+ *
1276
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-from-async.md
1277
+ */
1278
+ "unicorn/prefer-array-from-async": "warn",
1279
+ /*
1280
+ * Prefer using the `Array.from()` mapping function argument.
1281
+ *
1282
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-from-map.md
1283
+ */
1284
+ "unicorn/prefer-array-from-map": "warn",
1285
+ /*
1286
+ * Prefer `Array.from({length}, …)` when creating range arrays.
1287
+ *
1288
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-from-range.md
1289
+ */
1290
+ "unicorn/prefer-array-from-range": "warn",
1291
+ /*
1292
+ * Prefer Array#indexOf() over Array#findIndex() when looking for the index of an item
1293
+ *
1294
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
1295
+ */
1296
+ "unicorn/prefer-array-index-of": "warn",
1297
+ /*
1298
+ * Prefer iterating an array directly or with `Array#keys()` over `Array#entries()` when the index or value is unused.
1299
+ *
1300
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-iterable-methods.md
1301
+ */
1302
+ "unicorn/prefer-array-iterable-methods": "warn",
1303
+ /*
1304
+ * Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.
1305
+ *
1306
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-last-methods.md
1307
+ */
1308
+ "unicorn/prefer-array-last-methods": "warn",
531
1309
  /*
532
- * Prefer Array#indexOf() over Array#findIndex() when looking for the index of an item
1310
+ * Prefer `Array#slice()` over `Array#splice()` when reading from the returned array.
533
1311
  *
534
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
1312
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-slice.md
535
1313
  */
536
- "unicorn/prefer-array-index-of": "warn",
1314
+ "unicorn/prefer-array-slice": "warn",
537
1315
  /*
538
1316
  * Prefer .some(...) over .find(...).
539
1317
  *
@@ -543,11 +1321,17 @@ export const unicornPluginConfig = {
543
1321
  /*
544
1322
  * Prefer .at() method for index access and String#charAt()
545
1323
  *
546
- * This breaks typescript array typings at the moment
1324
+ * This breaks TypeScript array typings at the moment
547
1325
  *
548
1326
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
549
1327
  */
550
1328
  "unicorn/prefer-at": "off",
1329
+ /*
1330
+ * Prefer `await` over promise chaining.
1331
+ *
1332
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-await.md
1333
+ */
1334
+ "unicorn/prefer-await": "warn",
551
1335
  /*
552
1336
  * Prefer BigInt literals over the constructor
553
1337
  *
@@ -560,6 +1344,18 @@ export const unicornPluginConfig = {
560
1344
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
561
1345
  */
562
1346
  "unicorn/prefer-blob-reading-methods": "warn",
1347
+ /*
1348
+ * Prefer block statements over IIFEs used only for scoping.
1349
+ *
1350
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-block-statement-over-iife.md
1351
+ */
1352
+ "unicorn/prefer-block-statement-over-iife": "warn",
1353
+ /*
1354
+ * Prefer directly returning boolean expressions over `if` statements.
1355
+ *
1356
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-boolean-return.md
1357
+ */
1358
+ "unicorn/prefer-boolean-return": "warn",
563
1359
  /*
564
1360
  * Prefer class field declarations over this assignments in constructors
565
1361
  *
@@ -578,6 +1374,12 @@ export const unicornPluginConfig = {
578
1374
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
579
1375
  */
580
1376
  "unicorn/prefer-code-point": "warn",
1377
+ /*
1378
+ * Prefer early continues over whole-loop conditional wrapping.
1379
+ *
1380
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-continue.md
1381
+ */
1382
+ "unicorn/prefer-continue": "warn",
581
1383
  /*
582
1384
  * Prefer Date.now() to get the number of milliseconds since the Unix Epoch
583
1385
  *
@@ -590,6 +1392,18 @@ export const unicornPluginConfig = {
590
1392
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
591
1393
  */
592
1394
  "unicorn/prefer-default-parameters": "warn",
1395
+ /*
1396
+ * Prefer direct iteration over default iterator method calls.
1397
+ *
1398
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-direct-iteration.md
1399
+ */
1400
+ "unicorn/prefer-direct-iteration": "warn",
1401
+ /*
1402
+ * Prefer using `using`/`await using` over manual `try`/`finally` resource disposal.
1403
+ *
1404
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dispose.md
1405
+ */
1406
+ "unicorn/prefer-dispose": "warn",
593
1407
  /*
594
1408
  * Prefer Node#append() over Node#appendChild()
595
1409
  *
@@ -597,23 +1411,49 @@ export const unicornPluginConfig = {
597
1411
  */
598
1412
  "unicorn/prefer-dom-node-append": "warn",
599
1413
  /*
600
- * Prefer using .dataset on DOM elements over .setAttribute(...)
1414
+ * Prefer `.getHTML()` and `.setHTML()` over `.innerHTML`.
601
1415
  *
602
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
1416
+ * This is off because Safari doesn't support these yet.
1417
+ *
1418
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-html-methods.md
603
1419
  */
604
- "unicorn/prefer-dom-node-dataset": "warn",
1420
+ "unicorn/prefer-dom-node-html-methods": "off",
605
1421
  /*
606
1422
  * Prefer childNode.remove() over parentNode.removeChild(childNode)
607
1423
  *
608
1424
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
609
1425
  */
610
1426
  "unicorn/prefer-dom-node-remove": "warn",
1427
+ /*
1428
+ * Prefer `.replaceChildren()` when emptying DOM children.
1429
+ *
1430
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-replace-children.md
1431
+ */
1432
+ "unicorn/prefer-dom-node-replace-children": "warn",
611
1433
  /*
612
1434
  * Prefer .textContent over .innerText
613
1435
  *
614
1436
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
615
1437
  */
616
1438
  "unicorn/prefer-dom-node-text-content": "warn",
1439
+ /*
1440
+ * Prefer early returns over full-function conditional wrapping.
1441
+ *
1442
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-early-return.md
1443
+ */
1444
+ "unicorn/prefer-early-return": "warn",
1445
+ /*
1446
+ * Prefer `else if` over adjacent `if` statements with related conditions.
1447
+ *
1448
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-else-if.md
1449
+ */
1450
+ "unicorn/prefer-else-if": "warn",
1451
+ /*
1452
+ * Prefer `Error.isError()` when checking for errors.
1453
+ *
1454
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-error-is-error.md
1455
+ */
1456
+ "unicorn/prefer-error-is-error": "warn",
617
1457
  /*
618
1458
  * While EventEmitter is only available in Node.js, EventTarget is also available in Deno and browsers.
619
1459
  *
@@ -628,12 +1468,60 @@ export const unicornPluginConfig = {
628
1468
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
629
1469
  */
630
1470
  "unicorn/prefer-export-from": "warn",
1471
+ /*
1472
+ * Prefer flat `Math.min()` and `Math.max()` calls over nested calls.
1473
+ *
1474
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-flat-math-min-max.md
1475
+ */
1476
+ "unicorn/prefer-flat-math-min-max": "warn",
1477
+ /*
1478
+ * Prefer `.getOrInsertComputed()` when the default value has side effects.
1479
+ *
1480
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-get-or-insert-computed.md
1481
+ */
1482
+ "unicorn/prefer-get-or-insert-computed": "warn",
1483
+ /*
1484
+ * Prefer global numeric constants over `Number` static properties.
1485
+ *
1486
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-number-constants.md
1487
+ */
1488
+ "unicorn/prefer-global-number-constants": "warn",
631
1489
  /*
632
1490
  * Prefer `globalThis` over `window`, `self`, and `global`.
633
1491
  *
634
1492
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
635
1493
  */
636
1494
  "unicorn/prefer-global-this": "warn",
1495
+ /*
1496
+ * Prefer `Object.groupBy()` or `Map.groupBy()` over reduce-based grouping.
1497
+ *
1498
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-group-by.md
1499
+ */
1500
+ "unicorn/prefer-group-by": "warn",
1501
+ /*
1502
+ * Prefer `.has()` when checking existence.
1503
+ *
1504
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-has-check.md
1505
+ */
1506
+ "unicorn/prefer-has-check": "warn",
1507
+ /*
1508
+ * Prefer moving code shared by all branches of an `if` statement out of the branches.
1509
+ *
1510
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-hoisting-branch-code.md
1511
+ */
1512
+ "unicorn/prefer-hoisting-branch-code": "warn",
1513
+ /*
1514
+ * Prefer HTTPS over HTTP.
1515
+ *
1516
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-https.md
1517
+ */
1518
+ "unicorn/prefer-https": "warn",
1519
+ /*
1520
+ * Prefer identifiers over string literals in import and export specifiers.
1521
+ *
1522
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-identifier-import-export-specifiers.md
1523
+ */
1524
+ "unicorn/prefer-identifier-import-export-specifiers": "warn",
637
1525
  /*
638
1526
  * Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths
639
1527
  *
@@ -647,23 +1535,79 @@ export const unicornPluginConfig = {
647
1535
  */
648
1536
  "unicorn/prefer-includes": "warn",
649
1537
  /*
650
- * Prefer reading a JSON file as a buffer
1538
+ * Prefer `.includes()` over repeated equality comparisons.
1539
+ *
1540
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes-over-repeated-comparisons.md
1541
+ */
1542
+ "unicorn/prefer-includes-over-repeated-comparisons": "warn",
1543
+ /*
1544
+ * Prefer passing iterables directly to constructors instead of filling empty collections.
1545
+ *
1546
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterable-in-constructor.md
1547
+ */
1548
+ "unicorn/prefer-iterable-in-constructor": "warn",
1549
+ /*
1550
+ * Prefer `Iterator.concat(…)` over temporary spread arrays.
1551
+ *
1552
+ * Off for now because I can't get TypeScript to enable this
1553
+ *
1554
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-concat.md
1555
+ */
1556
+ "unicorn/prefer-iterator-concat": "off",
1557
+ /*
1558
+ * Prefer iterator helpers over temporary arrays from iterators.
1559
+ *
1560
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-helpers.md
1561
+ */
1562
+ "unicorn/prefer-iterator-helpers": "warn",
1563
+ /*
1564
+ * Prefer `Iterator#toArray()` over temporary arrays from iterator spreads.
651
1565
  *
652
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
1566
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-to-array.md
653
1567
  */
654
- "unicorn/prefer-json-parse-buffer": "warn",
1568
+ "unicorn/prefer-iterator-to-array": "warn",
1569
+ /*
1570
+ * Prefer moving `.toArray()` to the end of iterator helper chains.
1571
+ *
1572
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-iterator-to-array-at-end.md
1573
+ */
1574
+ "unicorn/prefer-iterator-to-array-at-end": "warn",
655
1575
  /*
656
1576
  * Prefer KeyboardEvent#key over KeyboardEvent#keyCode
657
1577
  *
658
1578
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
659
1579
  */
660
1580
  "unicorn/prefer-keyboard-event-key": "warn",
1581
+ /*
1582
+ * Prefer `location.assign()` over assigning to `location.href`.
1583
+ *
1584
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-location-assign.md
1585
+ */
1586
+ "unicorn/prefer-location-assign": "warn",
661
1587
  /*
662
1588
  * Prefer using a logical operator over a ternary
663
1589
  *
664
1590
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
665
1591
  */
666
1592
  "unicorn/prefer-logical-operator-over-ternary": "warn",
1593
+ /*
1594
+ * Prefer `new Map()` over `Object.fromEntries()` when using the result as a map.
1595
+ *
1596
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-map-from-entries.md
1597
+ */
1598
+ "unicorn/prefer-map-from-entries": "warn",
1599
+ /*
1600
+ * Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.
1601
+ *
1602
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-abs.md
1603
+ */
1604
+ "unicorn/prefer-math-abs": "warn",
1605
+ /*
1606
+ * Prefer `Math` constants over their approximate numeric values.
1607
+ *
1608
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-constants.md
1609
+ */
1610
+ "unicorn/prefer-math-constants": "warn",
667
1611
  /*
668
1612
  * Prefer Math.min() and Math.max() over ternaries for simple comparisons
669
1613
  *
@@ -676,6 +1620,12 @@ export const unicornPluginConfig = {
676
1620
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
677
1621
  */
678
1622
  "unicorn/prefer-math-trunc": "warn",
1623
+ /*
1624
+ * Prefer moving ternaries into the minimal varying part of an expression.
1625
+ *
1626
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-minimal-ternary.md
1627
+ */
1628
+ "unicorn/prefer-minimal-ternary": "warn",
679
1629
  /*
680
1630
  * Prefer modern DOM APIs
681
1631
  *
@@ -714,24 +1664,84 @@ export const unicornPluginConfig = {
714
1664
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
715
1665
  */
716
1666
  "unicorn/prefer-node-protocol": "warn",
1667
+ /*
1668
+ * Prefer `Number()` over `parseFloat()` and base-10 `parseInt()`.
1669
+ *
1670
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-coercion.md
1671
+ */
1672
+ "unicorn/prefer-number-coercion": "warn",
1673
+ /*
1674
+ * Prefer `Number.isSafeInteger()` over integer checks.
1675
+ *
1676
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-is-safe-integer.md
1677
+ */
1678
+ "unicorn/prefer-number-is-safe-integer": "warn",
717
1679
  /*
718
1680
  * Prefer Number static properties over global ones.
719
1681
  *
720
1682
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
721
1683
  */
722
1684
  "unicorn/prefer-number-properties": "warn",
1685
+ /*
1686
+ * Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.
1687
+ *
1688
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-define-properties.md
1689
+ */
1690
+ "unicorn/prefer-object-define-properties": "warn",
1691
+ /*
1692
+ * Prefer object destructuring defaults over default object literals with spread.
1693
+ *
1694
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-destructuring-defaults.md
1695
+ */
1696
+ "unicorn/prefer-object-destructuring-defaults": "warn",
723
1697
  /*
724
1698
  * Prefer using Object.fromEntries(...) to transform a list of key-value pairs into an object
725
1699
  *
726
1700
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
727
1701
  */
728
1702
  "unicorn/prefer-object-from-entries": "warn",
1703
+ /*
1704
+ * Prefer the most specific `Object` iterable method.
1705
+ *
1706
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-iterable-methods.md
1707
+ */
1708
+ "unicorn/prefer-object-iterable-methods": "warn",
1709
+ /*
1710
+ * Prefer observer APIs over resize and scroll listeners with layout reads.
1711
+ *
1712
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-observer-apis.md
1713
+ */
1714
+ "unicorn/prefer-observer-apis": "warn",
729
1715
  /*
730
1716
  * Prefer omitting the catch binding parameter
731
1717
  *
732
1718
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
733
1719
  */
734
1720
  "unicorn/prefer-optional-catch-binding": "warn",
1721
+ /*
1722
+ * Prefer `Path2D` for repeatedly drawn canvas paths.
1723
+ *
1724
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-path2d.md
1725
+ */
1726
+ "unicorn/prefer-path2d": "warn",
1727
+ /*
1728
+ * Prefer private class fields over the underscore-prefix convention.
1729
+ *
1730
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-private-class-fields.md
1731
+ */
1732
+ "unicorn/prefer-private-class-fields": "warn",
1733
+ /*
1734
+ * Prefer `Promise.try()` over promise-wrapping boilerplate.
1735
+ *
1736
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-promise-try.md
1737
+ */
1738
+ "unicorn/prefer-promise-try": "warn",
1739
+ /*
1740
+ * Prefer `Promise.withResolvers()` when extracting resolver functions from `new Promise()`.
1741
+ *
1742
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-promise-with-resolvers.md
1743
+ */
1744
+ "unicorn/prefer-promise-with-resolvers": "warn",
735
1745
  /*
736
1746
  * Prefer borrowing methods from the prototype instead of methods from an instance
737
1747
  *
@@ -744,12 +1754,24 @@ export const unicornPluginConfig = {
744
1754
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-replace-all.md
745
1755
  */
746
1756
  "unicorn/prefer-query-selector": "warn",
1757
+ /*
1758
+ * Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.
1759
+ *
1760
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-queue-microtask.md
1761
+ */
1762
+ "unicorn/prefer-queue-microtask": "warn",
747
1763
  /*
748
1764
  * Prefer querySelector over getElementById, querySelectorAll over getElementsByClassName and getElementsByTagName. (partly fixable)
749
1765
  *
750
1766
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md
751
1767
  */
752
1768
  "unicorn/prefer-reflect-apply": "warn",
1769
+ /*
1770
+ * Prefer `RegExp.escape()` for escaping strings to use in regular expressions.
1771
+ *
1772
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-escape.md
1773
+ */
1774
+ "unicorn/prefer-regexp-escape": "warn",
753
1775
  /*
754
1776
  * Prefer RegExp#test() over String#match() and RegExp#exec()
755
1777
  *
@@ -762,6 +1784,12 @@ export const unicornPluginConfig = {
762
1784
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-response-static-json.md
763
1785
  */
764
1786
  "unicorn/prefer-response-static-json": "warn",
1787
+ /*
1788
+ * Prefer `:scope` when using element query selector methods.
1789
+ *
1790
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-scoped-selector.md
1791
+ */
1792
+ "unicorn/prefer-scoped-selector": "warn",
765
1793
  /*
766
1794
  * Prefer Set#has() over Array#includes() when checking for existence or non-existenc (fixable)
767
1795
  *
@@ -770,36 +1798,108 @@ export const unicornPluginConfig = {
770
1798
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
771
1799
  */
772
1800
  "unicorn/prefer-set-has": "off",
1801
+ /*
1802
+ * Prefer `Set` methods for Set operations.
1803
+ *
1804
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-methods.md
1805
+ */
1806
+ "unicorn/prefer-set-methods": "warn",
773
1807
  /*
774
1808
  * Prefer using Set#size instead of Array#length
775
1809
  *
776
1810
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
777
1811
  */
778
1812
  "unicorn/prefer-set-size": "warn",
1813
+ /*
1814
+ * Prefer arrow function properties over methods with a single return.
1815
+ *
1816
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-short-arrow-method.md
1817
+ */
1818
+ "unicorn/prefer-short-arrow-method": "warn",
779
1819
  /*
780
1820
  * Prefer simple conditions first in logical expressions.
781
1821
  *
782
1822
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-condition-first.md
783
1823
  */
784
1824
  "unicorn/prefer-simple-condition-first": "warn",
1825
+ /*
1826
+ * Prefer a simple comparison function for `Array#sort()`.
1827
+ *
1828
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-sort-comparator.md
1829
+ */
1830
+ "unicorn/prefer-simple-sort-comparator": "warn",
1831
+ /*
1832
+ * Prefer simplified conditions.
1833
+ *
1834
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simplified-conditions.md
1835
+ */
1836
+ "unicorn/prefer-simplified-conditions": "warn",
1837
+ /*
1838
+ * Prefer a single `Array#some()` or `Array#every()` with a combined predicate.
1839
+ *
1840
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-array-predicate.md
1841
+ */
1842
+ "unicorn/prefer-single-array-predicate": "warn",
785
1843
  /*
786
1844
  * Prefer using Set#size instead of Array#length
787
1845
  *
788
1846
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-call.md
789
1847
  */
790
1848
  "unicorn/prefer-single-call": "warn",
1849
+ /*
1850
+ * Prefer a single object destructuring declaration per local const source.
1851
+ *
1852
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-object-destructuring.md
1853
+ */
1854
+ "unicorn/prefer-single-object-destructuring": "warn",
1855
+ /*
1856
+ * Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.
1857
+ *
1858
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-replace.md
1859
+ */
1860
+ "unicorn/prefer-single-replace": "warn",
1861
+ /*
1862
+ * Prefer declaring variables in the smallest possible scope.
1863
+ *
1864
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-smaller-scope.md
1865
+ */
1866
+ "unicorn/prefer-smaller-scope": "warn",
1867
+ /*
1868
+ * Prefer `String#split()` with a limit.
1869
+ *
1870
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-split-limit.md
1871
+ */
1872
+ "unicorn/prefer-split-limit": "warn",
791
1873
  /*
792
1874
  * Prefer the spread operator over Array.from(). (fixable)
793
1875
  *
794
1876
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
795
1877
  */
796
1878
  "unicorn/prefer-spread": "warn",
1879
+ /*
1880
+ * Prefer `String#matchAll()` over `RegExp#exec()` loops.
1881
+ *
1882
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-match-all.md
1883
+ */
1884
+ "unicorn/prefer-string-match-all": "warn",
1885
+ /*
1886
+ * Prefer `String#padStart()` and `String#padEnd()` over manual string padding.
1887
+ *
1888
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-pad-start-end.md
1889
+ */
1890
+ "unicorn/prefer-string-pad-start-end": "warn",
797
1891
  /*
798
1892
  * Prefer using the String.raw tag to avoid escaping \
799
1893
  *
800
1894
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-raw.md
801
1895
  */
802
1896
  "unicorn/prefer-string-raw": "warn",
1897
+ /*
1898
+ * Prefer `String#repeat()` for repeated whitespace.
1899
+ *
1900
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-repeat.md
1901
+ */
1902
+ "unicorn/prefer-string-repeat": "warn",
803
1903
  /*
804
1904
  * Prefer String#replaceAll() over regex searches with the global flag
805
1905
  *
@@ -850,6 +1950,14 @@ export const unicornPluginConfig = {
850
1950
  minimumCases: 3,
851
1951
  },
852
1952
  ],
1953
+ /*
1954
+ * Prefer `Temporal` over `Date`.
1955
+ *
1956
+ * Off for now - need to know more before it's safe
1957
+ *
1958
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-temporal.md
1959
+ */
1960
+ "unicorn/prefer-temporal": "off",
853
1961
  /*
854
1962
  * Prefer ternary expressions over simple if-else statements
855
1963
  *
@@ -858,6 +1966,12 @@ export const unicornPluginConfig = {
858
1966
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
859
1967
  */
860
1968
  "unicorn/prefer-ternary": "off",
1969
+ /*
1970
+ * Prefer using `Element#toggleAttribute()` to toggle attributes.
1971
+ *
1972
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-toggle-attribute.md
1973
+ */
1974
+ "unicorn/prefer-toggle-attribute": "warn",
861
1975
  /*
862
1976
  * Prefer top-level await over top-level promises and async function calls
863
1977
  *
@@ -873,65 +1987,57 @@ export const unicornPluginConfig = {
873
1987
  */
874
1988
  "unicorn/prefer-type-error": "warn",
875
1989
  /*
876
- * Prevent abbreviations
1990
+ * Require type literals to be last in union and intersection types.
877
1991
  *
878
- * Heres a list of the defaults:
879
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/prevent-abbreviations.js#L13
1992
+ * Perfectionist is handling this, turning it on causes recursive fixes
880
1993
  *
881
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
1994
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-literal-last.md
882
1995
  */
883
- "unicorn/prevent-abbreviations": [
884
- "warn",
885
- {
886
- /*
887
- * We disable this because of how often Objects are used to interface
888
- * with third party code, and we don't want to eslint-ignore all of that.
889
- */
890
- checkProperties: false,
891
- ignore: [
892
- /^arg*/ui,
893
- /^utils*/ui,
894
- ],
895
- replacements: {
896
- args: {
897
- // This is a reserved keyword in some cases - don't replace into this
898
- arguments: false,
899
- },
900
- dev: {
901
- // Term isn't overloaded - allow abbreviation
902
- development: false,
903
- },
904
- doc: {
905
- // Term isn't overloaded - allow abbreviation
906
- document: false,
907
- },
908
- docs: {
909
- // Term isn't overloaded - allow abbreviation
910
- documents: false,
911
- },
912
- env: {
913
- // Term isn't overloaded - allow abbreviation
914
- environment: false,
915
- },
916
- envs: {
917
- // Term isn't overloaded - allow abbreviation
918
- environments: false,
919
- },
920
- param: {
921
- // This is used extremely frequently in react-router-dom and we don't want to change it
922
- parameter: false,
923
- },
924
- params: {
925
- // This is used extremely frequently in react-router-dom and we don't want to change it
926
- parameters: false,
927
- },
928
- props: {
929
- // This is used extremely frequently in react and we don't want to change it
930
- properties: false,
931
- },
932
- },
933
- },
934
- ],
1996
+ "unicorn/prefer-type-literal-last": "off",
1997
+ /*
1998
+ * Prefer `Uint8Array#toBase64()` and `Uint8Array.fromBase64()` over `atob()`, `btoa()`, and `Buffer` base64 conversions.
1999
+ *
2000
+ * Need to find out more before we can consider this safe
2001
+ *
2002
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-uint8array-base64.md
2003
+ */
2004
+ "unicorn/prefer-uint8array-base64": "off",
2005
+ /*
2006
+ * Prefer the unary minus operator over multiplying or dividing by `-1`.
2007
+ *
2008
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-unary-minus.md
2009
+ */
2010
+ "unicorn/prefer-unary-minus": "warn",
2011
+ /*
2012
+ * Prefer Unicode code point escapes over legacy escape sequences.
2013
+ *
2014
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-unicode-code-point-escapes.md
2015
+ */
2016
+ "unicorn/prefer-unicode-code-point-escapes": "warn",
2017
+ /*
2018
+ * Prefer `URL.canParse()` over constructing a `URL` in a try/catch for validation.
2019
+ *
2020
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-can-parse.md
2021
+ */
2022
+ "unicorn/prefer-url-can-parse": "warn",
2023
+ /*
2024
+ * Prefer `URL#href` over stringifying a `URL`.
2025
+ *
2026
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-href.md
2027
+ */
2028
+ "unicorn/prefer-url-href": "warn",
2029
+ /*
2030
+ * Prefer `URLSearchParams` over manually splitting query strings.
2031
+ *
2032
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-url-search-parameters.md
2033
+ */
2034
+ "unicorn/prefer-url-search-parameters": "warn",
2035
+ /*
2036
+ * Prefer putting the condition in the while statement.
2037
+ *
2038
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-while-loop-condition.md
2039
+ */
2040
+ "unicorn/prefer-while-loop-condition": "warn",
935
2041
  /*
936
2042
  * Enforce consistent relative URL style
937
2043
  *
@@ -947,6 +2053,21 @@ export const unicornPluginConfig = {
947
2053
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
948
2054
  */
949
2055
  "unicorn/require-array-join-separator": "warn",
2056
+ /*
2057
+ * Require a compare function when calling `Array#sort()` or `Array#toSorted()`.
2058
+ *
2059
+ * Off because @typescript-eslint/require-array-sort-compare handles this better as it's type aware and doesn't
2060
+ * flag string arrays.
2061
+ *
2062
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-sort-compare.md
2063
+ */
2064
+ "unicorn/require-array-sort-compare": "off",
2065
+ /*
2066
+ * Require `CSS.escape()` for interpolated values in CSS selectors.
2067
+ *
2068
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-css-escape.md
2069
+ */
2070
+ "unicorn/require-css-escape": "warn",
950
2071
  /*
951
2072
  * Require non-empty module attributes for imports and exports
952
2073
  *
@@ -965,12 +2086,24 @@ export const unicornPluginConfig = {
965
2086
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
966
2087
  */
967
2088
  "unicorn/require-number-to-fixed-digits-argument": "warn",
2089
+ /*
2090
+ * Require passive event listeners for high-frequency events.
2091
+ *
2092
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-passive-events.md
2093
+ */
2094
+ "unicorn/require-passive-events": "warn",
968
2095
  /*
969
2096
  * Enforce using the targetOrigin argument with window.postMessage()
970
2097
  *
971
2098
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-post-message-target-origin.md
972
2099
  */
973
2100
  "unicorn/require-post-message-target-origin": "warn",
2101
+ /*
2102
+ * Require boolean-returning Proxy traps to return booleans.
2103
+ *
2104
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-proxy-trap-boolean-return.md
2105
+ */
2106
+ "unicorn/require-proxy-trap-boolean-return": "warn",
974
2107
  /*
975
2108
  * Enforce certain things about the contents of strings. For example, you
976
2109
  * can enforce using ’ instead of ' to avoid escaping. Or you could block
@@ -1014,5 +2147,11 @@ export const unicornPluginConfig = {
1014
2147
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
1015
2148
  */
1016
2149
  "unicorn/throw-new-error": "warn",
2150
+ /*
2151
+ * Limit the complexity of `try` blocks.
2152
+ *
2153
+ * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/try-complexity.md
2154
+ */
2155
+ "unicorn/try-complexity": "warn",
1017
2156
  },
1018
2157
  };