@eslint-react/shared 2.0.0-next.2 → 2.0.0-next.20

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.ts CHANGED
@@ -669,27 +669,29 @@ const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
669
669
  type PartialDeep<T, Options extends PartialDeepOptions = {}> =
670
670
  _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
671
671
 
672
- type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | (((...arguments_: any[]) => unknown)) | (new (...arguments_: any[]) => unknown)
672
+ type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown))
673
673
  ? T
674
- : T extends Map<infer KeyType, infer ValueType>
675
- ? PartialMapDeep<KeyType, ValueType, Options>
676
- : T extends Set<infer ItemType>
677
- ? PartialSetDeep<ItemType, Options>
678
- : T extends ReadonlyMap<infer KeyType, infer ValueType>
679
- ? PartialReadonlyMapDeep<KeyType, ValueType, Options>
680
- : T extends ReadonlySet<infer ItemType>
681
- ? PartialReadonlySetDeep<ItemType, Options>
682
- : T extends object
683
- ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
684
- ? Options['recurseIntoArrays'] extends true
685
- ? ItemType[] extends T // Test for arrays (non-tuples) specifically
686
- ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
687
- ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
688
- : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
689
- : PartialObjectDeep<T, Options> // Tuples behave properly
690
- : T // If they don't opt into array testing, just use the original type
691
- : PartialObjectDeep<T, Options>
692
- : unknown;
674
+ : IsNever<keyof T> extends true // For functions with no properties
675
+ ? T
676
+ : T extends Map<infer KeyType, infer ValueType>
677
+ ? PartialMapDeep<KeyType, ValueType, Options>
678
+ : T extends Set<infer ItemType>
679
+ ? PartialSetDeep<ItemType, Options>
680
+ : T extends ReadonlyMap<infer KeyType, infer ValueType>
681
+ ? PartialReadonlyMapDeep<KeyType, ValueType, Options>
682
+ : T extends ReadonlySet<infer ItemType>
683
+ ? PartialReadonlySetDeep<ItemType, Options>
684
+ : T extends object
685
+ ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
686
+ ? Options['recurseIntoArrays'] extends true
687
+ ? ItemType[] extends T // Test for arrays (non-tuples) specifically
688
+ ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
689
+ ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
690
+ : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
691
+ : PartialObjectDeep<T, Options> // Tuples behave properly
692
+ : T // If they don't opt into array testing, just use the original type
693
+ : PartialObjectDeep<T, Options>
694
+ : unknown;
693
695
 
694
696
  /**
695
697
  Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
@@ -714,9 +716,12 @@ type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {
714
716
  /**
715
717
  Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
716
718
  */
717
- type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = {
718
- [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>
719
- };
719
+ type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> =
720
+ (ObjectType extends (...arguments_: any) => unknown
721
+ ? (...arguments_: Parameters<ObjectType>) => ReturnType<ObjectType>
722
+ : {}) & ({
723
+ [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>
724
+ });
720
725
 
721
726
  declare const CustomComponentPropSchema: z.ZodMiniObject<{
722
727
  /**
@@ -744,7 +749,7 @@ declare const CustomComponentPropSchema: z.ZodMiniObject<{
744
749
  * `"/"`
745
750
  */
746
751
  defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
747
- }, {}>;
752
+ }, {}, {}>;
748
753
  /**
749
754
  * @description
750
755
  * This will provide some key information to the rule before checking for user-defined components.
@@ -795,7 +800,7 @@ declare const CustomComponentSchema: z.ZodMiniObject<{
795
800
  * `"/"`
796
801
  */
797
802
  defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
798
- }, {}>>>;
803
+ }, {}, {}>>>;
799
804
  /**
800
805
  * The ESQuery selector to select the component precisely.
801
806
  * @internal
@@ -803,7 +808,7 @@ declare const CustomComponentSchema: z.ZodMiniObject<{
803
808
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
804
809
  */
805
810
  selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
806
- }, {}>;
811
+ }, {}, {}>;
807
812
  declare const CustomHooksSchema: z.ZodMiniObject<{
808
813
  use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
809
814
  useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
@@ -824,7 +829,7 @@ declare const CustomHooksSchema: z.ZodMiniObject<{
824
829
  useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
825
830
  useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
826
831
  useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
827
- }, {}>;
832
+ }, {}, {}>;
828
833
  /**
829
834
  * @internal
830
835
  */
@@ -836,19 +841,6 @@ declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
836
841
  * @example `"@pika/react"`
837
842
  */
838
843
  importSource: z.ZodMiniOptional<z.ZodMiniString<string>>;
