@eslint-react/shared 1.23.3-next.0 → 1.23.3-next.2

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.mts CHANGED
@@ -1,5 +1,57 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- import { E } from '@eslint-react/eff';
2
+
3
+ /**
4
+ * The NPM scope for this project.
5
+ */
6
+ declare const NPM_SCOPE = "@eslint-react";
7
+ /**
8
+ * The GitHub repository for this project.
9
+ */
10
+ declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
11
+ /**
12
+ * The URL to the project's website.
13
+ */
14
+ declare const WEBSITE_URL = "https://eslint-react.xyz";
15
+ /**
16
+ * Regular expression for matching a PascalCase string.
17
+ */
18
+ declare const RE_PASCAL_CASE: RegExp;
19
+ /**
20
+ * Regular expression for matching a camelCase string.
21
+ */
22
+ declare const RE_CAMEL_CASE: RegExp;
23
+ /**
24
+ * Regular expression for matching a kebab-case string.
25
+ */
26
+ declare const RE_KEBAB_CASE: RegExp;
27
+ /**
28
+ * Regular expression for matching a snake_case string.
29
+ */
30
+ declare const RE_SNAKE_CASE: RegExp;
31
+ /**
32
+ * Regular expression for matching a CONSTANT_CASE string.
33
+ */
34
+ declare const RE_CONSTANT_CASE: RegExp;
35
+ declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
36
+ /**
37
+ * @internal
38
+ */
39
+ declare const DOM_HTML_COMPONENT_TYPES: readonly ["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"];
40
+ /**
41
+ * @internal
42
+ */
43
+ declare const DOM_SVG_COMPONENT_TYPES: readonly ["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"];
44
+ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
45
+
46
+ /**
47
+ * Get the ESLint rule creator for a plugin.
48
+ * @internal
49
+ * @param pluginName The name of the plugin.
50
+ * @returns The ESLint rule creator.
51
+ */
52
+ declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
53
+
54
+ declare function getReactVersion(fallback?: string): string;
3
55
 
4
56
  /**
5
57
  * Schema with pipe type.
@@ -1869,101 +1921,6 @@ interface ESLintReactSettingsNormalized extends ESLintReactSettings {
1869
1921
  version: string;
1870
1922
  }
1871
1923
 
1872
- declare const normalizedSettingsCache: WeakMap<{
1873
- importSource?: string;
1874
- jsxPragma?: string;
1875
- jsxPragmaFrag?: string;
1876
- polymorphicPropName?: string;
1877
- strict?: boolean;
1878
- strictImportCheck?: boolean;
1879
- version?: string;
1880
- additionalComponents?: {
1881
- name: string;
1882
- as?: string;
1883
- selector?: string;
1884
- attributes?: {
1885
- name: string;
1886
- as?: string;
1887
- controlled?: boolean;
1888
- defaultValue?: string;
1889
- }[];
1890
- }[];
1891
- additionalHooks?: {
1892
- use?: string[];
1893
- useActionState?: string[];
1894
- useCallback?: string[];
1895
- useContext?: string[];
1896
- useDebugValue?: string[];
1897
- useDeferredValue?: string[];
1898
- useEffect?: string[];
1899
- useFormStatus?: string[];
1900
- useId?: string[];
1901
- useImperativeHandle?: string[];
1902
- useInsertionEffect?: string[];
1903
- useLayoutEffect?: string[];
1904
- useMemo?: string[];
1905
- useOptimistic?: string[];
1906
- useReducer?: string[];
1907
- useRef?: string[];
1908
- useState?: string[];
1909
- useSyncExternalStore?: string[];
1910
- useTransition?: string[];
1911
- };
1912
- }, ESLintReactSettingsNormalized>;
1913
-
1914
- /**
1915
- * The NPM scope for this project.
1916
- */
1917
- declare const NPM_SCOPE = "@eslint-react";
1918
- /**
1919
- * The GitHub repository for this project.
1920
- */
1921
- declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
1922
- /**
1923
- * The URL to the project's website.
1924
- */
1925
- declare const WEBSITE_URL = "https://eslint-react.xyz";
1926
- /**
1927
- * Regular expression for matching a PascalCase string.
1928
- */
1929
- declare const RE_PASCAL_CASE: RegExp;
1930
- /**
1931
- * Regular expression for matching a camelCase string.
1932
- */
1933
- declare const RE_CAMEL_CASE: RegExp;
1934
- /**
1935
- * Regular expression for matching a kebab-case string.
1936
- */
1937
- declare const RE_KEBAB_CASE: RegExp;
1938
- /**
1939
- * Regular expression for matching a snake_case string.
1940
- */
1941
- declare const RE_SNAKE_CASE: RegExp;
1942
- /**
1943
- * Regular expression for matching a CONSTANT_CASE string.
1944
- */
1945
- declare const RE_CONSTANT_CASE: RegExp;
1946
- declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
1947
- /**
1948
- * @internal
1949
- */
1950
- declare const DOM_HTML_COMPONENT_TYPES: readonly ["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"];
1951
- /**
1952
- * @internal
1953
- */
1954
- declare const DOM_SVG_COMPONENT_TYPES: readonly ["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"];
1955
- declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
1956
-
1957
- /**
1958
- * Get the ESLint rule creator for a plugin.
1959
- * @internal
1960
- * @param pluginName The name of the plugin.
1961
- * @returns The ESLint rule creator.
1962
- */
1963
- declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
1964
-
1965
- declare function getReactVersion(at?: string): E.Either<string, unknown>;
1966
-
1967
1924
  interface Dictionary<Type> {
1968
1925
  [key: string]: Type;
1969
1926
  [index: number]: Type;
@@ -2249,6 +2206,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2249
2206
  }
