@eslint-react/shared
Advanced tools
Comparing version 1.5.3 to 1.5.4-next.0
@@ -5,213 +5,191 @@ 'use strict'; | ||
/** | ||
* ----------------------------------------------------------------------------- | ||
* Meta | ||
* ----------------------------------------------------------------------------- | ||
*/ const NPM_SCOPE = "@eslint-react"; | ||
const GITHUB_URL = "https://github.com/rel1cx/eslint-react/blob/main"; | ||
const WEBSITE_URL = "https://eslint-react.xyz"; | ||
/** | ||
* ----------------------------------------------------------------------------- | ||
* RegExps | ||
* ----------------------------------------------------------------------------- | ||
*/ const RE_PASCAL_CASE = /^[A-Z][\dA-Za-z]*$/u; | ||
const RE_CAMEL_CASE = /^[a-z][\dA-Za-z]*$/u; | ||
const RE_KEBAB_CASE = /^[a-z][\d\-a-z]*$/u; | ||
const RE_SNAKE_CASE = /^[a-z][\d_a-z]*$/u; | ||
const RE_CONSTANT_CASE = /^[A-Z][\d_A-Z]*$/u; | ||
// @see https://github.com/facebook/react/blob/6db7f4209e6f32ebde298a0b7451710dd6aa3e19/packages/react-dom-bindings/src/shared/sanitizeURL.js#L22 | ||
// dprint-ignore | ||
// eslint-disable-next-line no-control-regex, redos-detector/no-unsafe-regex | ||
const RE_JAVASCRIPT_PROTOCOL = /^[\u0000-\u001F ]*j[\t\n\r]*a[\t\n\r]*v[\t\n\r]*a[\t\n\r]*s[\t\n\r]*c[\t\n\r]*r[\t\n\r]*i[\t\n\r]*p[\t\n\r]*t[\t\n\r]*:/iu; | ||
/** | ||
* ----------------------------------------------------------------------------- | ||
* JSX, React, and ReactDOM constants | ||
* ----------------------------------------------------------------------------- | ||
*/ // source: https://react.dev/reference/react-dom/components#all-html-components | ||
/** | ||
* @internal | ||
*/ const HOST_HTML_COMPONENT_TYPES = [ | ||
"aside", | ||
"audio", | ||
"b", | ||
"base", | ||
"bdi", | ||
"bdo", | ||
"blockquote", | ||
"body", | ||
"br", | ||
"button", | ||
"canvas", | ||
"caption", | ||
"cite", | ||
"code", | ||
"col", | ||
"colgroup", | ||
"data", | ||
"datalist", | ||
"dd", | ||
"del", | ||
"details", | ||
"dfn", | ||
"dialog", | ||
"div", | ||
"dl", | ||
"dt", | ||
"em", | ||
"embed", | ||
"fieldset", | ||
"figcaption", | ||
"figure", | ||
"footer", | ||
"form", | ||
"h1", | ||
"head", | ||
"header", | ||
"hgroup", | ||
"hr", | ||
"html", | ||
"i", | ||
"iframe", | ||
"img", | ||
"input", | ||
"ins", | ||
"kbd", | ||
"label", | ||
"legend", | ||
"li", | ||
"link", | ||
"main", | ||
"map", | ||
"mark", | ||
"menu", | ||
"meta", | ||
"meter", | ||
"nav", | ||
"noscript", | ||
"object", | ||
"ol", | ||
"optgroup", | ||
"option", | ||
"output", | ||
"p", | ||
"picture", | ||
"pre", | ||
"progress", | ||
"q", | ||
"rp", | ||
"rt", | ||
"ruby", | ||
"s", | ||
"samp", | ||
"script", | ||
"section", | ||
"select", | ||
"slot", | ||
"small", | ||
"source", | ||
"span", | ||
"strong", | ||
"style", | ||
"sub", | ||
"summary", | ||
"sup", | ||
"table", | ||
"tbody", | ||
"td", | ||
"template", | ||
"textarea", | ||
"tfoot", | ||
"th", | ||
"thead", | ||
"time", | ||
"title", | ||
"tr", | ||
"track", | ||
"u", | ||
"ul", | ||
"var", | ||
"video", | ||
"wbr" | ||
// src/constants.ts | ||
var NPM_SCOPE = "@eslint-react"; | ||
var GITHUB_URL = "https://github.com/rel1cx/eslint-react/blob/main"; | ||
var WEBSITE_URL = "https://eslint-react.xyz"; | ||
var RE_PASCAL_CASE = /^[A-Z][\dA-Za-z]*$/u; | ||
var RE_CAMEL_CASE = /^[a-z][\dA-Za-z]*$/u; | ||
var RE_KEBAB_CASE = /^[a-z][\d\-a-z]*$/u; | ||
var RE_SNAKE_CASE = /^[a-z][\d_a-z]*$/u; | ||
var RE_CONSTANT_CASE = /^[A-Z][\d_A-Z]*$/u; | ||
var RE_JAVASCRIPT_PROTOCOL = /^[\u0000-\u001F ]*j[\t\n\r]*a[\t\n\r]*v[\t\n\r]*a[\t\n\r]*s[\t\n\r]*c[\t\n\r]*r[\t\n\r]*i[\t\n\r]*p[\t\n\r]*t[\t\n\r]*:/iu; | ||
var HOST_HTML_COMPONENT_TYPES = [ | ||
"aside", | ||
"audio", | ||
"b", | ||
"base", | ||
"bdi", | ||
"bdo", | ||
"blockquote", | ||
"body", | ||
"br", | ||
"button", | ||
"canvas", | ||
"caption", | ||
"cite", | ||
"code", | ||
"col", | ||
"colgroup", | ||
"data", | ||
"datalist", | ||
"dd", | ||
"del", | ||
"details", | ||
"dfn", | ||
"dialog", | ||
"div", | ||
"dl", | ||
"dt", | ||
"em", | ||
"embed", | ||
"fieldset", | ||
"figcaption", | ||
"figure", | ||
"footer", | ||
"form", | ||
"h1", | ||
"head", | ||
"header", | ||
"hgroup", | ||
"hr", | ||
"html", | ||
"i", | ||
"iframe", | ||
"img", | ||
"input", | ||
"ins", | ||
"kbd", | ||
"label", | ||
"legend", | ||
"li", | ||
"link", | ||
"main", | ||
"map", | ||
"mark", | ||
"menu", | ||
"meta", | ||
"meter", | ||
"nav", | ||
"noscript", | ||
"object", | ||
"ol", | ||
"optgroup", | ||
"option", | ||
"output", | ||
"p", | ||
"picture", | ||
"pre", | ||
"progress", | ||
"q", | ||
"rp", | ||
"rt", | ||
"ruby", | ||
"s", | ||
"samp", | ||
"script", | ||
"section", | ||
"select", | ||
"slot", | ||
"small", | ||
"source", | ||
"span", | ||
"strong", | ||
"style", | ||
"sub", | ||
"summary", | ||
"sup", | ||
"table", | ||
"tbody", | ||
"td", | ||
"template", | ||
"textarea", | ||
"tfoot", | ||
"th", | ||
"thead", | ||
"time", | ||
"title", | ||
"tr", | ||
"track", | ||
"u", | ||
"ul", | ||
"var", | ||
"video", | ||
"wbr" | ||
]; | ||
// source: https://react.dev/reference/react-dom/components#all-svg-components | ||
/** | ||
* @internal | ||
*/ const HOST_SVG_COMPONENT_TYPES = [ | ||
"a", | ||
"animate", | ||
"animateMotion", | ||
"animateTransform", | ||
"circle", | ||
"clipPath", | ||
"defs", | ||
"desc", | ||
"discard", | ||
"ellipse", | ||
"feBlend", | ||
"feColorMatrix", | ||
"feComponentTransfer", | ||
"feComposite", | ||
"feConvolveMatrix", | ||
"feDiffuseLighting", | ||
"feDisplacementMap", | ||
"feDistantLight", | ||
"feDropShadow", | ||
"feFlood", | ||
"feFuncA", | ||
"feFuncB", | ||
"feFuncG", | ||
"feFuncR", | ||
"feGaussianBlur", | ||
"feImage", | ||
"feMerge", | ||
"feMergeNode", | ||
"feMorphology", | ||
"feOffset", | ||
"fePointLight", | ||
"feSpecularLighting", | ||
"feSpotLight", | ||
"feTile", | ||
"feTurbulence", | ||
"filter", | ||
"foreignObject", | ||
"g", | ||
"hatch", | ||
"hatchpath", | ||
"image", | ||
"line", | ||
"linearGradient", | ||
"marker", | ||
"mask", | ||
"metadata", | ||
"mpath", | ||
"path", | ||
"pattern", | ||
"polygon", | ||
"polyline", | ||
"radialGradient", | ||
"rect", | ||
"script", | ||
"set", | ||
"stop", | ||
"style", | ||
"svg", | ||
"switch", | ||
"symbol", | ||
"text", | ||
"textPath", | ||
"title", | ||
"tspan", | ||
"use", | ||
"view" | ||
var HOST_SVG_COMPONENT_TYPES = [ | ||
"a", | ||
"animate", | ||
"animateMotion", | ||
"animateTransform", | ||
"circle", | ||
"clipPath", | ||
"defs", | ||
"desc", | ||
"discard", | ||
"ellipse", | ||
"feBlend", | ||
"feColorMatrix", | ||
"feComponentTransfer", | ||
"feComposite", | ||
"feConvolveMatrix", | ||
"feDiffuseLighting", | ||
"feDisplacementMap", | ||
"feDistantLight", | ||
"feDropShadow", | ||
"feFlood", | ||
"feFuncA", | ||
"feFuncB", | ||
"feFuncG", | ||
"feFuncR", | ||
"feGaussianBlur", | ||
"feImage", | ||
"feMerge", | ||
"feMergeNode", | ||
"feMorphology", | ||
"feOffset", | ||
"fePointLight", | ||
"feSpecularLighting", | ||
"feSpotLight", | ||
"feTile", | ||
"feTurbulence", | ||
"filter", | ||
"foreignObject", | ||
"g", | ||
"hatch", | ||
"hatchpath", | ||
"image", | ||
"line", | ||
"linearGradient", | ||
"marker", | ||
"mask", | ||
"metadata", | ||
"mpath", | ||
"path", | ||
"pattern", | ||
"polygon", | ||
"polyline", | ||
"radialGradient", | ||
"rect", | ||
"script", | ||
"set", | ||
"stop", | ||
"style", | ||
"svg", | ||
"switch", | ||
"symbol", | ||
"text", | ||
"textPath", | ||
"title", | ||
"tspan", | ||
"use", | ||
"view" | ||
]; | ||
var getDocsUrl = (pluginName) => (ruleName) => { | ||
if (pluginName === "core") | ||
return `${WEBSITE_URL}/rules/${ruleName}`; | ||
return `${WEBSITE_URL}/rules/${pluginName}-${ruleName}`; | ||
}; | ||
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName)); | ||
const getDocsUrl = (pluginName)=>(ruleName)=>{ | ||
if (pluginName === "core") return `${WEBSITE_URL}/rules/${ruleName}`; | ||
return `${WEBSITE_URL}/rules/${pluginName}-${ruleName}`; | ||
}; | ||
const createRuleForPlugin = (pluginName)=>utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName)); | ||
// src/error/flatten/flatten.ts | ||
// src/error/ValiError/ValiError.ts | ||
// ../../node_modules/.pnpm/valibot@0.28.1/node_modules/valibot/dist/index.js | ||
var ValiError = class extends Error { | ||
@@ -230,9 +208,5 @@ issues; | ||
}; | ||
// src/utils/defaultArgs/defaultArgs.ts | ||
function defaultArgs(arg1, arg2) { | ||
return Array.isArray(arg1) ? [void 0, arg1] : [arg1, arg2]; | ||
} | ||
// src/storages/globalConfig/globalConfig.ts | ||
var store; | ||
@@ -248,4 +222,2 @@ function getGlobalConfig(config) { | ||
} | ||
// src/storages/globalMessage/globalMessage.ts | ||
var store2; | ||
@@ -255,4 +227,2 @@ function getGlobalMessage(lang) { | ||
} | ||
// src/storages/schemaMessage/schemaMessage.ts | ||
var store3; | ||
@@ -262,4 +232,2 @@ function getSchemaMessage(lang) { | ||
} | ||
// src/storages/specificMessage/specificMessage.ts | ||
var store4; | ||
@@ -269,4 +237,2 @@ function getSpecificMessage(reference, lang) { | ||
} | ||
// src/utils/i18n/i18n.ts | ||
function i18n(context, reference, config, issue) { | ||
@@ -276,9 +242,5 @@ const message = context.message ?? getSpecificMessage(reference, issue.lang) ?? (context.type === "type" ? getSchemaMessage(issue.lang) : null) ?? config?.message ?? getGlobalMessage(issue.lang) ?? issue.message; | ||
} | ||
// src/utils/schemaResult/schemaResult.ts | ||
function schemaResult(typed, output, issues) { | ||
return { typed, output, issues }; | ||
} | ||
// src/utils/stringify/stringify.ts | ||
function stringify(input) { | ||
@@ -291,4 +253,2 @@ let type = typeof input; | ||
} | ||
// src/utils/pipeResult/utils/pipeIssue/pipeIssue.ts | ||
function pipeIssue(context, config, issue) { | ||
@@ -318,4 +278,2 @@ const received = issue.received ?? stringify(issue.input); | ||
} | ||
// src/utils/pipeResult/pipeResult.ts | ||
function pipeResult(context, input, config, issues) { | ||
@@ -340,4 +298,2 @@ if (context.pipe && !config?.skipPipe) { | ||
} | ||
// src/utils/restAndDefaultArgs/restAndDefaultArgs.ts | ||
function restAndDefaultArgs(arg1, arg2, arg3) { | ||
@@ -354,4 +310,2 @@ if (!arg1 || typeof arg1 === "object" && !Array.isArray(arg1)) { | ||
} | ||
// src/utils/schemaIssue/schemaIssue.ts | ||
function schemaIssue(context, reference, input, config, other) { | ||
@@ -377,9 +331,5 @@ const received = stringify(input); | ||
} | ||
// src/methods/getDefault/getDefault.ts | ||
function getDefault(schema) { | ||
return typeof schema.default === "function" ? schema.default() : schema.default; | ||
} | ||
// src/schemas/array/array.ts | ||
function array(item, arg2, arg3) { | ||
@@ -440,4 +390,2 @@ const [message, pipe] = defaultArgs(arg2, arg3); | ||
} | ||
// src/schemas/object/object.ts | ||
function object(entries, arg2, arg3, arg4) { | ||
@@ -544,4 +492,2 @@ const [rest, message, pipe] = restAndDefaultArgs(arg2, arg3, arg4); | ||
} | ||
// src/schemas/optional/optional.ts | ||
function optional(wrapped, default_) { | ||
@@ -566,4 +512,2 @@ return { | ||
} | ||
// src/schemas/string/string.ts | ||
function string(arg1, arg2) { | ||
@@ -585,4 +529,2 @@ const [message, pipe] = defaultArgs(arg1, arg2); | ||
} | ||
// src/methods/parse/parse.ts | ||
function parse(schema, input, config) { | ||
@@ -595,4 +537,2 @@ const result = schema._parse(input, getGlobalConfig(config)); | ||
} | ||
// src/methods/safeParse/safeParse.ts | ||
function safeParse(schema, input, config) { | ||
@@ -610,32 +550,29 @@ const result = schema._parse(input, getGlobalConfig(config)); | ||
/** | ||
* @internal | ||
*/ const ESLintReactSettingsSchema = object({ | ||
additionalHooks: optional(object({ | ||
use: optional(string()), | ||
useCallback: optional(array(string())), | ||
useContext: optional(array(string())), | ||
useDebugValue: optional(array(string())), | ||
useDeferredValue: optional(array(string())), | ||
useEffect: optional(array(string())), | ||
useId: optional(array(string())), | ||
useImperativeHandle: optional(array(string())), | ||
useInsertionEffect: optional(array(string())), | ||
useLayoutEffect: optional(array(string())), | ||
useMemo: optional(array(string())), | ||
useOptimistic: optional(array(string())), | ||
useReducer: optional(array(string())), | ||
useRef: optional(array(string())), | ||
useState: optional(array(string())), | ||
useSyncExternalStore: optional(array(string())), | ||
useTransition: optional(array(string())) | ||
})), | ||
jsxPragma: optional(string()), | ||
jsxPragmaFrag: optional(string()), | ||
version: optional(string()) | ||
// src/settings.ts | ||
var ESLintReactSettingsSchema = object({ | ||
additionalHooks: optional(object({ | ||
use: optional(string()), | ||
useCallback: optional(array(string())), | ||
useContext: optional(array(string())), | ||
useDebugValue: optional(array(string())), | ||
useDeferredValue: optional(array(string())), | ||
useEffect: optional(array(string())), | ||
useId: optional(array(string())), | ||
useImperativeHandle: optional(array(string())), | ||
useInsertionEffect: optional(array(string())), | ||
useLayoutEffect: optional(array(string())), | ||
useMemo: optional(array(string())), | ||
useOptimistic: optional(array(string())), | ||
useReducer: optional(array(string())), | ||
useRef: optional(array(string())), | ||
useState: optional(array(string())), | ||
useSyncExternalStore: optional(array(string())), | ||
useTransition: optional(array(string())) | ||
})), | ||
jsxPragma: optional(string()), | ||
jsxPragmaFrag: optional(string()), | ||
version: optional(string()) | ||
}); | ||
/** | ||
* @internal | ||
*/ const ESLintSettingsSchema = object({ | ||
reactOptions: optional(ESLintReactSettingsSchema) | ||
var ESLintSettingsSchema = object({ | ||
reactOptions: optional(ESLintReactSettingsSchema) | ||
}); | ||
@@ -642,0 +579,0 @@ |
{ | ||
"name": "@eslint-react/shared", | ||
"version": "1.5.3", | ||
"version": "1.5.4-next.0", | ||
"description": "ESLint React's Shared constants and functions.", | ||
@@ -46,3 +46,3 @@ "homepage": "https://github.com/rel1cx/eslint-react", | ||
"scripts": { | ||
"build": "rollup -c rollup.config.ts --configPlugin swc3 && cp dist/index.d.ts dist/index.d.mts", | ||
"build": "tsup", | ||
"build:docs": "typedoc", | ||
@@ -49,0 +49,0 @@ "lint:publish": "publint", |
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
64761
6
1403
1