@eslint-react/shared
Advanced tools
Comparing version 1.23.2 to 1.23.3-next.0
@@ -221,3 +221,5 @@ 'use strict'; | ||
var getDocsUrl = (pluginName) => (ruleName) => { | ||
if (pluginName === "x") return `${WEBSITE_URL}/docs/rules/${ruleName}`; | ||
if (pluginName === "x") { | ||
return `${WEBSITE_URL}/docs/rules/${ruleName}`; | ||
} | ||
return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`; | ||
@@ -244,3 +246,3 @@ }; | ||
// ../../node_modules/.pnpm/valibot@1.0.0-beta.10_typescript@5.7.2/node_modules/valibot/dist/index.js | ||
// ../../node_modules/.pnpm/valibot@1.0.0-beta.11_typescript@5.7.2/node_modules/valibot/dist/index.js | ||
var store; | ||
@@ -256,3 +258,67 @@ // @__NO_SIDE_EFFECTS__ | ||
} | ||
var store2; | ||
// @__NO_SIDE_EFFECTS__ | ||
function getGlobalMessage(lang) { | ||
return store2?.get(lang); | ||
} | ||
var store3; | ||
// @__NO_SIDE_EFFECTS__ | ||
function getSchemaMessage(lang) { | ||
return store3?.get(lang); | ||
} | ||
var store4; | ||
// @__NO_SIDE_EFFECTS__ | ||
function getSpecificMessage(reference, lang) { | ||
return store4?.get(reference)?.get(lang); | ||
} | ||
// @__NO_SIDE_EFFECTS__ | ||
function _stringify(input) { | ||
const type = typeof input; | ||
if (type === "string") { | ||
return `"${input}"`; | ||
} | ||
if (type === "number" || type === "bigint" || type === "boolean") { | ||
return `${input}`; | ||
} | ||
if (type === "object" || type === "function") { | ||
return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null"; | ||
} | ||
return type; | ||
} | ||
function _addIssue(context, label, dataset, config2, other) { | ||
const input = dataset.value; | ||
const expected = context.expects ?? null; | ||
const received = /* @__PURE__ */ _stringify(input); | ||
const issue = { | ||
kind: context.kind, | ||
type: context.type, | ||
input, | ||
expected, | ||
received, | ||
message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`, | ||
requirement: context.requirement, | ||
path: other?.path, | ||
issues: other?.issues, | ||
lang: config2.lang, | ||
abortEarly: config2.abortEarly, | ||
abortPipeEarly: config2.abortPipeEarly | ||
}; | ||
const isSchema = context.kind === "schema"; | ||
const message = context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config2.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang); | ||
if (message) { | ||
issue.message = typeof message === "function" ? ( | ||
// @ts-expect-error | ||
message(issue) | ||
) : message; | ||
} | ||
if (isSchema) { | ||
dataset.typed = false; | ||
} | ||
if (dataset.issues) { | ||
dataset.issues.push(issue); | ||
} else { | ||
dataset.issues = [issue]; | ||
} | ||
} | ||
// @__NO_SIDE_EFFECTS__ | ||
function _getStandardProps(context) { | ||
@@ -339,2 +405,4 @@ return { | ||
} | ||
} else { | ||
_addIssue(this, "type", dataset, config2); | ||
} | ||
@@ -360,2 +428,4 @@ return dataset; | ||
dataset.typed = true; | ||
} else { | ||
_addIssue(this, "type", dataset, config2); | ||
} | ||
@@ -382,2 +452,4 @@ return dataset; | ||
dataset.typed = true; | ||
} else { | ||
_addIssue(this, "type", dataset, config2); | ||
} | ||
@@ -440,2 +512,4 @@ return dataset; | ||
} | ||
} else { | ||
_addIssue(this, "type", dataset, config2); | ||
} | ||
@@ -488,2 +562,4 @@ return dataset; | ||
dataset.typed = true; | ||
} else { | ||
_addIssue(this, "type", dataset, config2); | ||
} | ||
@@ -650,3 +726,3 @@ return dataset; | ||
// ../../node_modules/.pnpm/fast-equals@5.2.0/node_modules/fast-equals/dist/esm/index.mjs | ||
// ../../node_modules/.pnpm/fast-equals@5.2.1/node_modules/fast-equals/dist/esm/index.mjs | ||
var getOwnPropertyNames = Object.getOwnPropertyNames; | ||
@@ -1375,4 +1451,8 @@ var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
const { name, as, attributes = [], selector } = component; | ||
if (!name || !as || selector || attributes.length > 0) return acc; | ||
if (!/^[\w-]+$/u.test(name)) return acc; | ||
if (!name || !as || selector || attributes.length > 0) { | ||
return acc; | ||
} | ||
if (!/^[\w-]+$/u.test(name)) { | ||
return acc; | ||
} | ||
return acc.set(name, as); | ||
@@ -1379,0 +1459,0 @@ }, /* @__PURE__ */ new Map()), |
{ | ||
"name": "@eslint-react/shared", | ||
"version": "1.23.2", | ||
"version": "1.23.3-next.0", | ||
"description": "ESLint React's Shared constants and functions.", | ||
@@ -16,2 +16,3 @@ "homepage": "https://github.com/rEl1cx/eslint-react", | ||
"author": "Eva1ent<rel1cx@proton.me>", | ||
"sideEffects": false, | ||
"exports": { | ||
@@ -31,2 +32,3 @@ ".": { | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
@@ -41,11 +43,11 @@ "files": [ | ||
"ts-pattern": "^5.6.0", | ||
"@eslint-react/eff": "1.23.2" | ||
"@eslint-react/eff": "1.23.3-next.0" | ||
}, | ||
"devDependencies": { | ||
"@types/picomatch": "^3.0.1", | ||
"fast-equals": "^5.2.0", | ||
"fast-equals": "^5.2.1", | ||
"micro-memoize": "^4.1.3", | ||
"tsup": "^8.3.5", | ||
"type-fest": "^4.31.0", | ||
"valibot": "^1.0.0-beta.10", | ||
"valibot": "^1.0.0-beta.11", | ||
"@workspace/configs": "0.0.0" | ||
@@ -57,4 +59,2 @@ }, | ||
}, | ||
"sideEffects": false, | ||
"module": "dist/index.mjs", | ||
"scripts": { | ||
@@ -61,0 +61,0 @@ "build": "tsup --dts-resolve", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
246291
5128
1
+ Added@eslint-react/eff@1.23.3-next.0(transitive)
+ Added@typescript-eslint/scope-manager@8.20.0(transitive)
+ Added@typescript-eslint/types@8.20.0(transitive)
+ Added@typescript-eslint/typescript-estree@8.20.0(transitive)
+ Added@typescript-eslint/utils@8.20.0(transitive)
+ Added@typescript-eslint/visitor-keys@8.20.0(transitive)
- Removed@eslint-react/eff@1.23.2(transitive)
- Removed@typescript-eslint/scope-manager@8.19.1(transitive)
- Removed@typescript-eslint/types@8.19.1(transitive)
- Removed@typescript-eslint/typescript-estree@8.19.1(transitive)
- Removed@typescript-eslint/utils@8.19.1(transitive)
- Removed@typescript-eslint/visitor-keys@8.19.1(transitive)