@vinicunca/eslint-config 2.1.7 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -56,6 +56,7 @@ __export(src_exports, {
56
56
  STYLISTIC_CONFIG_DEFAULTS: () => STYLISTIC_CONFIG_DEFAULTS,
57
57
  combineConfigs: () => combineConfigs,
58
58
  comments: () => comments,
59
+ defaultPluginRenaming: () => defaultPluginRenaming,
59
60
  ignores: () => ignores,
60
61
  imports: () => imports,
61
62
  interopDefault: () => interopDefault,
@@ -73,6 +74,7 @@ __export(src_exports, {
73
74
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
74
75
  pluginVinicunca: () => import_eslint_plugin_vinicunca.default,
75
76
  react: () => react,
77
+ renamePluginInConfigs: () => renamePluginInConfigs,
76
78
  renameRules: () => renameRules,
77
79
  sortPackageJson: () => sortPackageJson,
78
80
  sortTsconfig: () => sortTsconfig,
@@ -88,12 +90,484 @@ __export(src_exports, {
88
90
  });
89
91
  module.exports = __toCommonJS(src_exports);
90
92
 
91
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.3.6/node_modules/@vinicunca/perkakas/dist/es/guard/is-boolean.js
93
+ // ../node_modules/.pnpm/@vinicunca+perkakas@0.5.3/node_modules/@vinicunca/perkakas/dist/index.mjs
94
+ function purry(fn, args, lazyFactory) {
95
+ const callArgs = Array.from(args);
96
+ const diff = fn.length - args.length;
97
+ if (diff === 0) {
98
+ return fn(...callArgs);
99
+ }
100
+ if (diff === 1) {
101
+ const ret = (data) => fn(data, ...callArgs);
102
+ const lazy = lazyFactory ?? fn.lazy;
103
+ return lazy === void 0 ? ret : Object.assign(ret, { lazy, lazyArgs: args });
104
+ }
105
+ throw new Error("Wrong number of arguments");
106
+ }
107
+ function purryOn(isArg, implementation, args) {
108
+ const callArgs = Array.from(args);
109
+ return isArg(args[0]) ? (data) => implementation(data, ...callArgs) : implementation(...callArgs);
110
+ }
111
+ function conditional(...args) {
112
+ return purryOn(isCase, conditionalImplementation, args);
113
+ }
114
+ function conditionalImplementation(data, ...cases) {
115
+ for (const [when, then] of cases) {
116
+ if (when(data)) {
117
+ return then(data);
118
+ }
119
+ }
120
+ throw new Error("conditional: data failed for all cases");
121
+ }
122
+ function isCase(maybeCase) {
123
+ if (!Array.isArray(maybeCase)) {
124
+ return false;
125
+ }
126
+ const [when, then, ...rest] = maybeCase;
127
+ return typeof when === "function" && when.length <= 1 && typeof then === "function" && then.length <= 1 && rest.length === 0;
128
+ }
129
+ var trivialDefaultCase = () => void 0;
130
+ ((conditional2) => {
131
+ function defaultCase(then = trivialDefaultCase) {
132
+ return [() => true, then];
133
+ }
134
+ conditional2.defaultCase = defaultCase;
135
+ })(conditional || (conditional = {}));
136
+ function _reduceLazy(array, lazy, isIndexed = false) {
137
+ const out = [];
138
+ for (let index = 0; index < array.length; index++) {
139
+ const item = array[index];
140
+ const result = isIndexed ? lazy(item, index, array) : lazy(item);
141
+ if (result.hasMany === true) {
142
+ out.push(...result.next);
143
+ } else if (result.hasNext) {
144
+ out.push(result.next);
145
+ }
146
+ if (result.done) {
147
+ break;
148
+ }
149
+ }
150
+ return out;
151
+ }
152
+ function differenceWith(...args) {
153
+ return purry(differenceWith_, args, differenceWith.lazy);
154
+ }
155
+ function differenceWith_(array, other, isEquals) {
156
+ const lazy = differenceWith.lazy(other, isEquals);
157
+ return _reduceLazy(array, lazy);
158
+ }
159
+ ((differenceWith2) => {
160
+ function lazy(other, isEquals) {
161
+ return (value) => other.every((otherValue) => !isEquals(value, otherValue)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
162
+ }
163
+ differenceWith2.lazy = lazy;
164
+ })(differenceWith || (differenceWith = {}));
165
+ var COMPARATORS = {
166
+ asc: (x, y) => x > y,
167
+ desc: (x, y) => x < y
168
+ };
169
+ function purryOrderRules(func, inputArgs) {
170
+ const [dataOrRule, ...rules] = Array.isArray(inputArgs) ? inputArgs : Array.from(inputArgs);
171
+ if (!isOrderRule(dataOrRule)) {
172
+ const compareFn2 = orderRuleComparer(...rules);
173
+ return func(dataOrRule, compareFn2);
174
+ }
175
+ const compareFn = orderRuleComparer(dataOrRule, ...rules);
176
+ return (data) => func(data, compareFn);
177
+ }
178
+ function orderRuleComparer(primaryRule, secondaryRule, ...otherRules) {
179
+ const projector = typeof primaryRule === "function" ? primaryRule : primaryRule[0];
180
+ const direction = typeof primaryRule === "function" ? "asc" : primaryRule[1];
181
+ const { [direction]: comparator } = COMPARATORS;
182
+ const nextComparer = secondaryRule === void 0 ? void 0 : orderRuleComparer(secondaryRule, ...otherRules);
183
+ return (a, b) => {
184
+ const projectedA = projector(a);
185
+ const projectedB = projector(b);
186
+ if (comparator(projectedA, projectedB)) {
187
+ return 1;
188
+ }
189
+ if (comparator(projectedB, projectedA)) {
190
+ return -1;
191
+ }
192
+ return (nextComparer == null ? void 0 : nextComparer(a, b)) ?? 0;
193
+ };
194
+ }
195
+ function isOrderRule(x) {
196
+ if (isProjection(x)) {
197
+ return true;
198
+ }
199
+ if (typeof x !== "object" || !Array.isArray(x)) {
200
+ return false;
201
+ }
202
+ const [maybeProjection, maybeDirection, ...rest] = x;
203
+ return isProjection(maybeProjection) && maybeDirection in COMPARATORS && rest.length === 0;
204
+ }
205
+ function isProjection(x) {
206
+ return typeof x === "function" && x.length === 1;
207
+ }
208
+ function drop(...args) {
209
+ return purry(drop_, args, drop.lazy);
210
+ }
211
+ function drop_(array, n) {
212
+ return _reduceLazy(array, drop.lazy(n));
213
+ }
214
+ ((drop2) => {
215
+ function lazy(n) {
216
+ let left = n;
217
+ return (value) => {
218
+ if (left > 0) {
219
+ left -= 1;
220
+ return { done: false, hasNext: false };
221
+ }
222
+ return { done: false, hasNext: true, next: value };
223
+ };
224
+ }
225
+ drop2.lazy = lazy;
226
+ })(drop || (drop = {}));
227
+ function entries(...args) {
228
+ return purry(Object.entries, args);
229
+ }
230
+ ((entries2) => {
231
+ entries2.strict = entries2;
232
+ })(entries || (entries = {}));
233
+ function _toLazyIndexed(fn) {
234
+ return Object.assign(fn, { indexed: true });
235
+ }
236
+ function filter(...args) {
237
+ return purry(filter_(false), args, filter.lazy);
238
+ }
239
+ function filter_(indexed) {
240
+ return (array, fn) => {
241
+ return _reduceLazy(
242
+ array,
243
+ indexed ? filter.lazyIndexed(fn) : filter.lazy(fn),
244
+ indexed
245
+ );
246
+ };
247
+ }
248
+ function lazy_$5(indexed) {
249
+ return (fn) => (value, index, array) => (indexed ? fn(value, index, array) : fn(value)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
250
+ }
251
+ ((filter2) => {
252
+ function indexed(...args) {
253
+ return purry(filter_(true), args, filter2.lazyIndexed);
254
+ }
255
+ filter2.indexed = indexed;
256
+ filter2.lazy = lazy_$5(false);
257
+ filter2.lazyIndexed = _toLazyIndexed(lazy_$5(true));
258
+ })(filter || (filter = {}));
259
+ function _toSingle(fn) {
260
+ return Object.assign(fn, { single: true });
261
+ }
262
+ function findIndex(...args) {
263
+ return purry(findIndex_(false), args, findIndex.lazy);
264
+ }
265
+ function findIndex_(indexed) {
266
+ return (array, fn) => array.findIndex((item, index, input) => indexed ? fn(item, index, input) : fn(item));
267
+ }
268
+ function lazy_$4(indexed) {
269
+ return (fn) => {
270
+ let actualIndex = 0;
271
+ return (value, index, array) => {
272
+ if (indexed ? fn(value, index, array) : fn(value)) {
273
+ return { done: true, hasNext: true, next: actualIndex };
274
+ }
275
+ actualIndex += 1;
276
+ return { done: false, hasNext: false };
277
+ };
278
+ };
279
+ }
280
+ ((findIndex2) => {
281
+ function indexed(...args) {
282
+ return purry(findIndex_(true), args, findIndex2.lazyIndexed);
283
+ }
284
+ findIndex2.indexed = indexed;
285
+ findIndex2.lazy = _toSingle(lazy_$4(false));
286
+ findIndex2.lazyIndexed = _toSingle(_toLazyIndexed(lazy_$4(true)));
287
+ })(findIndex || (findIndex = {}));
288
+ function findLastIndex(...args) {
289
+ return purry(findLastIndex_(false), args);
290
+ }
291
+ function findLastIndex_(indexed) {
292
+ return (array, fn) => {
293
+ for (let i = array.length - 1; i >= 0; i--) {
294
+ if (indexed ? fn(array[i], i, array) : fn(array[i])) {
295
+ return i;
296
+ }
297
+ }
298
+ return -1;
299
+ };
300
+ }
301
+ ((findLastIndex2) => {
302
+ function indexed(...args) {
303
+ return purry(findLastIndex_(true), args);
304
+ }
305
+ findLastIndex2.indexed = indexed;
306
+ })(findLastIndex || (findLastIndex = {}));
307
+ function findLast(...args) {
308
+ return purry(findLast_(false), args);
309
+ }
310
+ function findLast_(indexed) {
311
+ return (array, fn) => {
312
+ for (let i = array.length - 1; i >= 0; i--) {
313
+ if (indexed ? fn(array[i], i, array) : fn(array[i])) {
314
+ return array[i];
315
+ }
316
+ }
317
+ return void 0;
318
+ };
319
+ }
320
+ ((findLast2) => {
321
+ function indexed(...args) {
322
+ return purry(findLast_(true), args);
323
+ }
324
+ findLast2.indexed = indexed;
325
+ })(findLast || (findLast = {}));
326
+ function find(...args) {
327
+ return purry(find_(false), args, find.lazy);
328
+ }
329
+ function find_(indexed) {
330
+ return (array, fn) => array.find((item, index, input) => indexed ? fn(item, index, input) : fn(item));
331
+ }
332
+ function lazy_$3(indexed) {
333
+ return (fn) => (value, index, array) => (indexed ? fn(value, index, array) : fn(value)) ? { done: true, hasNext: true, next: value } : { done: false, hasNext: false };
334
+ }
335
+ ((find2) => {
336
+ function indexed(...args) {
337
+ return purry(find_(true), args, find2.lazyIndexed);
338
+ }
339
+ find2.indexed = indexed;
340
+ find2.lazy = _toSingle(lazy_$3(false));
341
+ find2.lazyIndexed = _toSingle(_toLazyIndexed(lazy_$3(true)));
342
+ })(find || (find = {}));
343
+ function first(...args) {
344
+ return purry(first_, args, first.lazy);
345
+ }
346
+ function first_([item]) {
347
+ return item;
348
+ }
349
+ ((first2) => {
350
+ function lazy() {
351
+ return (value) => ({ done: true, hasNext: true, next: value });
352
+ }
353
+ first2.lazy = lazy;
354
+ ((lazy2) => {
355
+ lazy2.single = true;
356
+ })(lazy = first2.lazy || (first2.lazy = {}));
357
+ })(first || (first = {}));
358
+ function flatten(...args) {
359
+ return purry(flatten_, args, flatten.lazy);
360
+ }
361
+ function flatten_(items) {
362
+ return _reduceLazy(items, flatten.lazy());
363
+ }
364
+ ((flatten2) => {
365
+ function lazy() {
366
+ return (item) => (
367
+ // @ts-expect-error [ts2322] - We need to make LazyMany better so it accommodate the typing here...
368
+ Array.isArray(item) ? { done: false, hasMany: true, hasNext: true, next: item } : { done: false, hasNext: true, next: item }
369
+ );
370
+ }
371
+ flatten2.lazy = lazy;
372
+ })(flatten || (flatten = {}));
373
+ function flatMap(...args) {
374
+ return purry(flatMap_, args, flatMap.lazy);
375
+ }
376
+ function flatMap_(array, fn) {
377
+ return flatten(array.map((item) => fn(item)));
378
+ }
379
+ ((flatMap2) => {
380
+ function lazy(fn) {
381
+ return (value) => {
382
+ const next = fn(value);
383
+ return Array.isArray(next) ? { done: false, hasMany: true, hasNext: true, next } : { done: false, hasNext: true, next };
384
+ };
385
+ }
386
+ flatMap2.lazy = lazy;
387
+ })(flatMap || (flatMap = {}));
388
+ function flattenDeep(...args) {
389
+ return purry(flattenDeep_, args, flattenDeep.lazy);
390
+ }
391
+ function flattenDeep_(items) {
392
+ return _reduceLazy(items, flattenDeep.lazy());
393
+ }
394
+ function flattenDeepValue_(value) {
395
+ if (!Array.isArray(value)) {
396
+ return value;
397
+ }
398
+ const ret = [];
399
+ for (const item of value) {
400
+ if (Array.isArray(item)) {
401
+ ret.push(...flattenDeep(item));
402
+ } else {
403
+ ret.push(item);
404
+ }
405
+ }
406
+ return ret;
407
+ }
408
+ ((flattenDeep2) => {
409
+ function lazy() {
410
+ return (value) => {
411
+ const next = flattenDeepValue_(value);
412
+ return Array.isArray(next) ? { done: false, hasMany: true, hasNext: true, next } : { done: false, hasNext: true, next };
413
+ };
414
+ }
415
+ flattenDeep2.lazy = lazy;
416
+ })(flattenDeep || (flattenDeep = {}));
417
+ function forEachObj(...args) {
418
+ return purry(forEachObj_(false), args);
419
+ }
420
+ function forEachObj_(indexed) {
421
+ return (data, fn) => {
422
+ for (const key in data) {
423
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
424
+ const { [key]: val } = data;
425
+ if (indexed) {
426
+ fn(val, key, data);
427
+ } else {
428
+ fn(val);
429
+ }
430
+ }
431
+ }
432
+ return data;
433
+ };
434
+ }
435
+ ((forEachObj2) => {
436
+ function indexed(...args) {
437
+ return purry(forEachObj_(true), args);
438
+ }
439
+ forEachObj2.indexed = indexed;
440
+ })(forEachObj || (forEachObj = {}));
441
+ function forEach(...args) {
442
+ return purry(forEach_(false), args, forEach.lazy);
443
+ }
444
+ function forEach_(indexed) {
445
+ return (array, fn) => _reduceLazy(
446
+ array,
447
+ indexed ? forEach.lazyIndexed(fn) : forEach.lazy(fn),
448
+ indexed
449
+ );
450
+ }
451
+ function lazy_$2(indexed) {
452
+ return (fn) => (value, index, array) => {
453
+ if (indexed) {
454
+ fn(value, index, array);
455
+ } else {
456
+ fn(value);
457
+ }
458
+ return {
459
+ done: false,
460
+ hasNext: true,
461
+ next: value
462
+ };
463
+ };
464
+ }
465
+ ((forEach2) => {
466
+ function indexed(...args) {
467
+ return purry(forEach_(true), args, forEach2.lazyIndexed);
468
+ }
469
+ forEach2.indexed = indexed;
470
+ forEach2.lazy = lazy_$2(false);
471
+ forEach2.lazyIndexed = _toLazyIndexed(lazy_$2(true));
472
+ })(forEach || (forEach = {}));
473
+ function fromEntries(...args) {
474
+ return purry(fromEntriesImplementation, args);
475
+ }
476
+ function fromEntriesImplementation(entries2) {
477
+ const out = {};
478
+ for (const [key, value] of entries2) {
479
+ out[key] = value;
480
+ }
481
+ return out;
482
+ }
483
+ ((fromEntries2) => {
484
+ fromEntries2.strict = fromEntries2;
485
+ })(fromEntries || (fromEntries = {}));
486
+ function groupBy(...args) {
487
+ return purry(groupBy_(false), args);
488
+ }
489
+ function groupBy_(indexed) {
490
+ return (array, fn) => {
491
+ const ret = {};
492
+ for (const [index, item] of array.entries()) {
493
+ const key = indexed ? fn(item, index, array) : fn(item);
494
+ if (key !== void 0) {
495
+ const actualKey = String(key);
496
+ let items = ret[actualKey];
497
+ if (items === void 0) {
498
+ items = [];
499
+ ret[actualKey] = items;
500
+ }
501
+ items.push(item);
502
+ }
503
+ }
504
+ return ret;
505
+ };
506
+ }
507
+ ((groupBy2) => {
508
+ function indexed(...args) {
509
+ return purry(groupBy_(true), args);
510
+ }
511
+ groupBy2.indexed = indexed;
512
+ groupBy2.strict = groupBy2;
513
+ })(groupBy || (groupBy = {}));
514
+ function indexBy(...args) {
515
+ return purry(indexBy_(false), args);
516
+ }
517
+ function indexBy_(indexed) {
518
+ return (array, fn) => {
519
+ const out = {};
520
+ for (const [index, item] of array.entries()) {
521
+ const value = indexed ? fn(item, index, array) : fn(item);
522
+ const key = String(value);
523
+ out[key] = item;
524
+ }
525
+ return out;
526
+ };
527
+ }
528
+ function indexByStrict(...args) {
529
+ return purry(indexByStrict_, args);
530
+ }
531
+ function indexByStrict_(array, fn) {
532
+ const out = {};
533
+ for (const item of array) {
534
+ const key = fn(item);
535
+ out[key] = item;
536
+ }
537
+ return out;
538
+ }
539
+ ((indexBy2) => {
540
+ function indexed(...args) {
541
+ return purry(indexBy_(true), args);
542
+ }
543
+ indexBy2.indexed = indexed;
544
+ indexBy2.strict = indexByStrict;
545
+ })(indexBy || (indexBy = {}));
546
+ function intersectionWith(...args) {
547
+ return purry(intersectionWith_, args, intersectionWith.lazy);
548
+ }
549
+ function intersectionWith_(array, other, comparator) {
550
+ const lazy = intersectionWith.lazy(other, comparator);
551
+ return _reduceLazy(array, lazy);
552
+ }
553
+ ((intersectionWith2) => {
554
+ function lazy(other, comparator) {
555
+ return (value) => other.some((otherValue) => comparator(value, otherValue)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
556
+ }
557
+ intersectionWith2.lazy = lazy;
558
+ })(intersectionWith || (intersectionWith = {}));
92
559
  function isBoolean(data) {
93
560
  return typeof data === "boolean";
94
561
  }
95
-
96
- // ../node_modules/.pnpm/@vinicunca+perkakas@0.3.6/node_modules/@vinicunca/perkakas/dist/es/guard/is-object.js
562
+ function isDefined(data) {
563
+ return data !== void 0 && data !== null;
564
+ }
565
+ ((isDefined2) => {
566
+ function strict(data) {
567
+ return data !== void 0;
568
+ }
569
+ isDefined2.strict = strict;
570
+ })(isDefined || (isDefined = {}));
97
571
  function isObject(data) {
98
572
  if (typeof data !== "object" || data === null) {
99
573
  return false;
@@ -101,8 +575,281 @@ function isObject(data) {
101
575
  const proto = Object.getPrototypeOf(data);
102
576
  return proto === null || proto === Object.prototype;
103
577
  }
578
+ function keys(...args) {
579
+ return purry(Object.keys, args);
580
+ }
581
+ ((keys2) => {
582
+ keys2.strict = keys2;
583
+ })(keys || (keys = {}));
584
+ function mapToObj(...args) {
585
+ return purry(mapToObj_(false), args);
586
+ }
587
+ function mapToObj_(indexed) {
588
+ return (array, fn) => {
589
+ const out = {};
590
+ for (const [index, element] of array.entries()) {
591
+ const [key, value] = indexed ? fn(element, index, array) : fn(element);
592
+ out[key] = value;
593
+ }
594
+ return out;
595
+ };
596
+ }
597
+ ((mapToObj2) => {
598
+ function indexed(...args) {
599
+ return purry(mapToObj_(true), args);
600
+ }
601
+ mapToObj2.indexed = indexed;
602
+ })(mapToObj || (mapToObj = {}));
603
+ function map(...args) {
604
+ return purry(map_(false), args, map.lazy);
605
+ }
606
+ function map_(indexed) {
607
+ return (array, fn) => {
608
+ return _reduceLazy(
609
+ array,
610
+ indexed ? map.lazyIndexed(fn) : map.lazy(fn),
611
+ indexed
612
+ );
613
+ };
614
+ }
615
+ function lazy_$1(indexed) {
616
+ return (fn) => (value, index, array) => ({
617
+ done: false,
618
+ hasNext: true,
619
+ next: indexed ? fn(value, index, array) : fn(value)
620
+ });
621
+ }
622
+ ((map2) => {
623
+ function indexed(...args) {
624
+ return purry(map_(true), args, map2.lazyIndexed);
625
+ }
626
+ map2.indexed = indexed;
627
+ map2.lazy = lazy_$1(false);
628
+ map2.lazyIndexed = _toLazyIndexed(lazy_$1(true));
629
+ map2.strict = map2;
630
+ })(map || (map = {}));
631
+ function meanBy_(indexed) {
632
+ return (array, fn) => {
633
+ if (array.length === 0) {
634
+ return Number.NaN;
635
+ }
636
+ let sum = 0;
637
+ for (const [index, item] of array.entries()) {
638
+ sum += indexed ? fn(item, index, array) : fn(item);
639
+ }
640
+ return sum / array.length;
641
+ };
642
+ }
643
+ function meanBy(...args) {
644
+ return purry(meanBy_(false), args);
645
+ }
646
+ ((meanBy2) => {
647
+ function indexed(...args) {
648
+ return purry(meanBy_(true), args);
649
+ }
650
+ meanBy2.indexed = indexed;
651
+ })(meanBy || (meanBy = {}));
652
+ function partition(...args) {
653
+ return purry(partition_(false), args);
654
+ }
655
+ function partition_(indexed) {
656
+ return (array, fn) => {
657
+ const ret = [[], []];
658
+ for (const [index, item] of array.entries()) {
659
+ const matches = indexed ? fn(item, index, array) : fn(item);
660
+ ret[matches ? 0 : 1].push(item);
661
+ }
662
+ return ret;
663
+ };
664
+ }
665
+ ((partition2) => {
666
+ function indexed(...args) {
667
+ return purry(partition_(true), args);
668
+ }
669
+ partition2.indexed = indexed;
670
+ })(partition || (partition = {}));
671
+ function reduce(...args) {
672
+ return purry(reduce_(false), args);
673
+ }
674
+ function reduce_(indexed) {
675
+ return (items, fn, initialValue) => {
676
+ return items.reduce(
677
+ (acc, item, index) => indexed ? fn(acc, item, index, items) : fn(acc, item),
678
+ initialValue
679
+ );
680
+ };
681
+ }
682
+ ((reduce2) => {
683
+ function indexed(...args) {
684
+ return purry(reduce_(true), args);
685
+ }
686
+ reduce2.indexed = indexed;
687
+ })(reduce || (reduce = {}));
688
+ function sortBy(...args) {
689
+ return purryOrderRules(_sortBy, args);
690
+ }
691
+ function _sortBy(data, compareFn) {
692
+ return data.slice().sort(compareFn);
693
+ }
694
+ ((sortBy2) => {
695
+ sortBy2.strict = sortBy2;
696
+ })(sortBy || (sortBy = {}));
697
+ function sort(...args) {
698
+ return purry(sort_, args);
699
+ }
700
+ function sort_(items, cmp) {
701
+ const ret = items.slice();
702
+ ret.sort(cmp);
703
+ return ret;
704
+ }
705
+ ((sort2) => {
706
+ sort2.strict = sort2;
707
+ })(sort || (sort = {}));
708
+ function _binarySearchCutoffIndex(array, predicate) {
709
+ let lowIndex = 0;
710
+ let highIndex = array.length;
711
+ while (lowIndex < highIndex) {
712
+ const pivotIndex = lowIndex + highIndex >>> 1;
713
+ const pivot = array[pivotIndex];
714
+ if (predicate(pivot, pivotIndex)) {
715
+ lowIndex = pivotIndex + 1;
716
+ } else {
717
+ highIndex = pivotIndex;
718
+ }
719
+ }
720
+ return highIndex;
721
+ }
722
+ function sortedIndexBy(...args) {
723
+ return purry(sortedIndexByImplementation, args);
724
+ }
725
+ ((sortedIndexBy2) => {
726
+ function indexed(...args) {
727
+ return purry(sortedIndexByImplementation, args);
728
+ }
729
+ sortedIndexBy2.indexed = indexed;
730
+ })(sortedIndexBy || (sortedIndexBy = {}));
731
+ function sortedIndexByImplementation(array, item, valueFunction) {
732
+ const value = valueFunction(item);
733
+ return _binarySearchCutoffIndex(
734
+ array,
735
+ (pivot, index) => valueFunction(pivot, index) < value
736
+ );
737
+ }
738
+ function sortedIndexWith(...args) {
739
+ return purry(_binarySearchCutoffIndex, args);
740
+ }
741
+ ((sortedIndexWith2) => {
742
+ function indexed(...args) {
743
+ return purry(_binarySearchCutoffIndex, args);
744
+ }
745
+ sortedIndexWith2.indexed = indexed;
746
+ })(sortedIndexWith || (sortedIndexWith = {}));
747
+ function sortedLastIndexBy(...args) {
748
+ return purry(sortedLastIndexByImplementation, args);
749
+ }
750
+ ((sortedLastIndexBy2) => {
751
+ function indexed(...args) {
752
+ return purry(sortedLastIndexByImplementation, args);
753
+ }
754
+ sortedLastIndexBy2.indexed = indexed;
755
+ })(sortedLastIndexBy || (sortedLastIndexBy = {}));
756
+ function sortedLastIndexByImplementation(array, item, valueFunction) {
757
+ const value = valueFunction(item);
758
+ return _binarySearchCutoffIndex(
759
+ array,
760
+ // The only difference between the regular implementation and the "last"
761
+ // variation is that we consider the pivot with equality too, so that we
762
+ // skip all equal values in addition to the lower ones.
763
+ (pivot, index) => valueFunction(pivot, index) <= value
764
+ );
765
+ }
766
+ function sumBy_(indexed) {
767
+ return (array, fn) => {
768
+ let sum = 0;
769
+ for (const [index, item] of array.entries()) {
770
+ const summand = indexed ? fn(item, index, array) : fn(item);
771
+ sum += summand;
772
+ }
773
+ return sum;
774
+ };
775
+ }
776
+ function sumBy(...args) {
777
+ return purry(sumBy_(false), args);
778
+ }
779
+ ((sumBy2) => {
780
+ function indexed(...args) {
781
+ return purry(sumBy_(true), args);
782
+ }
783
+ sumBy2.indexed = indexed;
784
+ })(sumBy || (sumBy = {}));
785
+ function take(...args) {
786
+ return purry(take_, args, take.lazy);
787
+ }
788
+ function take_(array, n) {
789
+ return _reduceLazy(array, take.lazy(n));
790
+ }
791
+ ((take2) => {
792
+ function lazy(n) {
793
+ if (n <= 0) {
794
+ return () => ({ done: true, hasNext: false });
795
+ }
796
+ let remaining = n;
797
+ return (value) => {
798
+ remaining -= 1;
799
+ return { done: remaining <= 0, hasNext: true, next: value };
800
+ };
801
+ }
802
+ take2.lazy = lazy;
803
+ })(take || (take = {}));
804
+ function uniqueWith(...args) {
805
+ return purry(uniqueWithImplementation, args, uniqueWith.lazy);
806
+ }
807
+ function uniqueWithImplementation(array, isEquals) {
808
+ const lazy = uniqueWith.lazy(isEquals);
809
+ return _reduceLazy(array, lazy, true);
810
+ }
811
+ function lazy_(isEquals) {
812
+ return (value, index, array) => array !== void 0 && array.findIndex((otherValue) => isEquals(value, otherValue)) === index ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
813
+ }
814
+ ((uniqueWith2) => {
815
+ uniqueWith2.lazy = _toLazyIndexed(lazy_);
816
+ })(uniqueWith || (uniqueWith = {}));
817
+ function unique(...args) {
818
+ return purry(uniqueImplementation, args, unique.lazy);
819
+ }
820
+ function uniqueImplementation(array) {
821
+ return _reduceLazy(array, unique.lazy());
822
+ }
823
+ ((unique2) => {
824
+ function lazy() {
825
+ const set = /* @__PURE__ */ new Set();
826
+ return (value) => {
827
+ if (set.has(value)) {
828
+ return { done: false, hasNext: false };
829
+ }
830
+ set.add(value);
831
+ return { done: false, hasNext: true, next: value };
832
+ };
833
+ }
834
+ unique2.lazy = lazy;
835
+ })(unique || (unique = {}));
836
+ function zip(...args) {
837
+ return purry(zip_, args);
838
+ }
839
+ function zip_(first2, second) {
840
+ const resultLength = first2.length > second.length ? second.length : first2.length;
841
+ const result = [];
842
+ for (let i = 0; i < resultLength; i++) {
843
+ result.push([first2[i], second[i]]);
844
+ }
845
+ return result;
846
+ }
847
+ ((zip2) => {
848
+ zip2.strict = zip2;
849
+ })(zip || (zip = {}));
104
850
 
105
851
  // src/base.ts
852
+ var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
106
853
  var import_local_pkg = require("local-pkg");
107
854
  var import_node_fs = __toESM(require("fs"), 1);
108
855
  var import_node_process2 = __toESM(require("process"), 1);
@@ -118,7 +865,7 @@ var ALWAYS = "always";
118
865
  // src/plugins.ts
119
866
  var import_eslint_plugin_vinicunca = __toESM(require("@vinicunca/eslint-plugin-vinicunca"), 1);
120
867
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
121
- var pluginImport = __toESM(require("eslint-plugin-i"), 1);
868
+ var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
122
869
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
123
870
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
124
871
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
@@ -548,17 +1295,37 @@ async function combineConfigs(...configs) {
548
1295
  const resolved = await Promise.all(configs);
549
1296
  return resolved.flat();
550
1297
  }
551
- function renameRules(rules, from, to) {
1298
+ function renameRules(rules, map2) {
552
1299
  return Object.fromEntries(
553
1300
  Object.entries(rules).map(([key, value]) => {
554
- if (key.startsWith(from)) {
555
- return [to + key.slice(from.length), value];
1301
+ for (const [from, to] of Object.entries(map2)) {
1302
+ if (key.startsWith(`${from}/`)) {
1303
+ return [to + key.slice(from.length), value];
1304
+ }
556
1305
  }
557
- ;
558
1306
  return [key, value];
559
1307
  })
560
1308
  );
561
1309
  }
1310
+ function renamePluginInConfigs(configs, map2) {
1311
+ return configs.map((i) => {
1312
+ const clone = { ...i };
1313
+ if (clone.rules) {
1314
+ clone.rules = renameRules(clone.rules, map2);
1315
+ }
1316
+ if (clone.plugins) {
1317
+ clone.plugins = Object.fromEntries(
1318
+ Object.entries(clone.plugins).map(([key, value]) => {
1319
+ if (key in map2) {
1320
+ return [map2[key], value];
1321
+ }
1322
+ return [key, value];
1323
+ })
1324
+ );
1325
+ }
1326
+ return clone;
1327
+ });
1328
+ }
562
1329
  async function interopDefault(m) {
563
1330
  const resolved = await m;
564
1331
  return resolved.default || resolved;
@@ -976,6 +1743,22 @@ async function sortPackageJson() {
976
1743
  "default"
977
1744
  ],
978
1745
  pathPattern: "^exports.*$"
1746
+ },
1747
+ {
1748
+ order: [
1749
+ // client hooks only
1750
+ "pre-commit",
1751
+ "prepare-commit-msg",
1752
+ "commit-msg",
1753
+ "post-commit",
1754
+ "pre-rebase",
1755
+ "post-rewrite",
1756
+ "post-checkout",
1757
+ "post-merge",
1758
+ "pre-push",
1759
+ "pre-auto-gc"
1760
+ ],
1761
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
979
1762
  }
980
1763
  ]
981
1764
  }
@@ -1339,13 +2122,11 @@ async function typescript(options = {}) {
1339
2122
  rules: {
1340
2123
  ...renameRules(
1341
2124
  pluginTs.configs["eslint-recommended"].overrides[0].rules,
1342
- "@typescript-eslint/",
1343
- "ts/"
2125
+ { "@typescript-eslint": "ts" }
1344
2126
  ),
1345
2127
  ...renameRules(
1346
2128
  pluginTs.configs.strict.rules,
1347
- "@typescript-eslint/",
1348
- "ts/"
2129
+ { "@typescript-eslint": "ts" }
1349
2130
  ),
1350
2131
  "no-dupe-class-members": OFF,
1351
2132
  "no-invalid-this": OFF,
@@ -1872,8 +2653,17 @@ var VuePackages = [
1872
2653
  "vitepress",
1873
2654
  "@slidev/cli"
1874
2655
  ];
1875
- async function vinicuncaESLint(options = {}, ...userConfigs) {
2656
+ var defaultPluginRenaming = {
2657
+ "@stylistic": "style",
2658
+ "@typescript-eslint": "ts",
2659
+ "import-x": "import",
2660
+ "n": "node",
2661
+ "vitest": "test",
2662
+ "yml": "yaml"
2663
+ };
2664
+ function vinicuncaESLint(options = {}, ...userConfigs) {
1876
2665
  const {
2666
+ autoRenamePlugins = true,
1877
2667
  componentExts = [],
1878
2668
  gitignore: enableGitignore = true,
1879
2669
  isInEditor = !!((import_node_process2.default.env.VSCODE_PID || import_node_process2.default.env.JETBRAINS_IDE || import_node_process2.default.env.VIM) && !import_node_process2.default.env.CI),
@@ -2000,10 +2790,15 @@ async function vinicuncaESLint(options = {}, ...userConfigs) {
2000
2790
  configs.push([fusedConfig]);
2001
2791
  }
2002
2792
  ;
2003
- return combineConfigs(
2793
+ let pipeline = new import_eslint_flat_config_utils.FlatConfigPipeline();
2794
+ pipeline = pipeline.append(
2004
2795
  ...configs,
2005
2796
  ...userConfigs
2006
2797
  );
2798
+ if (autoRenamePlugins) {
2799
+ pipeline = pipeline.renamePlugins(defaultPluginRenaming);
2800
+ }
2801
+ return pipeline;
2007
2802
  }
2008
2803
  function getOverrides(options, key) {
2009
2804
  const sub = resolveSubOptions(options, key);
@@ -2042,6 +2837,7 @@ function resolveSubOptions(options, key) {
2042
2837
  STYLISTIC_CONFIG_DEFAULTS,
2043
2838
  combineConfigs,
2044
2839
  comments,
2840
+ defaultPluginRenaming,
2045
2841
  ignores,
2046
2842
  imports,
2047
2843
  interopDefault,
@@ -2059,6 +2855,7 @@ function resolveSubOptions(options, key) {
2059
2855
  pluginUnusedImports,
2060
2856
  pluginVinicunca,
2061
2857
  react,
2858
+ renamePluginInConfigs,
2062
2859
  renameRules,
2063
2860
  sortPackageJson,
2064
2861
  sortTsconfig,