839
- /**
840
- * The identifier that's used for JSX Element creation.
841
- * @default `"createElement"`
842
- * @deprecated
843
- */
844
- jsxPragma: z.ZodMiniOptional<z.ZodMiniString<string>>;
845
- /**
846
- * The identifier that's used for JSX fragment elements.
847
- * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
848
- * @default `"Fragment"`
849
- * @deprecated
850
- */
851
- jsxPragmaFrag: z.ZodMiniOptional<z.ZodMiniString<string>>;
852
844
  /**
853
845
  * The name of the prop that is used for polymorphic components.
854
846
  * @description This is used to determine the type of the component.
@@ -898,7 +890,7 @@ declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
898
890
  useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
899
891
  useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
900
892
  useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
901
- }, {}>>;
893
+ }, {}, {}>>;
902
894
  /**
903
895
  * An array of user-defined components
904
896
  * @description This is used to inform the ESLint React plugins how to treat these components during checks.
@@ -948,7 +940,7 @@ declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
948
940
  * `"/"`
949
941
  */
950
942
  defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
951
- }, {}>>>;
943
+ }, {}, {}>>>;
952
944
  /**
953
945
  * The ESQuery selector to select the component precisely.
954
946
  * @internal
@@ -956,14 +948,14 @@ declare const ESLintReactSettingsSchema: z.ZodMiniObject<{
956
948
  * `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
957
949
  */
958
950
  selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
959
- }, {}>>>;
960
- }, {}>;
951
+ }, {}, {}>>>;
952
+ }, {}, {}>;
961
953
  /**
962
954
  * @internal
963
955
  */
964
956
  declare const ESLintSettingsSchema: z.ZodMiniOptional<z.ZodMiniObject<{
965
957
  "react-x": z.ZodMiniOptional<z.ZodMiniUnknown>;
966
- }, {}>>;
958
+ }, {}, {}>>;
967
959
  type CustomComponent = z.infer<typeof CustomComponentSchema>;
968
960
  type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>;
969
961
  type CustomHooks = z.infer<typeof CustomHooksSchema>;
@@ -1067,8 +1059,6 @@ declare const normalizeSettings: ({ additionalComponents, additionalHooks, impor
1067
1059
  readonly skipImportCheck: boolean;
1068
1060
  readonly strict: boolean;
1069
1061
  readonly version: string;
1070
- readonly jsxPragma?: string | undefined;
1071
- readonly jsxPragmaFrag?: string | undefined;
1072
1062
  };
1073
1063
  declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized;
1074
1064
  /**
package/dist/index.js CHANGED
@@ -112,19 +112,6 @@ var ESLintReactSettingsSchema = z.object({
112
112
  * @example `"@pika/react"`
113
113
  */
114
114
  importSource: z.optional(z.string()),
115
- /**
116
- * The identifier that's used for JSX Element creation.
117
- * @default `"createElement"`
118
- * @deprecated
119
- */
120
- jsxPragma: z.optional(z.string()),
121
- /**
122
- * The identifier that's used for JSX fragment elements.
123
- * @description This should not be a member expression (i.e. use "Fragment" instead of "React.Fragment").
124
- * @default `"Fragment"`
125
- * @deprecated
126
- */
127
- jsxPragmaFrag: z.optional(z.string()),
128
115
  /**
129
116
  * The name of the prop that is used for polymorphic components.
130
117
  * @description This is used to determine the type of the component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "2.0.0-next.2",
3
+ "version": "2.0.0-next.20",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -27,17 +27,17 @@
27
27
  "./package.json"
28
28
  ],
29
29
  "dependencies": {
30
- "@typescript-eslint/utils": "^8.30.1",
31
- "@zod/mini": "^4.0.0-beta.20250418T073619",
30
+ "@typescript-eslint/utils": "^8.32.1",
31
+ "@zod/mini": "^4.0.0-beta.20250505T195954",
32
32
  "ts-pattern": "^5.7.0",
33
- "@eslint-react/eff": "2.0.0-next.2",
34
- "@eslint-react/kit": "2.0.0-next.2"
33
+ "@eslint-react/eff": "2.0.0-next.20",
34
+ "@eslint-react/kit": "2.0.0-next.20"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/node22": "^22.0.1",
38
38
  "@types/picomatch": "^4.0.0",
39
39
  "tsup": "^8.4.0",
40
- "type-fest": "^4.40.0",
40
+ "type-fest": "^4.41.0",
41
41
  "@local/configs": "0.0.0"
42
42
  },
43
43
  "engines": {