2250
2207
  }
2251
2208
 
2252
- declare function tryRequire(id: string, at?: string): E.Either<unknown, Error>;
2253
-
2254
- export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, normalizedSettingsCache, tryRequire, unsafeDecodeSettings };
2209
+ export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, unsafeDecodeSettings };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,57 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- import { E } from '@eslint-react/eff';
2
+
3
+ /**
4
+ * The NPM scope for this project.
5
+ */
6
+ declare const NPM_SCOPE = "@eslint-react";
7
+ /**
8
+ * The GitHub repository for this project.
9
+ */
10
+ declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
11
+ /**
12
+ * The URL to the project's website.
13
+ */
14
+ declare const WEBSITE_URL = "https://eslint-react.xyz";
15
+ /**
16
+ * Regular expression for matching a PascalCase string.
17
+ */
18
+ declare const RE_PASCAL_CASE: RegExp;
19
+ /**
20
+ * Regular expression for matching a camelCase string.
21
+ */
22
+ declare const RE_CAMEL_CASE: RegExp;
23
+ /**
24
+ * Regular expression for matching a kebab-case string.
25
+ */
26
+ declare const RE_KEBAB_CASE: RegExp;
27
+ /**
28
+ * Regular expression for matching a snake_case string.
29
+ */
30
+ declare const RE_SNAKE_CASE: RegExp;
31
+ /**
32
+ * Regular expression for matching a CONSTANT_CASE string.
33
+ */
34
+ declare const RE_CONSTANT_CASE: RegExp;
35
+ declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
36
+ /**
37
+ * @internal
38
+ */
39
+ declare const DOM_HTML_COMPONENT_TYPES: readonly ["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"];
40
+ /**
41
+ * @internal
42
+ */
43
+ declare const DOM_SVG_COMPONENT_TYPES: readonly ["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"];
44
+ declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
45
+
46
+ /**
47
+ * Get the ESLint rule creator for a plugin.
48
+ * @internal
49
+ * @param pluginName The name of the plugin.
50
+ * @returns The ESLint rule creator.
51
+ */
52
+ declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
53
+
54
+ declare function getReactVersion(fallback?: string): string;
3
55
 
