@eslint-react/shared 1.17.1-next.0 → 1.17.1-next.2
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.d.mts +1008 -893
- package/dist/index.d.ts +1008 -893
- package/dist/index.js +44 -28
- package/dist/index.mjs +44 -28
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -215,6 +215,8 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
215
215
|
return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
|
|
216
216
|
};
|
|
217
217
|
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
218
|
+
|
|
219
|
+
// ../../node_modules/.pnpm/valibot@1.0.0-beta.8_typescript@5.6.3/node_modules/valibot/dist/index.js
|
|
218
220
|
var store;
|
|
219
221
|
function getGlobalConfig(config2) {
|
|
220
222
|
return {
|
|
@@ -284,6 +286,15 @@ function _addIssue(context, label, dataset, config2, other) {
|
|
|
284
286
|
dataset.issues = [issue];
|
|
285
287
|
}
|
|
286
288
|
}
|
|
289
|
+
function _getStandardProps(context) {
|
|
290
|
+
return {
|
|
291
|
+
version: 1,
|
|
292
|
+
vendor: "valibot",
|
|
293
|
+
validate(value2) {
|
|
294
|
+
return context["~run"]({ value: value2 }, getGlobalConfig());
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
287
298
|
var ValiError = class extends Error {
|
|
288
299
|
/**
|
|
289
300
|
* The error issues.
|
|
@@ -318,14 +329,17 @@ function array(item, message) {
|
|
|
318
329
|
async: false,
|
|
319
330
|
item,
|
|
320
331
|
message,
|
|
321
|
-
|
|
332
|
+
get "~standard"() {
|
|
333
|
+
return _getStandardProps(this);
|
|
334
|
+
},
|
|
335
|
+
"~run"(dataset, config2) {
|
|
322
336
|
const input = dataset.value;
|
|
323
337
|
if (Array.isArray(input)) {
|
|
324
338
|
dataset.typed = true;
|
|
325
339
|
dataset.value = [];
|
|
326
340
|
for (let key = 0; key < input.length; key++) {
|
|
327
341
|
const value2 = input[key];
|
|
328
|
-
const itemDataset = this.item
|
|
342
|
+
const itemDataset = this.item["~run"]({ value: value2 }, config2);
|
|
329
343
|
if (itemDataset.issues) {
|
|
330
344
|
const pathItem = {
|
|
331
345
|
type: "array",
|
|
@@ -370,7 +384,10 @@ function boolean(message) {
|
|
|
370
384
|
expects: "boolean",
|
|
371
385
|
async: false,
|
|
372
386
|
message,
|
|
373
|
-
|
|
387
|
+
get "~standard"() {
|
|
388
|
+
return _getStandardProps(this);
|
|
389
|
+
},
|
|
390
|
+
"~run"(dataset, config2) {
|
|
374
391
|
if (typeof dataset.value === "boolean") {
|
|
375
392
|
dataset.typed = true;
|
|
376
393
|
} else {
|
|
@@ -389,7 +406,10 @@ function instance(class_, message) {
|
|
|
389
406
|
async: false,
|
|
390
407
|
class: class_,
|
|
391
408
|
message,
|
|
392
|
-
|
|
409
|
+
get "~standard"() {
|
|
410
|
+
return _getStandardProps(this);
|
|
411
|
+
},
|
|
412
|
+
"~run"(dataset, config2) {
|
|
393
413
|
if (dataset.value instanceof this.class) {
|
|
394
414
|
dataset.typed = true;
|
|
395
415
|
} else {
|
|
@@ -408,17 +428,17 @@ function object(entries, message) {
|
|
|
408
428
|
async: false,
|
|
409
429
|
entries,
|
|
410
430
|
message,
|
|
411
|
-
|
|
431
|
+
get "~standard"() {
|
|
432
|
+
return _getStandardProps(this);
|
|
433
|
+
},
|
|
434
|
+
"~run"(dataset, config2) {
|
|
412
435
|
const input = dataset.value;
|
|
413
436
|
if (input && typeof input === "object") {
|
|
414
437
|
dataset.typed = true;
|
|
415
438
|
dataset.value = {};
|
|
416
439
|
for (const key in this.entries) {
|
|
417
440
|
const value2 = input[key];
|
|
418
|
-
const valueDataset = this.entries[key]
|
|
419
|
-
{ typed: false, value: value2 },
|
|
420
|
-
config2
|
|
421
|
-
);
|
|
441
|
+
const valueDataset = this.entries[key]["~run"]({ value: value2 }, config2);
|
|
422
442
|
if (valueDataset.issues) {
|
|
423
443
|
const pathItem = {
|
|
424
444
|
type: "object",
|
|
@@ -457,35 +477,31 @@ function object(entries, message) {
|
|
|
457
477
|
}
|
|
458
478
|
};
|
|
459
479
|
}
|
|
460
|
-
function optional(wrapped,
|
|
461
|
-
|
|
480
|
+
function optional(wrapped, default_) {
|
|
481
|
+
return {
|
|
462
482
|
kind: "schema",
|
|
463
483
|
type: "optional",
|
|
464
484
|
reference: optional,
|
|
465
485
|
expects: `(${wrapped.expects} | undefined)`,
|
|
466
486
|
async: false,
|
|
467
487
|
wrapped,
|
|
468
|
-
|
|
488
|
+
default: default_,
|
|
489
|
+
get "~standard"() {
|
|
490
|
+
return _getStandardProps(this);
|
|
491
|
+
},
|
|
492
|
+
"~run"(dataset, config2) {
|
|
469
493
|
if (dataset.value === void 0) {
|
|
470
|
-
if (
|
|
471
|
-
dataset.value = getDefault(
|
|
472
|
-
this,
|
|
473
|
-
dataset,
|
|
474
|
-
config2
|
|
475
|
-
);
|
|
494
|
+
if (this.default !== void 0) {
|
|
495
|
+
dataset.value = getDefault(this, dataset, config2);
|
|
476
496
|
}
|
|
477
497
|
if (dataset.value === void 0) {
|
|
478
498
|
dataset.typed = true;
|
|
479
499
|
return dataset;
|
|
480
500
|
}
|
|
481
501
|
}
|
|
482
|
-
return this.wrapped
|
|
502
|
+
return this.wrapped["~run"](dataset, config2);
|
|
483
503
|
}
|
|
484
504
|
};
|
|
485
|
-
if (0 in args) {
|
|
486
|
-
schema.default = args[0];
|
|
487
|
-
}
|
|
488
|
-
return schema;
|
|
489
505
|
}
|
|
490
506
|
function string(message) {
|
|
491
507
|
return {
|
|
@@ -495,7 +511,10 @@ function string(message) {
|
|
|
495
511
|
expects: "string",
|
|
496
512
|
async: false,
|
|
497
513
|
message,
|
|
498
|
-
|
|
514
|
+
get "~standard"() {
|
|
515
|
+
return _getStandardProps(this);
|
|
516
|
+
},
|
|
517
|
+
"~run"(dataset, config2) {
|
|
499
518
|
if (typeof dataset.value === "string") {
|
|
500
519
|
dataset.typed = true;
|
|
501
520
|
} else {
|
|
@@ -506,10 +525,7 @@ function string(message) {
|
|
|
506
525
|
};
|
|
507
526
|
}
|
|
508
527
|
function parse(schema, input, config2) {
|
|
509
|
-
const dataset = schema
|
|
510
|
-
{ typed: false, value: input },
|
|
511
|
-
getGlobalConfig(config2)
|
|
512
|
-
);
|
|
528
|
+
const dataset = schema["~run"]({ value: input }, getGlobalConfig(config2));
|
|
513
529
|
if (dataset.issues) {
|
|
514
530
|
throw new ValiError(dataset.issues);
|
|
515
531
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -209,6 +209,8 @@ var getDocsUrl = (pluginName) => (ruleName) => {
|
|
|
209
209
|
return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
|
|
210
210
|
};
|
|
211
211
|
var createRuleForPlugin = (pluginName) => ESLintUtils.RuleCreator(getDocsUrl(pluginName));
|
|
212
|
+
|
|
213
|
+
// ../../node_modules/.pnpm/valibot@1.0.0-beta.8_typescript@5.6.3/node_modules/valibot/dist/index.js
|
|
212
214
|
var store;
|
|
213
215
|
function getGlobalConfig(config2) {
|
|
214
216
|
return {
|
|
@@ -278,6 +280,15 @@ function _addIssue(context, label, dataset, config2, other) {
|
|
|
278
280
|
dataset.issues = [issue];
|
|
279
281
|
}
|
|
280
282
|
}
|
|
283
|
+
function _getStandardProps(context) {
|
|
284
|
+
return {
|
|
285
|
+
version: 1,
|
|
286
|
+
vendor: "valibot",
|
|
287
|
+
validate(value2) {
|
|
288
|
+
return context["~run"]({ value: value2 }, getGlobalConfig());
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
}
|
|
281
292
|
var ValiError = class extends Error {
|
|
282
293
|
/**
|
|
283
294
|
* The error issues.
|
|
@@ -312,14 +323,17 @@ function array(item, message) {
|
|
|
312
323
|
async: false,
|
|
313
324
|
item,
|
|
314
325
|
message,
|
|
315
|
-
|
|
326
|
+
get "~standard"() {
|
|
327
|
+
return _getStandardProps(this);
|
|
328
|
+
},
|
|
329
|
+
"~run"(dataset, config2) {
|
|
316
330
|
const input = dataset.value;
|
|
317
331
|
if (Array.isArray(input)) {
|
|
318
332
|
dataset.typed = true;
|
|
319
333
|
dataset.value = [];
|
|
320
334
|
for (let key = 0; key < input.length; key++) {
|
|
321
335
|
const value2 = input[key];
|
|
322
|
-
const itemDataset = this.item
|
|
336
|
+
const itemDataset = this.item["~run"]({ value: value2 }, config2);
|
|
323
337
|
if (itemDataset.issues) {
|
|
324
338
|
const pathItem = {
|
|
325
339
|
type: "array",
|
|
@@ -364,7 +378,10 @@ function boolean(message) {
|
|
|
364
378
|
expects: "boolean",
|
|
365
379
|
async: false,
|
|
366
380
|
message,
|
|
367
|
-
|
|
381
|
+
get "~standard"() {
|
|
382
|
+
return _getStandardProps(this);
|
|
383
|
+
},
|
|
384
|
+
"~run"(dataset, config2) {
|
|
368
385
|
if (typeof dataset.value === "boolean") {
|
|
369
386
|
dataset.typed = true;
|
|
370
387
|
} else {
|
|
@@ -383,7 +400,10 @@ function instance(class_, message) {
|
|
|
383
400
|
async: false,
|
|
384
401
|
class: class_,
|
|
385
402
|
message,
|
|
386
|
-
|
|
403
|
+
get "~standard"() {
|
|
404
|
+
return _getStandardProps(this);
|
|
405
|
+
},
|
|
406
|
+
"~run"(dataset, config2) {
|
|
387
407
|
if (dataset.value instanceof this.class) {
|
|
388
408
|
dataset.typed = true;
|
|
389
409
|
} else {
|
|
@@ -402,17 +422,17 @@ function object(entries, message) {
|
|
|
402
422
|
async: false,
|
|
403
423
|
entries,
|
|
404
424
|
message,
|
|
405
|
-
|
|
425
|
+
get "~standard"() {
|
|
426
|
+
return _getStandardProps(this);
|
|
427
|
+
},
|
|
428
|
+
"~run"(dataset, config2) {
|
|
406
429
|
const input = dataset.value;
|
|
407
430
|
if (input && typeof input === "object") {
|
|
408
431
|
dataset.typed = true;
|
|
409
432
|
dataset.value = {};
|
|
410
433
|
for (const key in this.entries) {
|
|
411
434
|
const value2 = input[key];
|
|
412
|
-
const valueDataset = this.entries[key]
|
|
413
|
-
{ typed: false, value: value2 },
|
|
414
|
-
config2
|
|
415
|
-
);
|
|
435
|
+
const valueDataset = this.entries[key]["~run"]({ value: value2 }, config2);
|
|
416
436
|
if (valueDataset.issues) {
|
|
417
437
|
const pathItem = {
|
|
418
438
|
type: "object",
|
|
@@ -451,35 +471,31 @@ function object(entries, message) {
|
|
|
451
471
|
}
|
|
452
472
|
};
|
|
453
473
|
}
|
|
454
|
-
function optional(wrapped,
|
|
455
|
-
|
|
474
|
+
function optional(wrapped, default_) {
|
|
475
|
+
return {
|
|
456
476
|
kind: "schema",
|
|
457
477
|
type: "optional",
|
|
458
478
|
reference: optional,
|
|
459
479
|
expects: `(${wrapped.expects} | undefined)`,
|
|
460
480
|
async: false,
|
|
461
481
|
wrapped,
|
|
462
|
-
|
|
482
|
+
default: default_,
|
|
483
|
+
get "~standard"() {
|
|
484
|
+
return _getStandardProps(this);
|
|
485
|
+
},
|
|
486
|
+
"~run"(dataset, config2) {
|
|
463
487
|
if (dataset.value === void 0) {
|
|
464
|
-
if (
|
|
465
|
-
dataset.value = getDefault(
|
|
466
|
-
this,
|
|
467
|
-
dataset,
|
|
468
|
-
config2
|
|
469
|
-
);
|
|
488
|
+
if (this.default !== void 0) {
|
|
489
|
+
dataset.value = getDefault(this, dataset, config2);
|
|
470
490
|
}
|
|
471
491
|
if (dataset.value === void 0) {
|
|
472
492
|
dataset.typed = true;
|
|
473
493
|
return dataset;
|
|
474
494
|
}
|
|
475
495
|
}
|
|
476
|
-
return this.wrapped
|
|
496
|
+
return this.wrapped["~run"](dataset, config2);
|
|
477
497
|
}
|
|
478
498
|
};
|
|
479
|
-
if (0 in args) {
|
|
480
|
-
schema.default = args[0];
|
|
481
|
-
}
|
|
482
|
-
return schema;
|
|
483
499
|
}
|
|
484
500
|
function string(message) {
|
|
485
501
|
return {
|
|
@@ -489,7 +505,10 @@ function string(message) {
|
|
|
489
505
|
expects: "string",
|
|
490
506
|
async: false,
|
|
491
507
|
message,
|
|
492
|
-
|
|
508
|
+
get "~standard"() {
|
|
509
|
+
return _getStandardProps(this);
|
|
510
|
+
},
|
|
511
|
+
"~run"(dataset, config2) {
|
|
493
512
|
if (typeof dataset.value === "string") {
|
|
494
513
|
dataset.typed = true;
|
|
495
514
|
} else {
|
|
@@ -500,10 +519,7 @@ function string(message) {
|
|
|
500
519
|
};
|
|
501
520
|
}
|
|
502
521
|
function parse(schema, input, config2) {
|
|
503
|
-
const dataset = schema
|
|
504
|
-
{ typed: false, value: input },
|
|
505
|
-
getGlobalConfig(config2)
|
|
506
|
-
);
|
|
522
|
+
const dataset = schema["~run"]({ value: input }, getGlobalConfig(config2));
|
|
507
523
|
if (dataset.issues) {
|
|
508
524
|
throw new ValiError(dataset.issues);
|
|
509
525
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.17.1-next.
|
|
3
|
+
"version": "1.17.1-next.2",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"local-pkg": "^0.5.1",
|
|
40
40
|
"picomatch": "^4.0.2",
|
|
41
41
|
"ts-pattern": "^5.5.0",
|
|
42
|
-
"@eslint-react/tools": "1.17.1-next.
|
|
42
|
+
"@eslint-react/tools": "1.17.1-next.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/picomatch": "^3.0.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"micro-memoize": "^4.1.2",
|
|
48
48
|
"tsup": "^8.3.5",
|
|
49
49
|
"type-fest": "^4.27.0",
|
|
50
|
-
"valibot": "^1.0.0-beta.
|
|
50
|
+
"valibot": "^1.0.0-beta.8"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsup --dts-resolve",
|