@vinicunca/eslint-config 2.6.1 → 2.7.0-beta.1
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 +82 -799
- package/dist/index.d.cts +377 -968
- package/dist/index.d.ts +377 -968
- package/dist/index.js +81 -799
- package/package.json +17 -17
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,7 @@ __export(src_exports, {
|
|
|
64
64
|
javascript: () => javascript,
|
|
65
65
|
jsdoc: () => jsdoc,
|
|
66
66
|
jsonc: () => jsonc,
|
|
67
|
+
jsx: () => jsx,
|
|
67
68
|
markdown: () => markdown,
|
|
68
69
|
node: () => node,
|
|
69
70
|
parserPlain: () => parserPlain,
|
|
@@ -95,763 +96,17 @@ __export(src_exports, {
|
|
|
95
96
|
});
|
|
96
97
|
module.exports = __toCommonJS(src_exports);
|
|
97
98
|
|
|
98
|
-
// ../node_modules/.pnpm/@vinicunca+perkakas@0.
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return fn(...callArgs);
|
|
104
|
-
}
|
|
105
|
-
if (diff === 1) {
|
|
106
|
-
const ret = (data) => fn(data, ...callArgs);
|
|
107
|
-
const lazy = lazyFactory ?? fn.lazy;
|
|
108
|
-
return lazy === void 0 ? ret : Object.assign(ret, { lazy, lazyArgs: args });
|
|
109
|
-
}
|
|
110
|
-
throw new Error("Wrong number of arguments");
|
|
111
|
-
}
|
|
112
|
-
function purryOn(isArg, implementation, args) {
|
|
113
|
-
const callArgs = Array.from(args);
|
|
114
|
-
return isArg(args[0]) ? (data) => implementation(data, ...callArgs) : implementation(...callArgs);
|
|
115
|
-
}
|
|
116
|
-
function conditional(...args) {
|
|
117
|
-
return purryOn(isCase, conditionalImplementation, args);
|
|
118
|
-
}
|
|
119
|
-
function conditionalImplementation(data, ...cases) {
|
|
120
|
-
for (const [when, then] of cases) {
|
|
121
|
-
if (when(data)) {
|
|
122
|
-
return then(data);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
throw new Error("conditional: data failed for all cases");
|
|
126
|
-
}
|
|
127
|
-
function isCase(maybeCase) {
|
|
128
|
-
if (!Array.isArray(maybeCase)) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
const [when, then, ...rest] = maybeCase;
|
|
132
|
-
return typeof when === "function" && when.length <= 1 && typeof then === "function" && then.length <= 1 && rest.length === 0;
|
|
133
|
-
}
|
|
134
|
-
var trivialDefaultCase = () => void 0;
|
|
135
|
-
((conditional2) => {
|
|
136
|
-
function defaultCase(then = trivialDefaultCase) {
|
|
137
|
-
return [() => true, then];
|
|
138
|
-
}
|
|
139
|
-
conditional2.defaultCase = defaultCase;
|
|
140
|
-
})(conditional || (conditional = {}));
|
|
141
|
-
function _reduceLazy(array, lazy, isIndexed = false) {
|
|
142
|
-
const out = [];
|
|
143
|
-
for (let index = 0; index < array.length; index++) {
|
|
144
|
-
const item = array[index];
|
|
145
|
-
const result = isIndexed ? lazy(item, index, array) : lazy(item);
|
|
146
|
-
if (result.hasMany === true) {
|
|
147
|
-
out.push(...result.next);
|
|
148
|
-
} else if (result.hasNext) {
|
|
149
|
-
out.push(result.next);
|
|
150
|
-
}
|
|
151
|
-
if (result.done) {
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return out;
|
|
156
|
-
}
|
|
157
|
-
function differenceWith(...args) {
|
|
158
|
-
return purry(differenceWith_, args, differenceWith.lazy);
|
|
159
|
-
}
|
|
160
|
-
function differenceWith_(array, other, isEquals) {
|
|
161
|
-
const lazy = differenceWith.lazy(other, isEquals);
|
|
162
|
-
return _reduceLazy(array, lazy);
|
|
163
|
-
}
|
|
164
|
-
((differenceWith2) => {
|
|
165
|
-
function lazy(other, isEquals) {
|
|
166
|
-
return (value) => other.every((otherValue) => !isEquals(value, otherValue)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
|
|
167
|
-
}
|
|
168
|
-
differenceWith2.lazy = lazy;
|
|
169
|
-
})(differenceWith || (differenceWith = {}));
|
|
170
|
-
var COMPARATORS = {
|
|
171
|
-
asc: (x, y) => x > y,
|
|
172
|
-
desc: (x, y) => x < y
|
|
173
|
-
};
|
|
174
|
-
function purryOrderRules(func, inputArgs) {
|
|
175
|
-
const [dataOrRule, ...rules] = Array.isArray(inputArgs) ? inputArgs : Array.from(inputArgs);
|
|
176
|
-
if (!isOrderRule(dataOrRule)) {
|
|
177
|
-
const compareFn2 = orderRuleComparer(...rules);
|
|
178
|
-
return func(dataOrRule, compareFn2);
|
|
179
|
-
}
|
|
180
|
-
const compareFn = orderRuleComparer(dataOrRule, ...rules);
|
|
181
|
-
return (data) => func(data, compareFn);
|
|
182
|
-
}
|
|
183
|
-
function orderRuleComparer(primaryRule, secondaryRule, ...otherRules) {
|
|
184
|
-
const projector = typeof primaryRule === "function" ? primaryRule : primaryRule[0];
|
|
185
|
-
const direction = typeof primaryRule === "function" ? "asc" : primaryRule[1];
|
|
186
|
-
const { [direction]: comparator } = COMPARATORS;
|
|
187
|
-
const nextComparer = secondaryRule === void 0 ? void 0 : orderRuleComparer(secondaryRule, ...otherRules);
|
|
188
|
-
return (a, b) => {
|
|
189
|
-
const projectedA = projector(a);
|
|
190
|
-
const projectedB = projector(b);
|
|
191
|
-
if (comparator(projectedA, projectedB)) {
|
|
192
|
-
return 1;
|
|
193
|
-
}
|
|
194
|
-
if (comparator(projectedB, projectedA)) {
|
|
195
|
-
return -1;
|
|
196
|
-
}
|
|
197
|
-
return (nextComparer == null ? void 0 : nextComparer(a, b)) ?? 0;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function isOrderRule(x) {
|
|
201
|
-
if (isProjection(x)) {
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
if (typeof x !== "object" || !Array.isArray(x)) {
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
const [maybeProjection, maybeDirection, ...rest] = x;
|
|
208
|
-
return isProjection(maybeProjection) && maybeDirection in COMPARATORS && rest.length === 0;
|
|
209
|
-
}
|
|
210
|
-
function isProjection(x) {
|
|
211
|
-
return typeof x === "function" && x.length === 1;
|
|
99
|
+
// ../node_modules/.pnpm/@vinicunca+perkakas@1.0.2/node_modules/@vinicunca/perkakas/dist/chunk-HLL46USD.js
|
|
100
|
+
function r(e2) {
|
|
101
|
+
if (typeof e2 != "object" || e2 === null) return false;
|
|
102
|
+
let o = Object.getPrototypeOf(e2);
|
|
103
|
+
return o === null || o === Object.prototype;
|
|
212
104
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return _reduceLazy(array, drop.lazy(n));
|
|
218
|
-
}
|
|
219
|
-
((drop2) => {
|
|
220
|
-
function lazy(n) {
|
|
221
|
-
let left = n;
|
|
222
|
-
return (value) => {
|
|
223
|
-
if (left > 0) {
|
|
224
|
-
left -= 1;
|
|
225
|
-
return { done: false, hasNext: false };
|
|
226
|
-
}
|
|
227
|
-
return { done: false, hasNext: true, next: value };
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
drop2.lazy = lazy;
|
|
231
|
-
})(drop || (drop = {}));
|
|
232
|
-
function entries(...args) {
|
|
233
|
-
return purry(Object.entries, args);
|
|
234
|
-
}
|
|
235
|
-
((entries2) => {
|
|
236
|
-
entries2.strict = entries2;
|
|
237
|
-
})(entries || (entries = {}));
|
|
238
|
-
function _toLazyIndexed(fn) {
|
|
239
|
-
return Object.assign(fn, { indexed: true });
|
|
240
|
-
}
|
|
241
|
-
function filter(...args) {
|
|
242
|
-
return purry(filter_(false), args, filter.lazy);
|
|
243
|
-
}
|
|
244
|
-
function filter_(indexed) {
|
|
245
|
-
return (array, fn) => {
|
|
246
|
-
return _reduceLazy(
|
|
247
|
-
array,
|
|
248
|
-
indexed ? filter.lazyIndexed(fn) : filter.lazy(fn),
|
|
249
|
-
indexed
|
|
250
|
-
);
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
function lazy_$5(indexed) {
|
|
254
|
-
return (fn) => (value, index, array) => (indexed ? fn(value, index, array) : fn(value)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
|
|
255
|
-
}
|
|
256
|
-
((filter2) => {
|
|
257
|
-
function indexed(...args) {
|
|
258
|
-
return purry(filter_(true), args, filter2.lazyIndexed);
|
|
259
|
-
}
|
|
260
|
-
filter2.indexed = indexed;
|
|
261
|
-
filter2.lazy = lazy_$5(false);
|
|
262
|
-
filter2.lazyIndexed = _toLazyIndexed(lazy_$5(true));
|
|
263
|
-
})(filter || (filter = {}));
|
|
264
|
-
function _toSingle(fn) {
|
|
265
|
-
return Object.assign(fn, { single: true });
|
|
266
|
-
}
|
|
267
|
-
function findIndex(...args) {
|
|
268
|
-
return purry(findIndex_(false), args, findIndex.lazy);
|
|
269
|
-
}
|
|
270
|
-
function findIndex_(indexed) {
|
|
271
|
-
return (array, fn) => array.findIndex((item, index, input) => indexed ? fn(item, index, input) : fn(item));
|
|
272
|
-
}
|
|
273
|
-
function lazy_$4(indexed) {
|
|
274
|
-
return (fn) => {
|
|
275
|
-
let actualIndex = 0;
|
|
276
|
-
return (value, index, array) => {
|
|
277
|
-
if (indexed ? fn(value, index, array) : fn(value)) {
|
|
278
|
-
return { done: true, hasNext: true, next: actualIndex };
|
|
279
|
-
}
|
|
280
|
-
actualIndex += 1;
|
|
281
|
-
return { done: false, hasNext: false };
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
((findIndex2) => {
|
|
286
|
-
function indexed(...args) {
|
|
287
|
-
return purry(findIndex_(true), args, findIndex2.lazyIndexed);
|
|
288
|
-
}
|
|
289
|
-
findIndex2.indexed = indexed;
|
|
290
|
-
findIndex2.lazy = _toSingle(lazy_$4(false));
|
|
291
|
-
findIndex2.lazyIndexed = _toSingle(_toLazyIndexed(lazy_$4(true)));
|
|
292
|
-
})(findIndex || (findIndex = {}));
|
|
293
|
-
function findLastIndex(...args) {
|
|
294
|
-
return purry(findLastIndex_(false), args);
|
|
295
|
-
}
|
|
296
|
-
function findLastIndex_(indexed) {
|
|
297
|
-
return (array, fn) => {
|
|
298
|
-
for (let i = array.length - 1; i >= 0; i--) {
|
|
299
|
-
if (indexed ? fn(array[i], i, array) : fn(array[i])) {
|
|
300
|
-
return i;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return -1;
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
((findLastIndex2) => {
|
|
307
|
-
function indexed(...args) {
|
|
308
|
-
return purry(findLastIndex_(true), args);
|
|
309
|
-
}
|
|
310
|
-
findLastIndex2.indexed = indexed;
|
|
311
|
-
})(findLastIndex || (findLastIndex = {}));
|
|
312
|
-
function findLast(...args) {
|
|
313
|
-
return purry(findLast_(false), args);
|
|
314
|
-
}
|
|
315
|
-
function findLast_(indexed) {
|
|
316
|
-
return (array, fn) => {
|
|
317
|
-
for (let i = array.length - 1; i >= 0; i--) {
|
|
318
|
-
if (indexed ? fn(array[i], i, array) : fn(array[i])) {
|
|
319
|
-
return array[i];
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
return void 0;
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
((findLast2) => {
|
|
326
|
-
function indexed(...args) {
|
|
327
|
-
return purry(findLast_(true), args);
|
|
328
|
-
}
|
|
329
|
-
findLast2.indexed = indexed;
|
|
330
|
-
})(findLast || (findLast = {}));
|
|
331
|
-
function find(...args) {
|
|
332
|
-
return purry(find_(false), args, find.lazy);
|
|
333
|
-
}
|
|
334
|
-
function find_(indexed) {
|
|
335
|
-
return (array, fn) => array.find((item, index, input) => indexed ? fn(item, index, input) : fn(item));
|
|
336
|
-
}
|
|
337
|
-
function lazy_$3(indexed) {
|
|
338
|
-
return (fn) => (value, index, array) => (indexed ? fn(value, index, array) : fn(value)) ? { done: true, hasNext: true, next: value } : { done: false, hasNext: false };
|
|
339
|
-
}
|
|
340
|
-
((find2) => {
|
|
341
|
-
function indexed(...args) {
|
|
342
|
-
return purry(find_(true), args, find2.lazyIndexed);
|
|
343
|
-
}
|
|
344
|
-
find2.indexed = indexed;
|
|
345
|
-
find2.lazy = _toSingle(lazy_$3(false));
|
|
346
|
-
find2.lazyIndexed = _toSingle(_toLazyIndexed(lazy_$3(true)));
|
|
347
|
-
})(find || (find = {}));
|
|
348
|
-
function first(...args) {
|
|
349
|
-
return purry(first_, args, first.lazy);
|
|
350
|
-
}
|
|
351
|
-
function first_([item]) {
|
|
352
|
-
return item;
|
|
353
|
-
}
|
|
354
|
-
((first2) => {
|
|
355
|
-
function lazy() {
|
|
356
|
-
return (value) => ({ done: true, hasNext: true, next: value });
|
|
357
|
-
}
|
|
358
|
-
first2.lazy = lazy;
|
|
359
|
-
((lazy2) => {
|
|
360
|
-
lazy2.single = true;
|
|
361
|
-
})(lazy = first2.lazy || (first2.lazy = {}));
|
|
362
|
-
})(first || (first = {}));
|
|
363
|
-
function flatten(...args) {
|
|
364
|
-
return purry(flatten_, args, flatten.lazy);
|
|
365
|
-
}
|
|
366
|
-
function flatten_(items) {
|
|
367
|
-
return _reduceLazy(items, flatten.lazy());
|
|
368
|
-
}
|
|
369
|
-
((flatten2) => {
|
|
370
|
-
function lazy() {
|
|
371
|
-
return (item) => (
|
|
372
|
-
// @ts-expect-error [ts2322] - We need to make LazyMany better so it accommodate the typing here...
|
|
373
|
-
Array.isArray(item) ? { done: false, hasMany: true, hasNext: true, next: item } : { done: false, hasNext: true, next: item }
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
flatten2.lazy = lazy;
|
|
377
|
-
})(flatten || (flatten = {}));
|
|
378
|
-
function flatMap(...args) {
|
|
379
|
-
return purry(flatMap_, args, flatMap.lazy);
|
|
380
|
-
}
|
|
381
|
-
function flatMap_(array, fn) {
|
|
382
|
-
return flatten(array.map((item) => fn(item)));
|
|
383
|
-
}
|
|
384
|
-
((flatMap2) => {
|
|
385
|
-
function lazy(fn) {
|
|
386
|
-
return (value) => {
|
|
387
|
-
const next = fn(value);
|
|
388
|
-
return Array.isArray(next) ? { done: false, hasMany: true, hasNext: true, next } : { done: false, hasNext: true, next };
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
flatMap2.lazy = lazy;
|
|
392
|
-
})(flatMap || (flatMap = {}));
|
|
393
|
-
function flattenDeep(...args) {
|
|
394
|
-
return purry(flattenDeep_, args, flattenDeep.lazy);
|
|
395
|
-
}
|
|
396
|
-
function flattenDeep_(items) {
|
|
397
|
-
return _reduceLazy(items, flattenDeep.lazy());
|
|
398
|
-
}
|
|
399
|
-
function flattenDeepValue_(value) {
|
|
400
|
-
if (!Array.isArray(value)) {
|
|
401
|
-
return value;
|
|
402
|
-
}
|
|
403
|
-
const ret = [];
|
|
404
|
-
for (const item of value) {
|
|
405
|
-
if (Array.isArray(item)) {
|
|
406
|
-
ret.push(...flattenDeep(item));
|
|
407
|
-
} else {
|
|
408
|
-
ret.push(item);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return ret;
|
|
412
|
-
}
|
|
413
|
-
((flattenDeep2) => {
|
|
414
|
-
function lazy() {
|
|
415
|
-
return (value) => {
|
|
416
|
-
const next = flattenDeepValue_(value);
|
|
417
|
-
return Array.isArray(next) ? { done: false, hasMany: true, hasNext: true, next } : { done: false, hasNext: true, next };
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
flattenDeep2.lazy = lazy;
|
|
421
|
-
})(flattenDeep || (flattenDeep = {}));
|
|
422
|
-
function forEachObj(...args) {
|
|
423
|
-
return purry(forEachObj_(false), args);
|
|
424
|
-
}
|
|
425
|
-
function forEachObj_(indexed) {
|
|
426
|
-
return (data, fn) => {
|
|
427
|
-
for (const key in data) {
|
|
428
|
-
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
429
|
-
const { [key]: val } = data;
|
|
430
|
-
if (indexed) {
|
|
431
|
-
fn(val, key, data);
|
|
432
|
-
} else {
|
|
433
|
-
fn(val);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
return data;
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
((forEachObj2) => {
|
|
441
|
-
function indexed(...args) {
|
|
442
|
-
return purry(forEachObj_(true), args);
|
|
443
|
-
}
|
|
444
|
-
forEachObj2.indexed = indexed;
|
|
445
|
-
})(forEachObj || (forEachObj = {}));
|
|
446
|
-
function forEach(...args) {
|
|
447
|
-
return purry(forEach_(false), args, forEach.lazy);
|
|
448
|
-
}
|
|
449
|
-
function forEach_(indexed) {
|
|
450
|
-
return (array, fn) => _reduceLazy(
|
|
451
|
-
array,
|
|
452
|
-
indexed ? forEach.lazyIndexed(fn) : forEach.lazy(fn),
|
|
453
|
-
indexed
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
function lazy_$2(indexed) {
|
|
457
|
-
return (fn) => (value, index, array) => {
|
|
458
|
-
if (indexed) {
|
|
459
|
-
fn(value, index, array);
|
|
460
|
-
} else {
|
|
461
|
-
fn(value);
|
|
462
|
-
}
|
|
463
|
-
return {
|
|
464
|
-
done: false,
|
|
465
|
-
hasNext: true,
|
|
466
|
-
next: value
|
|
467
|
-
};
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
((forEach2) => {
|
|
471
|
-
function indexed(...args) {
|
|
472
|
-
return purry(forEach_(true), args, forEach2.lazyIndexed);
|
|
473
|
-
}
|
|
474
|
-
forEach2.indexed = indexed;
|
|
475
|
-
forEach2.lazy = lazy_$2(false);
|
|
476
|
-
forEach2.lazyIndexed = _toLazyIndexed(lazy_$2(true));
|
|
477
|
-
})(forEach || (forEach = {}));
|
|
478
|
-
function fromEntries(...args) {
|
|
479
|
-
return purry(fromEntriesImplementation, args);
|
|
480
|
-
}
|
|
481
|
-
function fromEntriesImplementation(entries2) {
|
|
482
|
-
const out = {};
|
|
483
|
-
for (const [key, value] of entries2) {
|
|
484
|
-
out[key] = value;
|
|
485
|
-
}
|
|
486
|
-
return out;
|
|
487
|
-
}
|
|
488
|
-
((fromEntries2) => {
|
|
489
|
-
fromEntries2.strict = fromEntries2;
|
|
490
|
-
})(fromEntries || (fromEntries = {}));
|
|
491
|
-
function groupBy(...args) {
|
|
492
|
-
return purry(groupBy_(false), args);
|
|
493
|
-
}
|
|
494
|
-
function groupBy_(indexed) {
|
|
495
|
-
return (array, fn) => {
|
|
496
|
-
const ret = {};
|
|
497
|
-
for (const [index, item] of array.entries()) {
|
|
498
|
-
const key = indexed ? fn(item, index, array) : fn(item);
|
|
499
|
-
if (key !== void 0) {
|
|
500
|
-
const actualKey = String(key);
|
|
501
|
-
let items = ret[actualKey];
|
|
502
|
-
if (items === void 0) {
|
|
503
|
-
items = [];
|
|
504
|
-
ret[actualKey] = items;
|
|
505
|
-
}
|
|
506
|
-
items.push(item);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
return ret;
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
((groupBy2) => {
|
|
513
|
-
function indexed(...args) {
|
|
514
|
-
return purry(groupBy_(true), args);
|
|
515
|
-
}
|
|
516
|
-
groupBy2.indexed = indexed;
|
|
517
|
-
groupBy2.strict = groupBy2;
|
|
518
|
-
})(groupBy || (groupBy = {}));
|
|
519
|
-
function indexBy(...args) {
|
|
520
|
-
return purry(indexBy_(false), args);
|
|
521
|
-
}
|
|
522
|
-
function indexBy_(indexed) {
|
|
523
|
-
return (array, fn) => {
|
|
524
|
-
const out = {};
|
|
525
|
-
for (const [index, item] of array.entries()) {
|
|
526
|
-
const value = indexed ? fn(item, index, array) : fn(item);
|
|
527
|
-
const key = String(value);
|
|
528
|
-
out[key] = item;
|
|
529
|
-
}
|
|
530
|
-
return out;
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
function indexByStrict(...args) {
|
|
534
|
-
return purry(indexByStrict_, args);
|
|
535
|
-
}
|
|
536
|
-
function indexByStrict_(array, fn) {
|
|
537
|
-
const out = {};
|
|
538
|
-
for (const item of array) {
|
|
539
|
-
const key = fn(item);
|
|
540
|
-
out[key] = item;
|
|
541
|
-
}
|
|
542
|
-
return out;
|
|
543
|
-
}
|
|
544
|
-
((indexBy2) => {
|
|
545
|
-
function indexed(...args) {
|
|
546
|
-
return purry(indexBy_(true), args);
|
|
547
|
-
}
|
|
548
|
-
indexBy2.indexed = indexed;
|
|
549
|
-
indexBy2.strict = indexByStrict;
|
|
550
|
-
})(indexBy || (indexBy = {}));
|
|
551
|
-
function intersectionWith(...args) {
|
|
552
|
-
return purry(intersectionWith_, args, intersectionWith.lazy);
|
|
553
|
-
}
|
|
554
|
-
function intersectionWith_(array, other, comparator) {
|
|
555
|
-
const lazy = intersectionWith.lazy(other, comparator);
|
|
556
|
-
return _reduceLazy(array, lazy);
|
|
557
|
-
}
|
|
558
|
-
((intersectionWith2) => {
|
|
559
|
-
function lazy(other, comparator) {
|
|
560
|
-
return (value) => other.some((otherValue) => comparator(value, otherValue)) ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
|
|
561
|
-
}
|
|
562
|
-
intersectionWith2.lazy = lazy;
|
|
563
|
-
})(intersectionWith || (intersectionWith = {}));
|
|
564
|
-
function isBoolean(data) {
|
|
565
|
-
return typeof data === "boolean";
|
|
566
|
-
}
|
|
567
|
-
function isDefined(data) {
|
|
568
|
-
return data !== void 0 && data !== null;
|
|
569
|
-
}
|
|
570
|
-
((isDefined2) => {
|
|
571
|
-
function strict(data) {
|
|
572
|
-
return data !== void 0;
|
|
573
|
-
}
|
|
574
|
-
isDefined2.strict = strict;
|
|
575
|
-
})(isDefined || (isDefined = {}));
|
|
576
|
-
function isObject(data) {
|
|
577
|
-
if (typeof data !== "object" || data === null) {
|
|
578
|
-
return false;
|
|
579
|
-
}
|
|
580
|
-
const proto = Object.getPrototypeOf(data);
|
|
581
|
-
return proto === null || proto === Object.prototype;
|
|
582
|
-
}
|
|
583
|
-
function keys(...args) {
|
|
584
|
-
return purry(Object.keys, args);
|
|
585
|
-
}
|
|
586
|
-
((keys2) => {
|
|
587
|
-
keys2.strict = keys2;
|
|
588
|
-
})(keys || (keys = {}));
|
|
589
|
-
function mapToObj(...args) {
|
|
590
|
-
return purry(mapToObj_(false), args);
|
|
591
|
-
}
|
|
592
|
-
function mapToObj_(indexed) {
|
|
593
|
-
return (array, fn) => {
|
|
594
|
-
const out = {};
|
|
595
|
-
for (const [index, element] of array.entries()) {
|
|
596
|
-
const [key, value] = indexed ? fn(element, index, array) : fn(element);
|
|
597
|
-
out[key] = value;
|
|
598
|
-
}
|
|
599
|
-
return out;
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
((mapToObj2) => {
|
|
603
|
-
function indexed(...args) {
|
|
604
|
-
return purry(mapToObj_(true), args);
|
|
605
|
-
}
|
|
606
|
-
mapToObj2.indexed = indexed;
|
|
607
|
-
})(mapToObj || (mapToObj = {}));
|
|
608
|
-
function map(...args) {
|
|
609
|
-
return purry(map_(false), args, map.lazy);
|
|
610
|
-
}
|
|
611
|
-
function map_(indexed) {
|
|
612
|
-
return (array, fn) => {
|
|
613
|
-
return _reduceLazy(
|
|
614
|
-
array,
|
|
615
|
-
indexed ? map.lazyIndexed(fn) : map.lazy(fn),
|
|
616
|
-
indexed
|
|
617
|
-
);
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
function lazy_$1(indexed) {
|
|
621
|
-
return (fn) => (value, index, array) => ({
|
|
622
|
-
done: false,
|
|
623
|
-
hasNext: true,
|
|
624
|
-
next: indexed ? fn(value, index, array) : fn(value)
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
((map2) => {
|
|
628
|
-
function indexed(...args) {
|
|
629
|
-
return purry(map_(true), args, map2.lazyIndexed);
|
|
630
|
-
}
|
|
631
|
-
map2.indexed = indexed;
|
|
632
|
-
map2.lazy = lazy_$1(false);
|
|
633
|
-
map2.lazyIndexed = _toLazyIndexed(lazy_$1(true));
|
|
634
|
-
map2.strict = map2;
|
|
635
|
-
})(map || (map = {}));
|
|
636
|
-
function meanBy_(indexed) {
|
|
637
|
-
return (array, fn) => {
|
|
638
|
-
if (array.length === 0) {
|
|
639
|
-
return Number.NaN;
|
|
640
|
-
}
|
|
641
|
-
let sum = 0;
|
|
642
|
-
for (const [index, item] of array.entries()) {
|
|
643
|
-
sum += indexed ? fn(item, index, array) : fn(item);
|
|
644
|
-
}
|
|
645
|
-
return sum / array.length;
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
function meanBy(...args) {
|
|
649
|
-
return purry(meanBy_(false), args);
|
|
650
|
-
}
|
|
651
|
-
((meanBy2) => {
|
|
652
|
-
function indexed(...args) {
|
|
653
|
-
return purry(meanBy_(true), args);
|
|
654
|
-
}
|
|
655
|
-
meanBy2.indexed = indexed;
|
|
656
|
-
})(meanBy || (meanBy = {}));
|
|
657
|
-
function partition(...args) {
|
|
658
|
-
return purry(partition_(false), args);
|
|
659
|
-
}
|
|
660
|
-
function partition_(indexed) {
|
|
661
|
-
return (array, fn) => {
|
|
662
|
-
const ret = [[], []];
|
|
663
|
-
for (const [index, item] of array.entries()) {
|
|
664
|
-
const matches = indexed ? fn(item, index, array) : fn(item);
|
|
665
|
-
ret[matches ? 0 : 1].push(item);
|
|
666
|
-
}
|
|
667
|
-
return ret;
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
((partition2) => {
|
|
671
|
-
function indexed(...args) {
|
|
672
|
-
return purry(partition_(true), args);
|
|
673
|
-
}
|
|
674
|
-
partition2.indexed = indexed;
|
|
675
|
-
})(partition || (partition = {}));
|
|
676
|
-
function reduce(...args) {
|
|
677
|
-
return purry(reduce_(false), args);
|
|
678
|
-
}
|
|
679
|
-
function reduce_(indexed) {
|
|
680
|
-
return (items, fn, initialValue) => {
|
|
681
|
-
return items.reduce(
|
|
682
|
-
(acc, item, index) => indexed ? fn(acc, item, index, items) : fn(acc, item),
|
|
683
|
-
initialValue
|
|
684
|
-
);
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
((reduce2) => {
|
|
688
|
-
function indexed(...args) {
|
|
689
|
-
return purry(reduce_(true), args);
|
|
690
|
-
}
|
|
691
|
-
reduce2.indexed = indexed;
|
|
692
|
-
})(reduce || (reduce = {}));
|
|
693
|
-
function sortBy(...args) {
|
|
694
|
-
return purryOrderRules(_sortBy, args);
|
|
695
|
-
}
|
|
696
|
-
function _sortBy(data, compareFn) {
|
|
697
|
-
return data.slice().sort(compareFn);
|
|
698
|
-
}
|
|
699
|
-
((sortBy2) => {
|
|
700
|
-
sortBy2.strict = sortBy2;
|
|
701
|
-
})(sortBy || (sortBy = {}));
|
|
702
|
-
function sort(...args) {
|
|
703
|
-
return purry(sort_, args);
|
|
704
|
-
}
|
|
705
|
-
function sort_(items, cmp) {
|
|
706
|
-
const ret = items.slice();
|
|
707
|
-
ret.sort(cmp);
|
|
708
|
-
return ret;
|
|
709
|
-
}
|
|
710
|
-
((sort2) => {
|
|
711
|
-
sort2.strict = sort2;
|
|
712
|
-
})(sort || (sort = {}));
|
|
713
|
-
function _binarySearchCutoffIndex(array, predicate) {
|
|
714
|
-
let lowIndex = 0;
|
|
715
|
-
let highIndex = array.length;
|
|
716
|
-
while (lowIndex < highIndex) {
|
|
717
|
-
const pivotIndex = lowIndex + highIndex >>> 1;
|
|
718
|
-
const pivot = array[pivotIndex];
|
|
719
|
-
if (predicate(pivot, pivotIndex)) {
|
|
720
|
-
lowIndex = pivotIndex + 1;
|
|
721
|
-
} else {
|
|
722
|
-
highIndex = pivotIndex;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
return highIndex;
|
|
726
|
-
}
|
|
727
|
-
function sortedIndexBy(...args) {
|
|
728
|
-
return purry(sortedIndexByImplementation, args);
|
|
729
|
-
}
|
|
730
|
-
((sortedIndexBy2) => {
|
|
731
|
-
function indexed(...args) {
|
|
732
|
-
return purry(sortedIndexByImplementation, args);
|
|
733
|
-
}
|
|
734
|
-
sortedIndexBy2.indexed = indexed;
|
|
735
|
-
})(sortedIndexBy || (sortedIndexBy = {}));
|
|
736
|
-
function sortedIndexByImplementation(array, item, valueFunction) {
|
|
737
|
-
const value = valueFunction(item);
|
|
738
|
-
return _binarySearchCutoffIndex(
|
|
739
|
-
array,
|
|
740
|
-
(pivot, index) => valueFunction(pivot, index) < value
|
|
741
|
-
);
|
|
742
|
-
}
|
|
743
|
-
function sortedIndexWith(...args) {
|
|
744
|
-
return purry(_binarySearchCutoffIndex, args);
|
|
745
|
-
}
|
|
746
|
-
((sortedIndexWith2) => {
|
|
747
|
-
function indexed(...args) {
|
|
748
|
-
return purry(_binarySearchCutoffIndex, args);
|
|
749
|
-
}
|
|
750
|
-
sortedIndexWith2.indexed = indexed;
|
|
751
|
-
})(sortedIndexWith || (sortedIndexWith = {}));
|
|
752
|
-
function sortedLastIndexBy(...args) {
|
|
753
|
-
return purry(sortedLastIndexByImplementation, args);
|
|
754
|
-
}
|
|
755
|
-
((sortedLastIndexBy2) => {
|
|
756
|
-
function indexed(...args) {
|
|
757
|
-
return purry(sortedLastIndexByImplementation, args);
|
|
758
|
-
}
|
|
759
|
-
sortedLastIndexBy2.indexed = indexed;
|
|
760
|
-
})(sortedLastIndexBy || (sortedLastIndexBy = {}));
|
|
761
|
-
function sortedLastIndexByImplementation(array, item, valueFunction) {
|
|
762
|
-
const value = valueFunction(item);
|
|
763
|
-
return _binarySearchCutoffIndex(
|
|
764
|
-
array,
|
|
765
|
-
// The only difference between the regular implementation and the "last"
|
|
766
|
-
// variation is that we consider the pivot with equality too, so that we
|
|
767
|
-
// skip all equal values in addition to the lower ones.
|
|
768
|
-
(pivot, index) => valueFunction(pivot, index) <= value
|
|
769
|
-
);
|
|
770
|
-
}
|
|
771
|
-
function sumBy_(indexed) {
|
|
772
|
-
return (array, fn) => {
|
|
773
|
-
let sum = 0;
|
|
774
|
-
for (const [index, item] of array.entries()) {
|
|
775
|
-
const summand = indexed ? fn(item, index, array) : fn(item);
|
|
776
|
-
sum += summand;
|
|
777
|
-
}
|
|
778
|
-
return sum;
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
function sumBy(...args) {
|
|
782
|
-
return purry(sumBy_(false), args);
|
|
783
|
-
}
|
|
784
|
-
((sumBy2) => {
|
|
785
|
-
function indexed(...args) {
|
|
786
|
-
return purry(sumBy_(true), args);
|
|
787
|
-
}
|
|
788
|
-
sumBy2.indexed = indexed;
|
|
789
|
-
})(sumBy || (sumBy = {}));
|
|
790
|
-
function take(...args) {
|
|
791
|
-
return purry(take_, args, take.lazy);
|
|
792
|
-
}
|
|
793
|
-
function take_(array, n) {
|
|
794
|
-
return _reduceLazy(array, take.lazy(n));
|
|
795
|
-
}
|
|
796
|
-
((take2) => {
|
|
797
|
-
function lazy(n) {
|
|
798
|
-
if (n <= 0) {
|
|
799
|
-
return () => ({ done: true, hasNext: false });
|
|
800
|
-
}
|
|
801
|
-
let remaining = n;
|
|
802
|
-
return (value) => {
|
|
803
|
-
remaining -= 1;
|
|
804
|
-
return { done: remaining <= 0, hasNext: true, next: value };
|
|
805
|
-
};
|
|
806
|
-
}
|
|
807
|
-
take2.lazy = lazy;
|
|
808
|
-
})(take || (take = {}));
|
|
809
|
-
function uniqueWith(...args) {
|
|
810
|
-
return purry(uniqueWithImplementation, args, uniqueWith.lazy);
|
|
811
|
-
}
|
|
812
|
-
function uniqueWithImplementation(array, isEquals) {
|
|
813
|
-
const lazy = uniqueWith.lazy(isEquals);
|
|
814
|
-
return _reduceLazy(array, lazy, true);
|
|
815
|
-
}
|
|
816
|
-
function lazy_(isEquals) {
|
|
817
|
-
return (value, index, array) => array !== void 0 && array.findIndex((otherValue) => isEquals(value, otherValue)) === index ? { done: false, hasNext: true, next: value } : { done: false, hasNext: false };
|
|
818
|
-
}
|
|
819
|
-
((uniqueWith2) => {
|
|
820
|
-
uniqueWith2.lazy = _toLazyIndexed(lazy_);
|
|
821
|
-
})(uniqueWith || (uniqueWith = {}));
|
|
822
|
-
function unique(...args) {
|
|
823
|
-
return purry(uniqueImplementation, args, unique.lazy);
|
|
824
|
-
}
|
|
825
|
-
function uniqueImplementation(array) {
|
|
826
|
-
return _reduceLazy(array, unique.lazy());
|
|
827
|
-
}
|
|
828
|
-
((unique2) => {
|
|
829
|
-
function lazy() {
|
|
830
|
-
const set = /* @__PURE__ */ new Set();
|
|
831
|
-
return (value) => {
|
|
832
|
-
if (set.has(value)) {
|
|
833
|
-
return { done: false, hasNext: false };
|
|
834
|
-
}
|
|
835
|
-
set.add(value);
|
|
836
|
-
return { done: false, hasNext: true, next: value };
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
unique2.lazy = lazy;
|
|
840
|
-
})(unique || (unique = {}));
|
|
841
|
-
function zip(...args) {
|
|
842
|
-
return purry(zip_, args);
|
|
843
|
-
}
|
|
844
|
-
function zip_(first2, second) {
|
|
845
|
-
const resultLength = first2.length > second.length ? second.length : first2.length;
|
|
846
|
-
const result = [];
|
|
847
|
-
for (let i = 0; i < resultLength; i++) {
|
|
848
|
-
result.push([first2[i], second[i]]);
|
|
849
|
-
}
|
|
850
|
-
return result;
|
|
105
|
+
|
|
106
|
+
// ../node_modules/.pnpm/@vinicunca+perkakas@1.0.2/node_modules/@vinicunca/perkakas/dist/chunk-AZUJCNUP.js
|
|
107
|
+
function e(o) {
|
|
108
|
+
return typeof o == "boolean";
|
|
851
109
|
}
|
|
852
|
-
((zip2) => {
|
|
853
|
-
zip2.strict = zip2;
|
|
854
|
-
})(zip || (zip = {}));
|
|
855
110
|
|
|
856
111
|
// src/base.ts
|
|
857
112
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
@@ -956,6 +211,8 @@ var GLOB_EXCLUDE = [
|
|
|
956
211
|
"**/.cache",
|
|
957
212
|
"**/.output",
|
|
958
213
|
"**/.vite-inspect",
|
|
214
|
+
"**/.yarn",
|
|
215
|
+
"**/vite.config.*.timestamp-*",
|
|
959
216
|
"**/CHANGELOG*.md",
|
|
960
217
|
"**/*.min.*",
|
|
961
218
|
"**/LICENSE*",
|
|
@@ -969,10 +226,10 @@ async function combineConfigs(...configs2) {
|
|
|
969
226
|
const resolved = await Promise.all(configs2);
|
|
970
227
|
return resolved.flat();
|
|
971
228
|
}
|
|
972
|
-
function renameRules(rules,
|
|
229
|
+
function renameRules(rules, map) {
|
|
973
230
|
return Object.fromEntries(
|
|
974
231
|
Object.entries(rules).map(([key, value]) => {
|
|
975
|
-
for (const [from, to] of Object.entries(
|
|
232
|
+
for (const [from, to] of Object.entries(map)) {
|
|
976
233
|
if (key.startsWith(`${from}/`)) {
|
|
977
234
|
return [to + key.slice(from.length), value];
|
|
978
235
|
}
|
|
@@ -981,17 +238,17 @@ function renameRules(rules, map2) {
|
|
|
981
238
|
})
|
|
982
239
|
);
|
|
983
240
|
}
|
|
984
|
-
function renamePluginInConfigs(configs2,
|
|
241
|
+
function renamePluginInConfigs(configs2, map) {
|
|
985
242
|
return configs2.map((i) => {
|
|
986
243
|
const clone = { ...i };
|
|
987
244
|
if (clone.rules) {
|
|
988
|
-
clone.rules = renameRules(clone.rules,
|
|
245
|
+
clone.rules = renameRules(clone.rules, map);
|
|
989
246
|
}
|
|
990
247
|
if (clone.plugins) {
|
|
991
248
|
clone.plugins = Object.fromEntries(
|
|
992
249
|
Object.entries(clone.plugins).map(([key, value]) => {
|
|
993
|
-
if (key in
|
|
994
|
-
return [
|
|
250
|
+
if (key in map) {
|
|
251
|
+
return [map[key], value];
|
|
995
252
|
}
|
|
996
253
|
return [key, value];
|
|
997
254
|
})
|
|
@@ -1039,7 +296,7 @@ var STYLISTIC_CONFIG_DEFAULTS = {
|
|
|
1039
296
|
async function stylistic(options = {}) {
|
|
1040
297
|
const {
|
|
1041
298
|
indent,
|
|
1042
|
-
jsx,
|
|
299
|
+
jsx: jsx2,
|
|
1043
300
|
overrides = {},
|
|
1044
301
|
quotes,
|
|
1045
302
|
semi
|
|
@@ -1051,7 +308,7 @@ async function stylistic(options = {}) {
|
|
|
1051
308
|
const config = pluginStylistic.configs.customize({
|
|
1052
309
|
flat: true,
|
|
1053
310
|
indent,
|
|
1054
|
-
jsx,
|
|
311
|
+
jsx: jsx2,
|
|
1055
312
|
pluginName: "style",
|
|
1056
313
|
quotes,
|
|
1057
314
|
semi
|
|
@@ -1065,6 +322,8 @@ async function stylistic(options = {}) {
|
|
|
1065
322
|
},
|
|
1066
323
|
rules: {
|
|
1067
324
|
...config.rules,
|
|
325
|
+
"antfu/consistent-list-newline": "error",
|
|
326
|
+
"antfu/top-level-function": "error",
|
|
1068
327
|
"curly": [ERROR, "all"],
|
|
1069
328
|
"style/array-bracket-newline": [ERROR, CONSISTENT],
|
|
1070
329
|
"style/array-bracket-spacing": [ERROR, NEVER],
|
|
@@ -1358,6 +617,9 @@ async function javascript(options = {}) {
|
|
|
1358
617
|
linterOptions: {
|
|
1359
618
|
reportUnusedDisableDirectives: true
|
|
1360
619
|
},
|
|
620
|
+
name: "vinicunca/javascript/setup"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
1361
623
|
name: "vinicunca/javascript/rules",
|
|
1362
624
|
plugins: {
|
|
1363
625
|
"antfu": import_eslint_plugin_antfu.default,
|
|
@@ -1643,7 +905,7 @@ async function jsonc(options = {}) {
|
|
|
1643
905
|
} = options;
|
|
1644
906
|
const {
|
|
1645
907
|
indent = 2
|
|
1646
|
-
} =
|
|
908
|
+
} = e(stylistic2) ? {} : stylistic2;
|
|
1647
909
|
const [
|
|
1648
910
|
pluginJsonc,
|
|
1649
911
|
parserJsonc
|
|
@@ -1709,6 +971,23 @@ async function jsonc(options = {}) {
|
|
|
1709
971
|
];
|
|
1710
972
|
}
|
|
1711
973
|
|
|
974
|
+
// src/configs/jsx.ts
|
|
975
|
+
async function jsx() {
|
|
976
|
+
return [
|
|
977
|
+
{
|
|
978
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
979
|
+
languageOptions: {
|
|
980
|
+
parserOptions: {
|
|
981
|
+
ecmaFeatures: {
|
|
982
|
+
jsx: true
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
},
|
|
986
|
+
name: "vinicunca/jsx/setup"
|
|
987
|
+
}
|
|
988
|
+
];
|
|
989
|
+
}
|
|
990
|
+
|
|
1712
991
|
// src/configs/markdown.ts
|
|
1713
992
|
var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
1714
993
|
async function markdown(options = {}) {
|
|
@@ -1779,25 +1058,6 @@ async function markdown(options = {}) {
|
|
|
1779
1058
|
"unicode-bom": OFF,
|
|
1780
1059
|
"unused-imports/no-unused-imports": OFF,
|
|
1781
1060
|
"unused-imports/no-unused-vars": OFF,
|
|
1782
|
-
// Type aware rules
|
|
1783
|
-
...{
|
|
1784
|
-
"ts/await-thenable": OFF,
|
|
1785
|
-
"ts/dot-notation": OFF,
|
|
1786
|
-
"ts/no-floating-promises": OFF,
|
|
1787
|
-
"ts/no-for-in-array": OFF,
|
|
1788
|
-
"ts/no-implied-eval": OFF,
|
|
1789
|
-
"ts/no-misused-promises": OFF,
|
|
1790
|
-
"ts/no-throw-literal": OFF,
|
|
1791
|
-
"ts/no-unnecessary-type-assertion": OFF,
|
|
1792
|
-
"ts/no-unsafe-argument": OFF,
|
|
1793
|
-
"ts/no-unsafe-assignment": OFF,
|
|
1794
|
-
"ts/no-unsafe-call": OFF,
|
|
1795
|
-
"ts/no-unsafe-member-access": OFF,
|
|
1796
|
-
"ts/no-unsafe-return": OFF,
|
|
1797
|
-
"ts/restrict-plus-operands": OFF,
|
|
1798
|
-
"ts/restrict-template-expressions": OFF,
|
|
1799
|
-
"ts/unbound-method": OFF
|
|
1800
|
-
},
|
|
1801
1061
|
...overrides
|
|
1802
1062
|
}
|
|
1803
1063
|
}
|
|
@@ -1868,7 +1128,7 @@ async function perfectionist() {
|
|
|
1868
1128
|
// src/configs/react.ts
|
|
1869
1129
|
async function react(options = {}) {
|
|
1870
1130
|
const {
|
|
1871
|
-
files = [
|
|
1131
|
+
files = [GLOB_SRC],
|
|
1872
1132
|
overrides = {}
|
|
1873
1133
|
} = options;
|
|
1874
1134
|
const [
|
|
@@ -2004,6 +1264,7 @@ async function sortPackageJson() {
|
|
|
2004
1264
|
"packageManager",
|
|
2005
1265
|
"description",
|
|
2006
1266
|
"author",
|
|
1267
|
+
"contributors",
|
|
2007
1268
|
"license",
|
|
2008
1269
|
"funding",
|
|
2009
1270
|
"homepage",
|
|
@@ -2269,12 +1530,14 @@ async function typescript(options = {}) {
|
|
|
2269
1530
|
...componentExts.map((ext) => `**/*.${ext}`)
|
|
2270
1531
|
];
|
|
2271
1532
|
const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
|
|
1533
|
+
const ignoresTypeAware = options.ignoresTypeAware ?? [
|
|
1534
|
+
`${GLOB_MARKDOWN}/**`
|
|
1535
|
+
];
|
|
2272
1536
|
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
2273
1537
|
const isTypeAware = !!tsconfigPath;
|
|
2274
1538
|
const typeAwareRules = {
|
|
2275
1539
|
"dot-notation": OFF,
|
|
2276
1540
|
"no-implied-eval": OFF,
|
|
2277
|
-
"no-throw-literal": OFF,
|
|
2278
1541
|
"ts/await-thenable": ERROR,
|
|
2279
1542
|
"ts/dot-notation": [ERROR, { allowKeywords: true }],
|
|
2280
1543
|
"ts/no-floating-promises": ERROR,
|
|
@@ -2282,16 +1545,18 @@ async function typescript(options = {}) {
|
|
|
2282
1545
|
"ts/no-implied-eval": ERROR,
|
|
2283
1546
|
// Temporary turning it off due to performance
|
|
2284
1547
|
"ts/no-misused-promises": OFF,
|
|
2285
|
-
"ts/no-throw-literal": ERROR,
|
|
2286
1548
|
"ts/no-unnecessary-type-assertion": ERROR,
|
|
2287
1549
|
"ts/no-unsafe-argument": ERROR,
|
|
2288
1550
|
"ts/no-unsafe-assignment": ERROR,
|
|
2289
1551
|
"ts/no-unsafe-call": ERROR,
|
|
2290
1552
|
"ts/no-unsafe-member-access": ERROR,
|
|
2291
1553
|
"ts/no-unsafe-return": ERROR,
|
|
1554
|
+
"ts/promise-function-async": "error",
|
|
2292
1555
|
"ts/restrict-plus-operands": ERROR,
|
|
2293
1556
|
"ts/restrict-template-expressions": ERROR,
|
|
2294
|
-
"ts/
|
|
1557
|
+
"ts/return-await": [ERROR, "in-try-catch"],
|
|
1558
|
+
"ts/strict-boolean-expressions": [ERROR, { allowNullableBoolean: true, allowNullableObject: true }],
|
|
1559
|
+
"ts/switch-exhaustiveness-check": ERROR,
|
|
2295
1560
|
"ts/unbound-method": ERROR
|
|
2296
1561
|
};
|
|
2297
1562
|
const [
|
|
@@ -2311,7 +1576,10 @@ async function typescript(options = {}) {
|
|
|
2311
1576
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
2312
1577
|
sourceType: "module",
|
|
2313
1578
|
...typeAware ? {
|
|
2314
|
-
|
|
1579
|
+
projectService: {
|
|
1580
|
+
allowDefaultProject: ["./*.js"],
|
|
1581
|
+
defaultProject: tsconfigPath
|
|
1582
|
+
},
|
|
2315
1583
|
tsconfigRootDir: import_node_process.default.cwd()
|
|
2316
1584
|
} : {},
|
|
2317
1585
|
...parserOptions
|
|
@@ -2331,9 +1599,11 @@ async function typescript(options = {}) {
|
|
|
2331
1599
|
},
|
|
2332
1600
|
// assign type-aware parser for type-aware files and type-unaware parser for the rest
|
|
2333
1601
|
...isTypeAware ? [
|
|
2334
|
-
makeParser({ files: filesTypeAware, typeAware: true }),
|
|
1602
|
+
makeParser({ files: filesTypeAware, ignores: ignoresTypeAware, typeAware: true }),
|
|
2335
1603
|
makeParser({ files, ignores: filesTypeAware, typeAware: false })
|
|
2336
|
-
] : [
|
|
1604
|
+
] : [
|
|
1605
|
+
makeParser({ files, typeAware: false })
|
|
1606
|
+
],
|
|
2337
1607
|
{
|
|
2338
1608
|
files,
|
|
2339
1609
|
name: "vinicunca/typescript/rules",
|
|
@@ -2355,7 +1625,6 @@ async function typescript(options = {}) {
|
|
|
2355
1625
|
"no-useless-constructor": OFF,
|
|
2356
1626
|
"ts/array-type": [ERROR, { default: "generic" }],
|
|
2357
1627
|
"ts/ban-ts-comment": [ERROR, { "ts-ignore": "allow-with-description" }],
|
|
2358
|
-
"ts/ban-types": [ERROR, { types: { Function: false } }],
|
|
2359
1628
|
"ts/consistent-type-definitions": [ERROR, "interface"],
|
|
2360
1629
|
"ts/consistent-type-imports": [ERROR, { disallowTypeAnnotations: false, prefer: "type-imports" }],
|
|
2361
1630
|
"ts/explicit-function-return-type": OFF,
|
|
@@ -2396,8 +1665,14 @@ async function typescript(options = {}) {
|
|
|
2396
1665
|
...overrides
|
|
2397
1666
|
}
|
|
2398
1667
|
},
|
|
1668
|
+
...isTypeAware ? [{
|
|
1669
|
+
files: filesTypeAware,
|
|
1670
|
+
ignores: ignoresTypeAware,
|
|
1671
|
+
name: "vinicunca/typescript/rules-type-aware",
|
|
1672
|
+
rules: typeAwareRules
|
|
1673
|
+
}] : [],
|
|
2399
1674
|
{
|
|
2400
|
-
files: ["**/*.d
|
|
1675
|
+
files: ["**/*.d.?([cm])ts"],
|
|
2401
1676
|
name: "vinicunca/typescript/disables/dts",
|
|
2402
1677
|
rules: {
|
|
2403
1678
|
"eslint-comments/no-unlimited-disable": OFF,
|
|
@@ -2492,7 +1767,7 @@ async function vue(options = {}) {
|
|
|
2492
1767
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
2493
1768
|
const {
|
|
2494
1769
|
indent = 2
|
|
2495
|
-
} =
|
|
1770
|
+
} = e(stylistic2) ? {} : stylistic2;
|
|
2496
1771
|
const [
|
|
2497
1772
|
pluginVue,
|
|
2498
1773
|
parserVue,
|
|
@@ -2643,7 +1918,7 @@ async function yaml(options = {}) {
|
|
|
2643
1918
|
const {
|
|
2644
1919
|
indent = 2,
|
|
2645
1920
|
quotes = "single"
|
|
2646
|
-
} =
|
|
1921
|
+
} = e(stylistic2) ? {} : stylistic2;
|
|
2647
1922
|
const [
|
|
2648
1923
|
pluginYaml,
|
|
2649
1924
|
parserYaml
|
|
@@ -2724,7 +1999,8 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2724
1999
|
autoRenamePlugins = true,
|
|
2725
2000
|
componentExts = [],
|
|
2726
2001
|
gitignore: enableGitignore = true,
|
|
2727
|
-
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),
|
|
2002
|
+
isInEditor = !!((import_node_process2.default.env.VSCODE_PID || import_node_process2.default.env.VSCODE_CWD || import_node_process2.default.env.JETBRAINS_IDE || import_node_process2.default.env.VIM || import_node_process2.default.env.NVIM) && !import_node_process2.default.env.CI),
|
|
2003
|
+
jsx: enableJsx = true,
|
|
2728
2004
|
react: enableReact = false,
|
|
2729
2005
|
regexp: enableRegexp = true,
|
|
2730
2006
|
typescript: enableTypeScript = (0, import_local_pkg.isPackageExists)("typescript"),
|
|
@@ -2734,19 +2010,22 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2734
2010
|
let stylisticOptions = {};
|
|
2735
2011
|
if (options.stylistic === false) {
|
|
2736
2012
|
stylisticOptions = false;
|
|
2737
|
-
} else if (
|
|
2013
|
+
} else if (r(options.stylistic)) {
|
|
2738
2014
|
stylisticOptions = {
|
|
2739
2015
|
...options.stylistic,
|
|
2740
2016
|
jsx: options.jsx ?? true
|
|
2741
2017
|
};
|
|
2742
2018
|
}
|
|
2019
|
+
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
2020
|
+
stylisticOptions.jsx = enableJsx;
|
|
2021
|
+
}
|
|
2743
2022
|
const configs2 = [];
|
|
2744
2023
|
if (enableGitignore) {
|
|
2745
2024
|
if (typeof enableGitignore !== "boolean") {
|
|
2746
|
-
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((
|
|
2025
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2(enableGitignore)]));
|
|
2747
2026
|
} else {
|
|
2748
2027
|
if (import_node_fs.default.existsSync(".gitignore")) {
|
|
2749
|
-
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((
|
|
2028
|
+
configs2.push(interopDefault(import("eslint-config-flat-gitignore")).then((r2) => [r2()]));
|
|
2750
2029
|
}
|
|
2751
2030
|
}
|
|
2752
2031
|
}
|
|
@@ -2771,6 +2050,9 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
|
|
|
2771
2050
|
if (enableVue) {
|
|
2772
2051
|
componentExts.push("vue");
|
|
2773
2052
|
}
|
|
2053
|
+
if (enableJsx) {
|
|
2054
|
+
configs2.push(jsx());
|
|
2055
|
+
}
|
|
2774
2056
|
if (enableTypeScript) {
|
|
2775
2057
|
configs2.push(typescript({
|
|
2776
2058
|
...typescriptOptions,
|
|
@@ -2873,7 +2155,7 @@ function getOverrides(options, key) {
|
|
|
2873
2155
|
};
|
|
2874
2156
|
}
|
|
2875
2157
|
function resolveSubOptions(options, key) {
|
|
2876
|
-
return
|
|
2158
|
+
return e(options[key]) ? {} : options[key] || {};
|
|
2877
2159
|
}
|
|
2878
2160
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2879
2161
|
0 && (module.exports = {
|
|
@@ -2911,6 +2193,7 @@ function resolveSubOptions(options, key) {
|
|
|
2911
2193
|
javascript,
|
|
2912
2194
|
jsdoc,
|
|
2913
2195
|
jsonc,
|
|
2196
|
+
jsx,
|
|
2914
2197
|
markdown,
|
|
2915
2198
|
node,
|
|
2916
2199
|
parserPlain,
|