You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@eslint-react/shared

Package Overview
Dependencies
Maintainers
0
Versions
1493
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eslint-react/shared - npm Package Compare versions

Comparing version

to
2.0.0-beta.19

309

dist/index.d.ts

@@ -1,4 +0,4 @@

import { _ } from '@eslint-react/eff';
import { unit } from '@eslint-react/eff';
import { RuleContext } from '@eslint-react/kit';
import * as z from '@zod/mini';
import { z } from 'zod/v4';

@@ -726,29 +726,8 @@ /**

declare const CustomComponentPropSchema: z.ZodMiniObject<{
/**
* The name of the prop in the user-defined component.
* @example
* "to"
*/
name: z.ZodMiniString<string>;
/**
* The name of the prop in the host component.
* @example
* "href"
*/
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* Whether the prop is controlled or not in the user-defined component.
* @internal
* @example
* `true`
*/
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
/**
* The default value of the prop in the user-defined component.
* @example
* `"/"`
*/
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, {}, {}>;
declare const CustomComponentPropSchema: z.ZodObject<{
name: z.ZodString;
as: z.ZodOptional<z.ZodString>;
controlled: z.ZodOptional<z.ZodBoolean>;
defaultValue: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
/**

@@ -760,202 +739,82 @@ * @description

*/
declare const CustomComponentSchema: z.ZodMiniObject<{
/**
* The name of the user-defined component.
* @example
* "Link"
*/
name: z.ZodMiniString<string>;
/**
* The name of the host component that the user-defined component represents.
* @example
* "a"
*/
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* 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.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
/**
* The name of the prop in the user-defined component.
* @example
* "to"
*/
name: z.ZodMiniString<string>;
/**
* The name of the prop in the host component.
* @example
* "href"
*/
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* Whether the prop is controlled or not in the user-defined component.
* @internal
* @example
* `true`
*/
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
/**
* The default value of the prop in the user-defined component.
* @example
* `"/"`
*/
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, {}, {}>>>;
/**
* The ESQuery selector to select the component precisely.
* @internal
* @example
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
*/
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, {}, {}>;
declare const CustomHooksSchema: z.ZodMiniObject<{
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
}, {}, {}>;
declare const CustomComponentSchema: z.ZodObject<{
name: z.ZodString;
as: z.ZodOptional<z.ZodString>;
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
as: z.ZodOptional<z.ZodString>;
controlled: z.ZodOptional<z.ZodBoolean>;
defaultValue: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
selector: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
declare const CustomHooksSchema: z.ZodObject<{
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>;
/**
* @internal
*/
declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
/**
* 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.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* 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.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* @default `true`
* @internal
*/
strict: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
/**
* Check both the shape and the import to determine if an API is from React.
* @default `true`
* @internal
*/
skipImportCheck: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
/**
* 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.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* 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.ZodMiniOptional<z.ZodMiniObject<{
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
}, {}, {}>>;
/**
* 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" }] }]`
*/
additionalComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
/**
* The name of the user-defined component.
* @example
* "Link"
*/
name: z.ZodMiniString<string>;
/**
* The name of the host component that the user-defined component represents.
* @example
* "a"
*/
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* 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.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
/**
* The name of the prop in the user-defined component.
* @example
* "to"
*/
name: z.ZodMiniString<string>;
/**
* The name of the prop in the host component.
* @example
* "href"
*/
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
/**
* Whether the prop is controlled or not in the user-defined component.
* @internal
* @example
* `true`
*/
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
/**
* The default value of the prop in the user-defined component.
* @example
* `"/"`
*/
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, {}, {}>>>;
/**
* The ESQuery selector to select the component precisely.
* @internal
* @example
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
*/
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
}, {}, {}>>>;
}, {}, {}>;
declare const ESLintReactSettingsSchema: z.ZodObject<{
importSource: z.ZodOptional<z.ZodString>;
polymorphicPropName: z.ZodOptional<z.ZodString>;
strict: z.ZodOptional<z.ZodBoolean>;
skipImportCheck: z.ZodOptional<z.ZodBoolean>;
version: z.ZodOptional<z.ZodString>;
additionalHooks: z.ZodOptional<z.ZodObject<{
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<{
name: z.ZodString;
as: z.ZodOptional<z.ZodString>;
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
as: z.ZodOptional<z.ZodString>;
controlled: z.ZodOptional<z.ZodBoolean>;
defaultValue: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
selector: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
}, z.core.$strip>;
/**
* @internal
*/
declare const ESLintSettingsSchema: z.ZodMiniOptional<z.ZodMiniObject<{
"react-x": z.ZodMiniOptional<z.ZodMiniUnknown>;
}, {}, {}>>;
declare const ESLintSettingsSchema: z.ZodOptional<z.ZodObject<{
"react-x": z.ZodOptional<z.ZodUnknown>;
}, z.core.$strip>>;
type CustomComponent = z.infer<typeof CustomComponentSchema>;

@@ -1000,3 +859,3 @@ type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>;

as: string;
defaultValue?: string | _;
defaultValue?: string | unit;
}

@@ -1015,3 +874,3 @@ interface CustomComponentNormalized {

importSource: string;
polymorphicPropName: string | _;
polymorphicPropName: string | unit;
skipImportCheck: boolean;

@@ -1018,0 +877,0 @@ strict: boolean;

@@ -1,7 +0,7 @@

import module from 'node:module';
import path from 'node:path';
import module from 'module';
import path from 'path';
import { identity, getOrElseUpdate } from '@eslint-react/eff';
import { match, P } from 'ts-pattern';
import { RegExp } from '@eslint-react/kit';
import * as z from '@zod/mini';
import { z } from 'zod/v4';

@@ -155,4 +155,3 @@ // src/_id.ts

"react-x": z.optional(z.unknown())
}),
{}
})
);

@@ -159,0 +158,0 @@ function isESLintSettings(settings) {

{
"name": "@eslint-react/shared",
"version": "2.0.0-beta.18",
"version": "2.0.0-beta.19",
"description": "ESLint React's Shared constants and functions.",

@@ -30,12 +30,12 @@ "homepage": "https://github.com/Rel1cx/eslint-react",

"dependencies": {
"@typescript-eslint/utils": "^8.32.0",
"@zod/mini": "^4.0.0-beta.20250505T195954",
"ts-pattern": "^5.7.0",
"@eslint-react/eff": "2.0.0-beta.18",
"@eslint-react/kit": "2.0.0-beta.18"
"@typescript-eslint/utils": "^8.38.0",
"ts-pattern": "^5.8.0",
"zod": "^4.0.14",
"@eslint-react/eff": "2.0.0-beta.19",
"@eslint-react/kit": "2.0.0-beta.19"
},
"devDependencies": {
"@tsconfig/node22": "^22.0.1",
"@types/picomatch": "^4.0.0",
"tsup": "^8.4.0",
"@tsconfig/node22": "^22.0.2",
"@types/picomatch": "^4.0.2",
"tsup": "^8.5.0",
"type-fest": "^4.41.0",

@@ -45,3 +45,2 @@ "@local/configs": "0.0.0"

"engines": {
"bun": ">=1.0.15",
"node": ">=20.19.0"

@@ -48,0 +47,0 @@ },