4
56
  /**
5
57
  * Schema with pipe type.
@@ -1869,101 +1921,6 @@ interface ESLintReactSettingsNormalized extends ESLintReactSettings {
1869
1921
  version: string;
1870
1922
  }
1871
1923
 
1872
- declare const normalizedSettingsCache: WeakMap<{
1873
- importSource?: string;
1874
- jsxPragma?: string;
1875
- jsxPragmaFrag?: string;
1876
- polymorphicPropName?: string;
1877
- strict?: boolean;
1878
- strictImportCheck?: boolean;
1879
- version?: string;
1880
- additionalComponents?: {
1881
- name: string;
1882
- as?: string;
1883
- selector?: string;
1884
- attributes?: {
1885
- name: string;
1886
- as?: string;
1887
- controlled?: boolean;
1888
- defaultValue?: string;
1889
- }[];
1890
- }[];
1891
- additionalHooks?: {
1892
- use?: string[];
1893
- useActionState?: string[];
1894
- useCallback?: string[];
1895
- useContext?: string[];
1896
- useDebugValue?: string[];
1897
- useDeferredValue?: string[];
1898
- useEffect?: string[];
1899
- useFormStatus?: string[];
1900
- useId?: string[];
1901
- useImperativeHandle?: string[];
1902
- useInsertionEffect?: string[];
1903
- useLayoutEffect?: string[];
1904
- useMemo?: string[];
1905
- useOptimistic?: string[];
1906
- useReducer?: string[];
1907
- useRef?: string[];
1908
- useState?: string[];
1909
- useSyncExternalStore?: string[];
1910
- useTransition?: string[];
1911
- };
1912
- }, ESLintReactSettingsNormalized>;
1913
-
1914
- /**
1915
- * The NPM scope for this project.
1916
- */
1917
- declare const NPM_SCOPE = "@eslint-react";
1918
- /**
1919
- * The GitHub repository for this project.
1920
- */
1921
- declare const GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
1922
- /**
1923
- * The URL to the project's website.
1924
- */
1925
- declare const WEBSITE_URL = "https://eslint-react.xyz";
1926
- /**
1927
- * Regular expression for matching a PascalCase string.
1928
- */
1929
- declare const RE_PASCAL_CASE: RegExp;
1930
- /**
1931
- * Regular expression for matching a camelCase string.
1932
- */
1933
- declare const RE_CAMEL_CASE: RegExp;
1934
- /**
1935
- * Regular expression for matching a kebab-case string.
1936
- */
1937
- declare const RE_KEBAB_CASE: RegExp;
1938
- /**
1939
- * Regular expression for matching a snake_case string.
1940
- */
1941
- declare const RE_SNAKE_CASE: RegExp;
1942
- /**
1943
- * Regular expression for matching a CONSTANT_CASE string.
1944
- */
1945
- declare const RE_CONSTANT_CASE: RegExp;
1946
- declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
1947
- /**
1948
- * @internal
1949
- */
1950
- declare const DOM_HTML_COMPONENT_TYPES: readonly ["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"];
1951
- /**
1952
- * @internal
1953
- */
1954
- declare const DOM_SVG_COMPONENT_TYPES: readonly ["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"];
1955
- declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
1956
-
1957
- /**
1958
- * Get the ESLint rule creator for a plugin.
1959
- * @internal
1960
- * @param pluginName The name of the plugin.
1961
- * @returns The ESLint rule creator.
1962
- */
1963
- declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
1964
-
1965
- declare function getReactVersion(at?: string): E.Either<string, unknown>;
1966
-
1967
1924
  interface Dictionary<Type> {
1968
1925
  [key: string]: Type;
1969
1926
  [index: number]: Type;
@@ -2249,6 +2206,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2249
2206
  }
2250
2207
  }
2251
2208
 
2252
- declare function tryRequire(id: string, at?: string): E.Either<unknown, Error>;
2253
-
2254
- export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, normalizedSettingsCache, tryRequire, unsafeDecodeSettings };
2209
+ export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, unsafeDecodeSettings };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var utils = require('@typescript-eslint/utils');
4
+ var module$1 = require('module');
4
5
  var eff = require('@eslint-react/eff');
5
6
  var tsPattern = require('ts-pattern');
6
- var module$1 = require('module');
7
7
  var pm = require('picomatch');
8
8
 
9
9
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -12,9 +12,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
  var module__default = /*#__PURE__*/_interopDefault(module$1);
13
13
  var pm__default = /*#__PURE__*/_interopDefault(pm);
14
14
 
15
- // src/cache.ts
16
- var normalizedSettingsCache = /* @__PURE__ */ new WeakMap();
17
-
18
15
  // src/constants.ts
19
16
  var NPM_SCOPE = "@eslint-react";
20
17
  var GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
@@ -224,24 +221,15 @@ var getDocsUrl = (pluginName) => (ruleName) => {
224
221
  return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
225
222
  };
226
223
  var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName));
227
- function tryRequire(id, at = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))) {
228
- const _require = module__default.default.createRequire(at);
224
+ var _require = module__default.default.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
225
+ function getReactVersion(fallback = "19.0.0") {
229
226
  try {
230
- return eff.E.right(_require(id));
227
+ return tsPattern.match(_require("react")).with({ version: tsPattern.P.select(tsPattern.P.string) }, eff.F.identity).otherwise(eff.F.constant(fallback));
231
228
  } catch {
232
- return eff.E.left(new Error(`Module '${id}' not found`));
229
+ return fallback;
233
230
  }
234
231
  }
235
232
 
236
- // src/get-react-version.ts
237
- function getReactVersion(at = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))) {
238
- return eff.F.pipe(
239
- tryRequire("react", at),
240
- eff.E.filterOrLeft(tsPattern.isMatching({ version: tsPattern.P.string }), eff.F.identity),
241
- eff.E.map((mod) => mod.version)
242
- );
243
- }
244
-
245
233
  // ../../node_modules/.pnpm/valibot@1.0.0-beta.11_typescript@5.7.2/node_modules/valibot/dist/index.js
246
234
  var store;
247
235
  // @__NO_SIDE_EFFECTS__
@@ -1447,7 +1435,7 @@ var normalizeSettings = createMemoizedFunction((settings) => {
1447
1435
  }
1448
1436
  return acc.set(name, as);
1449
1437
  }, /* @__PURE__ */ new Map()),
1450
- version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => eff.E.getOrElse(getReactVersion(), eff.F.constant("19.0.0"))).otherwise(eff.F.identity)
1438
+ version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => getReactVersion("19.0.0")).otherwise(eff.F.identity)
1451
1439
  };
1452
1440
  }, { isEqual: shallowEqual });
1453
1441
  function getSettingsFromContext(context) {
@@ -1480,6 +1468,4 @@ exports.defineSettings = defineSettings;
1480
1468
  exports.getReactVersion = getReactVersion;
1481
1469
  exports.getSettingsFromContext = getSettingsFromContext;
1482
1470
  exports.normalizeSettings = normalizeSettings;
1483
- exports.normalizedSettingsCache = normalizedSettingsCache;
1484
- exports.tryRequire = tryRequire;
1485
1471
  exports.unsafeDecodeSettings = unsafeDecodeSettings;
package/dist/index.mjs CHANGED
@@ -1,12 +1,9 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- import { F, E } from '@eslint-react/eff';
3
- import { isMatching, P, match } from 'ts-pattern';
4
2
  import module from 'node:module';
3
+ import { F } from '@eslint-react/eff';
4
+ import { match, P } from 'ts-pattern';
5
5
  import pm from 'picomatch';
6
6
 
7
- // src/cache.ts
8
- var normalizedSettingsCache = /* @__PURE__ */ new WeakMap();
9
-
10
7
  // src/constants.ts
11
8
  var NPM_SCOPE = "@eslint-react";
12
9
  var GITHUB_URL = "https://github.com/rEl1cx/eslint-react";
@@ -216,24 +213,15 @@ var getDocsUrl = (pluginName) => (ruleName) => {
216
213
  return `${WEBSITE_URL}/docs/rules/${pluginName}-${ruleName}`;
217
214
  };
218
215
  var createRuleForPlugin = (pluginName) => ESLintUtils.RuleCreator(getDocsUrl(pluginName));
219
- function tryRequire(id, at = import.meta.url) {
220
- const _require = module.createRequire(at);
216
+ var _require = module.createRequire(import.meta.url);
217
+ function getReactVersion(fallback = "19.0.0") {
221
218
  try {
222
- return E.right(_require(id));
219
+ return match(_require("react")).with({ version: P.select(P.string) }, F.identity).otherwise(F.constant(fallback));
223
220
  } catch {
224
- return E.left(new Error(`Module '${id}' not found`));
221
+ return fallback;
225
222
  }
226
223
  }
227
224
 
228
- // src/get-react-version.ts
229
- function getReactVersion(at = import.meta.url) {
230
- return F.pipe(
231
- tryRequire("react", at),
232
- E.filterOrLeft(isMatching({ version: P.string }), F.identity),
233
- E.map((mod) => mod.version)
234
- );
235
- }
236
-
237
225
  // ../../node_modules/.pnpm/valibot@1.0.0-beta.11_typescript@5.7.2/node_modules/valibot/dist/index.js
238
226
  var store;
239
227
  // @__NO_SIDE_EFFECTS__
@@ -1439,7 +1427,7 @@ var normalizeSettings = createMemoizedFunction((settings) => {
1439
1427
  }
1440
1428
  return acc.set(name, as);
1441
1429
  }, /* @__PURE__ */ new Map()),
1442
- version: match(settings.version).with(P.union(P.nullish, "", "detect"), () => E.getOrElse(getReactVersion(), F.constant("19.0.0"))).otherwise(F.identity)
1430
+ version: match(settings.version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.0.0")).otherwise(F.identity)
1443
1431
  };
1444
1432
  }, { isEqual: shallowEqual });
1445
1433
  function getSettingsFromContext(context) {
@@ -1447,4 +1435,4 @@ function getSettingsFromContext(context) {
1447
1435
  }
1448
1436
  var defineSettings = F.identity;
1449
1437
 
1450
- export { CustomAttributeSchema, CustomComponentNormalizedSchema, CustomComponentSchema, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, normalizedSettingsCache, tryRequire, unsafeDecodeSettings };
1438
+ export { CustomAttributeSchema, CustomComponentNormalizedSchema, CustomComponentSchema, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, DOM_HTML_COMPONENT_TYPES, DOM_SVG_COMPONENT_TYPES, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getReactVersion, getSettingsFromContext, normalizeSettings, unsafeDecodeSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.23.3-next.0",
3
+ "version": "1.23.3-next.2",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/rEl1cx/eslint-react",
6
6
  "bugs": {
@@ -38,7 +38,7 @@
38
38
  "@typescript-eslint/utils": "^8.19.1",
39
39
  "picomatch": "^4.0.2",
40
40
  "ts-pattern": "^5.6.0",
41
- "@eslint-react/eff": "1.23.3-next.0"
41
+ "@eslint-react/eff": "1.23.3-next.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/picomatch": "^3.0.1",