@eslint-react/shared 2.0.0-next.4 → 2.0.0-next.43
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 +110 -261
- package/dist/index.js +4 -18
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ } from '@eslint-react/eff';
|
|
2
2
|
import { RuleContext } from '@eslint-react/kit';
|
|
3
|
-
import
|
|
3
|
+
import { z } from 'zod/v4';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -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 | ((
|
|
672
|
+
type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown))
|
|
673
673
|
? T
|
|
674
|
-
: T extends
|
|
675
|
-
?
|
|
676
|
-
: T extends
|
|
677
|
-
?
|
|
678
|
-
: T extends
|
|
679
|
-
?
|
|
680
|
-
: T extends
|
|
681
|
-
?
|
|
682
|
-
: T extends
|
|
683
|
-
?
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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,256 +716,105 @@ 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
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
* @example
|
|
731
|
-
* "href"
|
|
732
|
-
*/
|
|
733
|
-
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
734
|
-
/**
|
|
735
|
-
* Whether the prop is controlled or not in the user-defined component.
|
|
736
|
-
* @internal
|
|
737
|
-
* @example
|
|
738
|
-
* `true`
|
|
739
|
-
*/
|
|
740
|
-
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
741
|
-
/**
|
|
742
|
-
* The default value of the prop in the user-defined component.
|
|
743
|
-
* @example
|
|
744
|
-
* `"/"`
|
|
745
|
-
*/
|
|
746
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
747
|
-
}, {}>;
|
|
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
|
+
});
|
|
725
|
+
|
|
726
|
+
declare const CustomComponentPropSchema: z.ZodObject<{
|
|
727
|
+
name: z.ZodString;
|
|
728
|
+
as: z.ZodOptional<z.ZodString>;
|
|
729
|
+
controlled: z.ZodOptional<z.ZodBoolean>;
|
|
730
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
731
|
+
}, z.core.$strip>;
|
|
748
732
|
/**
|
|
749
733
|
* @description
|
|
750
734
|
* This will provide some key information to the rule before checking for user-defined components.
|
|
751
735
|
* For example:
|
|
752
736
|
* Which prop is used as the `href` prop for the user-defined `Link` component that represents the built-in `a` element.
|
|
753
737
|
*/
|
|
754
|
-
declare const CustomComponentSchema: z.
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
* Whether the prop is controlled or not in the user-defined component.
|
|
787
|
-
* @internal
|
|
788
|
-
* @example
|
|
789
|
-
* `true`
|
|
790
|
-
*/
|
|
791
|
-
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
792
|
-
/**
|
|
793
|
-
* The default value of the prop in the user-defined component.
|
|
794
|
-
* @example
|
|
795
|
-
* `"/"`
|
|
796
|
-
*/
|
|
797
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
798
|
-
}, {}>>>;
|
|
799
|
-
/**
|
|
800
|
-
* The ESQuery selector to select the component precisely.
|
|
801
|
-
* @internal
|
|
802
|
-
* @example
|
|
803
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
804
|
-
*/
|
|
805
|
-
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
806
|
-
}, {}>;
|
|
807
|
-
declare const CustomHooksSchema: z.ZodMiniObject<{
|
|
808
|
-
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
809
|
-
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
810
|
-
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
811
|
-
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
812
|
-
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
813
|
-
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
814
|
-
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
815
|
-
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
816
|
-
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
817
|
-
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
818
|
-
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
819
|
-
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
820
|
-
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
821
|
-
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
822
|
-
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
823
|
-
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
824
|
-
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
825
|
-
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
826
|
-
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
827
|
-
}, {}>;
|
|
738
|
+
declare const CustomComponentSchema: z.ZodObject<{
|
|
739
|
+
name: z.ZodString;
|
|
740
|
+
as: z.ZodOptional<z.ZodString>;
|
|
741
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
742
|
+
name: z.ZodString;
|
|
743
|
+
as: z.ZodOptional<z.ZodString>;
|
|
744
|
+
controlled: z.ZodOptional<z.ZodBoolean>;
|
|
745
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
746
|
+
}, z.core.$strip>>>;
|
|
747
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
748
|
+
}, z.core.$strip>;
|
|
749
|
+
declare const CustomHooksSchema: z.ZodObject<{
|
|
750
|
+
use: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
751
|
+
useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
752
|
+
useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
753
|
+
useContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
754
|
+
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
755
|
+
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
756
|
+
useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
757
|
+
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
758
|
+
useId: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
759
|
+
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
760
|
+
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
761
|
+
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
762
|
+
useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
763
|
+
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
764
|
+
useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
765
|
+
useRef: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
766
|
+
useState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
767
|
+
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
768
|
+
useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
769
|
+
}, z.core.$strip>;
|
|
828
770
|
/**
|
|
829
771
|
* @internal
|
|
830
772
|
*/
|
|
831
|
-
declare const ESLintReactSettingsSchema: z.
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
* React version to use, "detect" means auto detect React version from the project's dependencies.
|
|
871
|
-
* If `importSource` is specified, an equivalent version of React should be provided here.
|
|
872
|
-
* @example `"18.3.1"`
|
|
873
|
-
* @default `"detect"`
|
|
874
|
-
*/
|
|
875
|
-
version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
876
|
-
/**
|
|
877
|
-
* A object to define additional hooks that are equivalent to the built-in React Hooks.
|
|
878
|
-
* @description ESLint React will recognize these aliases as equivalent to the built-in hooks in all its rules.
|
|
879
|
-
* @example `{ useEffect: ["useIsomorphicLayoutEffect"] }`
|
|
880
|
-
*/
|
|
881
|
-
additionalHooks: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
882
|
-
use: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
883
|
-
useActionState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
884
|
-
useCallback: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
885
|
-
useContext: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
886
|
-
useDebugValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
887
|
-
useDeferredValue: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
888
|
-
useEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
889
|
-
useFormStatus: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
890
|
-
useId: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
891
|
-
useImperativeHandle: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
892
|
-
useInsertionEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
893
|
-
useLayoutEffect: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
894
|
-
useMemo: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
895
|
-
useOptimistic: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
896
|
-
useReducer: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
897
|
-
useRef: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
898
|
-
useState: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
899
|
-
useSyncExternalStore: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
900
|
-
useTransition: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
901
|
-
}, {}>>;
|
|
902
|
-
/**
|
|
903
|
-
* An array of user-defined components
|
|
904
|
-
* @description This is used to inform the ESLint React plugins how to treat these components during checks.
|
|
905
|
-
* @example `[{ name: "Link", as: "a", attributes: [{ name: "to", as: "href" }, { name: "rel", defaultValue: "noopener noreferrer" }] }]`
|
|
906
|
-
*/
|
|
907
|
-
additionalComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
908
|
-
/**
|
|
909
|
-
* The name of the user-defined component.
|
|
910
|
-
* @example
|
|
911
|
-
* "Link"
|
|
912
|
-
*/
|
|
913
|
-
name: z.ZodMiniString<string>;
|
|
914
|
-
/**
|
|
915
|
-
* The name of the host component that the user-defined component represents.
|
|
916
|
-
* @example
|
|
917
|
-
* "a"
|
|
918
|
-
*/
|
|
919
|
-
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
920
|
-
/**
|
|
921
|
-
* Attributes mapping between the user-defined component and the host component.
|
|
922
|
-
* @example
|
|
923
|
-
* `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
|
|
924
|
-
*/
|
|
925
|
-
attributes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
926
|
-
/**
|
|
927
|
-
* The name of the prop in the user-defined component.
|
|
928
|
-
* @example
|
|
929
|
-
* "to"
|
|
930
|
-
*/
|
|
931
|
-
name: z.ZodMiniString<string>;
|
|
932
|
-
/**
|
|
933
|
-
* The name of the prop in the host component.
|
|
934
|
-
* @example
|
|
935
|
-
* "href"
|
|
936
|
-
*/
|
|
937
|
-
as: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
938
|
-
/**
|
|
939
|
-
* Whether the prop is controlled or not in the user-defined component.
|
|
940
|
-
* @internal
|
|
941
|
-
* @example
|
|
942
|
-
* `true`
|
|
943
|
-
*/
|
|
944
|
-
controlled: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
945
|
-
/**
|
|
946
|
-
* The default value of the prop in the user-defined component.
|
|
947
|
-
* @example
|
|
948
|
-
* `"/"`
|
|
949
|
-
*/
|
|
950
|
-
defaultValue: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
951
|
-
}, {}>>>;
|
|
952
|
-
/**
|
|
953
|
-
* The ESQuery selector to select the component precisely.
|
|
954
|
-
* @internal
|
|
955
|
-
* @example
|
|
956
|
-
* `JSXElement:has(JSXAttribute[name.name='component'][value.value='a'])`
|
|
957
|
-
*/
|
|
958
|
-
selector: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
959
|
-
}, {}>>>;
|
|
960
|
-
}, {}>;
|
|
773
|
+
declare const ESLintReactSettingsSchema: z.ZodObject<{
|
|
774
|
+
importSource: z.ZodOptional<z.ZodString>;
|
|
775
|
+
polymorphicPropName: z.ZodOptional<z.ZodString>;
|
|
776
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
777
|
+
skipImportCheck: z.ZodOptional<z.ZodBoolean>;
|
|
778
|
+
version: z.ZodOptional<z.ZodString>;
|
|
779
|
+
additionalHooks: z.ZodOptional<z.ZodObject<{
|
|
780
|
+
use: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
781
|
+
useActionState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
782
|
+
useCallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
783
|
+
useContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
784
|
+
useDebugValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
785
|
+
useDeferredValue: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
786
|
+
useEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
787
|
+
useFormStatus: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
788
|
+
useId: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
789
|
+
useImperativeHandle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
790
|
+
useInsertionEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
791
|
+
useLayoutEffect: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
792
|
+
useMemo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
793
|
+
useOptimistic: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
794
|
+
useReducer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
795
|
+
useRef: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
796
|
+
useState: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
797
|
+
useSyncExternalStore: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
798
|
+
useTransition: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
799
|
+
}, z.core.$strip>>;
|
|
800
|
+
additionalComponents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
801
|
+
name: z.ZodString;
|
|
802
|
+
as: z.ZodOptional<z.ZodString>;
|
|
803
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
804
|
+
name: z.ZodString;
|
|
805
|
+
as: z.ZodOptional<z.ZodString>;
|
|
806
|
+
controlled: z.ZodOptional<z.ZodBoolean>;
|
|
807
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
808
|
+
}, z.core.$strip>>>;
|
|
809
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
810
|
+
}, z.core.$strip>>>;
|
|
811
|
+
}, z.core.$strip>;
|
|
961
812
|
/**
|
|
962
813
|
* @internal
|
|
963
814
|
*/
|
|
964
|
-
declare const ESLintSettingsSchema: z.
|
|
965
|
-
"react-x": z.
|
|
966
|
-
},
|
|
815
|
+
declare const ESLintSettingsSchema: z.ZodOptional<z.ZodObject<{
|
|
816
|
+
"react-x": z.ZodOptional<z.ZodUnknown>;
|
|
817
|
+
}, z.core.$strip>>;
|
|
967
818
|
type CustomComponent = z.infer<typeof CustomComponentSchema>;
|
|
968
819
|
type CustomComponentProp = z.infer<typeof CustomComponentPropSchema>;
|
|
969
820
|
type CustomHooks = z.infer<typeof CustomHooksSchema>;
|
|
@@ -1067,8 +918,6 @@ declare const normalizeSettings: ({ additionalComponents, additionalHooks, impor
|
|
|
1067
918
|
readonly skipImportCheck: boolean;
|
|
1068
919
|
readonly strict: boolean;
|
|
1069
920
|
readonly version: string;
|
|
1070
|
-
readonly jsxPragma?: string | undefined;
|
|
1071
|
-
readonly jsxPragmaFrag?: string | undefined;
|
|
1072
921
|
};
|
|
1073
922
|
declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized;
|
|
1074
923
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import module from '
|
|
2
|
-
import path from '
|
|
1
|
+
import module from 'module';
|
|
2
|
+
import path from 'path';
|
|
3
3
|
import { identity, getOrElseUpdate } from '@eslint-react/eff';
|
|
4
4
|
import { match, P } from 'ts-pattern';
|
|
5
5
|
import { RegExp } from '@eslint-react/kit';
|
|
6
|
-
import
|
|
6
|
+
import { z } from 'zod/v4';
|
|
7
7
|
|
|
8
8
|
// src/_id.ts
|
|
9
9
|
var id = 0n;
|
|
@@ -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.
|
|
@@ -165,8 +152,7 @@ var ESLintReactSettingsSchema = z.object({
|
|
|
165
152
|
var ESLintSettingsSchema = z.optional(
|
|
166
153
|
z.object({
|
|
167
154
|
"react-x": z.optional(z.unknown())
|
|
168
|
-
})
|
|
169
|
-
{}
|
|
155
|
+
})
|
|
170
156
|
);
|
|
171
157
|
function isESLintSettings(settings) {
|
|
172
158
|
return ESLintSettingsSchema.safeParse(settings).success;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.43",
|
|
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.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@eslint-react/eff": "2.0.0-next.
|
|
34
|
-
"@eslint-react/kit": "2.0.0-next.
|
|
30
|
+
"@typescript-eslint/utils": "^8.34.0",
|
|
31
|
+
"ts-pattern": "^5.7.1",
|
|
32
|
+
"zod": "^3.25.63",
|
|
33
|
+
"@eslint-react/eff": "2.0.0-next.43",
|
|
34
|
+
"@eslint-react/kit": "2.0.0-next.43"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@tsconfig/node22": "^22.0.
|
|
37
|
+
"@tsconfig/node22": "^22.0.2",
|
|
38
38
|
"@types/picomatch": "^4.0.0",
|
|
39
|
-
"tsup": "^8.
|
|
40
|
-
"type-fest": "^4.
|
|
39
|
+
"tsup": "^8.5.0",
|
|
40
|
+
"type-fest": "^4.41.0",
|
|
41
41
|
"@local/configs": "0.0.0"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|