@eslint-react/shared
Advanced tools
Comparing version
import { _ } from '@eslint-react/eff'; | ||
import { RuleContext } from '@eslint-react/kit'; | ||
import * as z from 'zod'; | ||
import { z } from 'zod/v4'; | ||
@@ -719,38 +719,7 @@ /** | ||
declare const CustomComponentPropSchema: z.ZodObject<{ | ||
/** | ||
* The name of the prop in the user-defined component. | ||
* @example | ||
* "to" | ||
*/ | ||
name: z.ZodString; | ||
/** | ||
* The name of the prop in the host component. | ||
* @example | ||
* "href" | ||
*/ | ||
as: z.ZodOptional<z.ZodString>; | ||
/** | ||
* Whether the prop is controlled or not in the user-defined component. | ||
* @internal | ||
* @example | ||
* `true` | ||
*/ | ||
controlled: z.ZodOptional<z.ZodBoolean>; | ||
/** | ||
* The default value of the prop in the user-defined component. | ||
* @example | ||
* `"/"` | ||
*/ | ||
defaultValue: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}>; | ||
}, z.core.$strip>; | ||
/** | ||
@@ -763,145 +732,33 @@ * @description | ||
declare const CustomComponentSchema: z.ZodObject<{ | ||
/** | ||
* The name of the user-defined component. | ||
* @example | ||
* "Link" | ||
*/ | ||
name: z.ZodString; | ||
/** | ||
* The name of the host component that the user-defined component represents. | ||
* @example | ||
* "a" | ||
*/ | ||
as: z.ZodOptional<z.ZodString>; | ||
/** | ||
* Attributes mapping between the user-defined component and the host component. | ||
* @example | ||
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`. | ||
*/ | ||
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
/** | ||
* The name of the prop in the user-defined component. | ||
* @example | ||
* "to" | ||
*/ | ||
name: z.ZodString; | ||
/** | ||
* The name of the prop in the host component. | ||
* @example | ||
* "href" | ||
*/ | ||
as: z.ZodOptional<z.ZodString>; | ||
/** | ||
* Whether the prop is controlled or not in the user-defined component. | ||
* @internal | ||
* @example | ||
* `true` | ||
*/ | ||
controlled: z.ZodOptional<z.ZodBoolean>; | ||
/** | ||
* The default value of the prop in the user-defined component. | ||
* @example | ||
* `"/"` | ||
*/ | ||
defaultValue: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}>, "many">>; | ||
/** | ||
* The ESQuery selector to select the component precisely. | ||
* @internal | ||
* @example | ||
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])` | ||
*/ | ||
}, z.core.$strip>>>; | ||
selector: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}, { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}>; | ||
}, z.core.$strip>; | ||
declare const CustomHooksSchema: z.ZodObject<{ | ||
use: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useActionState: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useCallback: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useContext: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useId: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useMemo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useReducer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useRef: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useState: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useTransition: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
}, { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
}>; | ||
use: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useContext: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useId: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useRef: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useState: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
}, z.core.$strip>; | ||
/** | ||
@@ -911,281 +768,42 @@ * @internal | ||
declare const ESLintReactSettingsSchema: z.ZodObject<{ | ||
/** | ||
* The source where React is imported from. | ||
* @description This allows to specify a custom import location for React when not using the official distribution. | ||
* @default `"react"` | ||
* @example `"@pika/react"` | ||
*/ | ||
importSource: z.ZodOptional<z.ZodString>; | ||
/** | ||
* The identifier that's used for JSX Element creation. | ||
* @default `"createElement"` | ||
* @deprecated | ||
*/ | ||
jsxPragma: z.ZodOptional<z.ZodString>; | ||
/** | ||
* The identifier that's used for JSX fragment elements. | ||
* @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment"). | ||
* @default `"Fragment"` | ||
* @deprecated | ||
*/ | ||
jsxPragmaFrag: z.ZodOptional<z.ZodString>; | ||
/** | ||
* The name of the prop that is used for polymorphic components. | ||
* @description This is used to determine the type of the component. | ||
* @example `"as"` | ||
*/ | ||
polymorphicPropName: z.ZodOptional<z.ZodString>; | ||
/** | ||
* @default `true` | ||
* @internal | ||
*/ | ||
strict: z.ZodOptional<z.ZodBoolean>; | ||
/** | ||
* Check both the shape and the import to determine if an API is from React. | ||
* @default `true` | ||
* @internal | ||
*/ | ||
skipImportCheck: z.ZodOptional<z.ZodBoolean>; | ||
/** | ||
* React version to use, "detect" means auto detect React version from the project's dependencies. | ||
* If `importSource` is specified, an equivalent version of React should be provided here. | ||
* @example `"18.3.1"` | ||
* @default `"detect"` | ||
*/ | ||
version: z.ZodOptional<z.ZodString>; | ||
/** | ||
* A object to define additional hooks that are equivalent to the built-in React Hooks. | ||
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules. | ||
* @example `{ useEffect: ["useIsomorphicLayoutEffect"] }` | ||
*/ | ||
additionalHooks: z.ZodOptional<z.ZodObject<{ | ||
use: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useActionState: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useCallback: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useContext: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useId: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useMemo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useReducer: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useRef: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useState: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
useTransition: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
}, { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
}>>; | ||
/** | ||
* An array of user-defined components | ||
* @description This is used to inform the ESLint React plugins how to treat these components during checks. | ||
* @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]` | ||
*/ | ||
use: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useContext: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useId: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useRef: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useState: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>; | ||
}, z.core.$strip>>; | ||
additionalComponents: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
/** | ||
* The name of the user-defined component. | ||
* @example | ||
* "Link" | ||
*/ | ||
name: z.ZodString; | ||
/** | ||
* The name of the host component that the user-defined component represents. | ||
* @example | ||
* "a" | ||
*/ | ||
as: z.ZodOptional<z.ZodString>; | ||
/** | ||
* Attributes mapping between the user-defined component and the host component. | ||
* @example | ||
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`. | ||
*/ | ||
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
/** | ||
* The name of the prop in the user-defined component. | ||
* @example | ||
* "to" | ||
*/ | ||
name: z.ZodString; | ||
/** | ||
* The name of the prop in the host component. | ||
* @example | ||
* "href" | ||
*/ | ||
as: z.ZodOptional<z.ZodString>; | ||
/** | ||
* Whether the prop is controlled or not in the user-defined component. | ||
* @internal | ||
* @example | ||
* `true` | ||
*/ | ||
controlled: z.ZodOptional<z.ZodBoolean>; | ||
/** | ||
* The default value of the prop in the user-defined component. | ||
* @example | ||
* `"/"` | ||
*/ | ||
defaultValue: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}, { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}>, "many">>; | ||
/** | ||
* The ESQuery selector to select the component precisely. | ||
* @internal | ||
* @example | ||
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])` | ||
*/ | ||
}, z.core.$strip>>>; | ||
selector: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}, { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}>, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
version?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxPragma?: string | undefined; | ||
jsxPragmaFrag?: string | undefined; | ||
polymorphicPropName?: string | undefined; | ||
strict?: boolean | undefined; | ||
skipImportCheck?: boolean | undefined; | ||
additionalHooks?: { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
} | undefined; | ||
additionalComponents?: { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}[] | undefined; | ||
}, { | ||
version?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxPragma?: string | undefined; | ||
jsxPragmaFrag?: string | undefined; | ||
polymorphicPropName?: string | undefined; | ||
strict?: boolean | undefined; | ||
skipImportCheck?: boolean | undefined; | ||
additionalHooks?: { | ||
use?: string[] | undefined; | ||
useActionState?: string[] | undefined; | ||
useCallback?: string[] | undefined; | ||
useContext?: string[] | undefined; | ||
useDebugValue?: string[] | undefined; | ||
useDeferredValue?: string[] | undefined; | ||
useEffect?: string[] | undefined; | ||
useFormStatus?: string[] | undefined; | ||
useId?: string[] | undefined; | ||
useImperativeHandle?: string[] | undefined; | ||
useInsertionEffect?: string[] | undefined; | ||
useLayoutEffect?: string[] | undefined; | ||
useMemo?: string[] | undefined; | ||
useOptimistic?: string[] | undefined; | ||
useReducer?: string[] | undefined; | ||
useRef?: string[] | undefined; | ||
useState?: string[] | undefined; | ||
useSyncExternalStore?: string[] | undefined; | ||
useTransition?: string[] | undefined; | ||
} | undefined; | ||
additionalComponents?: { | ||
name: string; | ||
as?: string | undefined; | ||
attributes?: { | ||
name: string; | ||
as?: string | undefined; | ||
controlled?: boolean | undefined; | ||
defaultValue?: string | undefined; | ||
}[] | undefined; | ||
selector?: string | undefined; | ||
}[] | undefined; | ||
}>; | ||
}, z.core.$strip>>>; | ||
}, z.core.$strip>; | ||
/** | ||
@@ -1196,7 +814,3 @@ * @internal | ||
"react-x": z.ZodOptional<z.ZodUnknown>; | ||
}, "strip", z.ZodTypeAny, { | ||
"react-x"?: unknown; | ||
}, { | ||
"react-x"?: unknown; | ||
}>>; | ||
}, z.core.$strip>>; | ||
type CustomComponent = z.infer<typeof CustomComponentSchema>; | ||
@@ -1203,0 +817,0 @@ type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var kit = require('@eslint-react/kit'); | ||
var z = require('zod'); | ||
var v4 = require('zod/v4'); | ||
@@ -13,22 +13,3 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
} | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var module__default = /*#__PURE__*/_interopDefault(module$1); | ||
var z__namespace = /*#__PURE__*/_interopNamespace(z); | ||
@@ -59,3 +40,3 @@ // src/constants.ts | ||
} | ||
var CustomComponentPropSchema = z__namespace.object({ | ||
var CustomComponentPropSchema = v4.z.object({ | ||
/** | ||
@@ -66,3 +47,3 @@ * The name of the prop in the user-defined component. | ||
*/ | ||
name: z__namespace.string(), | ||
name: v4.z.string(), | ||
/** | ||
@@ -73,3 +54,3 @@ * The name of the prop in the host component. | ||
*/ | ||
as: z__namespace.optional(z__namespace.string()), | ||
as: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -81,3 +62,3 @@ * Whether the prop is controlled or not in the user-defined component. | ||
*/ | ||
controlled: z__namespace.optional(z__namespace.boolean()), | ||
controlled: v4.z.optional(v4.z.boolean()), | ||
/** | ||
@@ -88,5 +69,5 @@ * The default value of the prop in the user-defined component. | ||
*/ | ||
defaultValue: z__namespace.optional(z__namespace.string()) | ||
defaultValue: v4.z.optional(v4.z.string()) | ||
}); | ||
var CustomComponentSchema = z__namespace.object({ | ||
var CustomComponentSchema = v4.z.object({ | ||
/** | ||
@@ -97,3 +78,3 @@ * The name of the user-defined component. | ||
*/ | ||
name: z__namespace.string(), | ||
name: v4.z.string(), | ||
/** | ||
@@ -104,3 +85,3 @@ * The name of the host component that the user-defined component represents. | ||
*/ | ||
as: z__namespace.optional(z__namespace.string()), | ||
as: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -111,3 +92,3 @@ * Attributes mapping between the user-defined component and the host component. | ||
*/ | ||
attributes: z__namespace.optional(z__namespace.array(CustomComponentPropSchema)), | ||
attributes: v4.z.optional(v4.z.array(CustomComponentPropSchema)), | ||
/** | ||
@@ -119,26 +100,26 @@ * The ESQuery selector to select the component precisely. | ||
*/ | ||
selector: z__namespace.optional(z__namespace.string()) | ||
selector: v4.z.optional(v4.z.string()) | ||
}); | ||
var CustomHooksSchema = z__namespace.object({ | ||
use: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useActionState: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useCallback: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useContext: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useDebugValue: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useDeferredValue: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useEffect: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useFormStatus: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useId: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useImperativeHandle: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useInsertionEffect: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useLayoutEffect: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useMemo: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useOptimistic: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useReducer: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useRef: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useState: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useSyncExternalStore: z__namespace.optional(z__namespace.array(z__namespace.string())), | ||
useTransition: z__namespace.optional(z__namespace.array(z__namespace.string())) | ||
var CustomHooksSchema = v4.z.object({ | ||
use: v4.z.optional(v4.z.array(v4.z.string())), | ||
useActionState: v4.z.optional(v4.z.array(v4.z.string())), | ||
useCallback: v4.z.optional(v4.z.array(v4.z.string())), | ||
useContext: v4.z.optional(v4.z.array(v4.z.string())), | ||
useDebugValue: v4.z.optional(v4.z.array(v4.z.string())), | ||
useDeferredValue: v4.z.optional(v4.z.array(v4.z.string())), | ||
useEffect: v4.z.optional(v4.z.array(v4.z.string())), | ||
useFormStatus: v4.z.optional(v4.z.array(v4.z.string())), | ||
useId: v4.z.optional(v4.z.array(v4.z.string())), | ||
useImperativeHandle: v4.z.optional(v4.z.array(v4.z.string())), | ||
useInsertionEffect: v4.z.optional(v4.z.array(v4.z.string())), | ||
useLayoutEffect: v4.z.optional(v4.z.array(v4.z.string())), | ||
useMemo: v4.z.optional(v4.z.array(v4.z.string())), | ||
useOptimistic: v4.z.optional(v4.z.array(v4.z.string())), | ||
useReducer: v4.z.optional(v4.z.array(v4.z.string())), | ||
useRef: v4.z.optional(v4.z.array(v4.z.string())), | ||
useState: v4.z.optional(v4.z.array(v4.z.string())), | ||
useSyncExternalStore: v4.z.optional(v4.z.array(v4.z.string())), | ||
useTransition: v4.z.optional(v4.z.array(v4.z.string())) | ||
}); | ||
var ESLintReactSettingsSchema = z__namespace.object({ | ||
var ESLintReactSettingsSchema = v4.z.object({ | ||
/** | ||
@@ -150,3 +131,3 @@ * The source where React is imported from. | ||
*/ | ||
importSource: z__namespace.optional(z__namespace.string()), | ||
importSource: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -157,3 +138,3 @@ * The identifier that's used for JSX Element creation. | ||
*/ | ||
jsxPragma: z__namespace.optional(z__namespace.string()), | ||
jsxPragma: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -165,3 +146,3 @@ * The identifier that's used for JSX fragment elements. | ||
*/ | ||
jsxPragmaFrag: z__namespace.optional(z__namespace.string()), | ||
jsxPragmaFrag: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -172,3 +153,3 @@ * The name of the prop that is used for polymorphic components. | ||
*/ | ||
polymorphicPropName: z__namespace.optional(z__namespace.string()), | ||
polymorphicPropName: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -178,3 +159,3 @@ * @default `true` | ||
*/ | ||
strict: z__namespace.optional(z__namespace.boolean()), | ||
strict: v4.z.optional(v4.z.boolean()), | ||
/** | ||
@@ -185,3 +166,3 @@ * Check both the shape and the import to determine if an API is from React. | ||
*/ | ||
skipImportCheck: z__namespace.optional(z__namespace.boolean()), | ||
skipImportCheck: v4.z.optional(v4.z.boolean()), | ||
/** | ||
@@ -193,3 +174,3 @@ * React version to use, "detect" means auto detect React version from the project's dependencies. | ||
*/ | ||
version: z__namespace.optional(z__namespace.string()), | ||
version: v4.z.optional(v4.z.string()), | ||
/** | ||
@@ -200,3 +181,3 @@ * A object to define additional hooks that are equivalent to the built-in React Hooks. | ||
*/ | ||
additionalHooks: z__namespace.optional(CustomHooksSchema), | ||
additionalHooks: v4.z.optional(CustomHooksSchema), | ||
/** | ||
@@ -207,9 +188,8 @@ * An array of user-defined components | ||
*/ | ||
additionalComponents: z__namespace.optional(z__namespace.array(CustomComponentSchema)) | ||
additionalComponents: v4.z.optional(v4.z.array(CustomComponentSchema)) | ||
}); | ||
var ESLintSettingsSchema = z__namespace.optional( | ||
z__namespace.object({ | ||
"react-x": z__namespace.optional(z__namespace.unknown()) | ||
}), | ||
{} | ||
var ESLintSettingsSchema = v4.z.optional( | ||
v4.z.object({ | ||
"react-x": v4.z.optional(v4.z.unknown()) | ||
}) | ||
); | ||
@@ -216,0 +196,0 @@ function isESLintSettings(settings) { |
{ | ||
"name": "@eslint-react/shared", | ||
"version": "1.50.0-next.5", | ||
"version": "1.50.0-next.6", | ||
"description": "ESLint React's Shared constants and functions.", | ||
@@ -41,4 +41,4 @@ "homepage": "https://github.com/Rel1cx/eslint-react", | ||
"zod": "^3.25.28", | ||
"@eslint-react/eff": "1.50.0-next.5", | ||
"@eslint-react/kit": "1.50.0-next.5" | ||
"@eslint-react/eff": "1.50.0-next.6", | ||
"@eslint-react/kit": "1.50.0-next.6" | ||
}, | ||
@@ -45,0 +45,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
83676
-25.5%1311
-23.65%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed