@eslint-react/core 1.45.0 → 1.45.1-beta.0

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
@@ -365,6 +365,12 @@ declare function useHookCollector(): useHookCollector.ReturnType;
365
365
 
366
366
  type HookKind = "custom" | "useActionState" | "useCallback" | "useContext" | "useDebugValue" | "useDeferredValue" | "useEffect" | "useId" | "useImperativeHandle" | "useInsertionEffect" | "useLayoutEffect" | "useMemo" | "useOptimistic" | "useReducer" | "useRef" | "useState" | "useSyncExternalStore" | "useTransition";
367
367
 
368
+ /**
369
+ * Catch all identifiers that begin with "use" followed by an uppercase Latin
370
+ * character to exclude identifiers like "user".
371
+ * @param name The name of the identifier to check.
372
+ * @see https://github.com/facebook/react/blob/1d6c8168db1d82713202e842df3167787ffa00ed/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L16
373
+ */
368
374
  declare function isReactHookName(name: string): boolean;
369
375
 
370
376
  declare function isReactHook(node: AST.TSESTreeFunction | _): boolean;
package/dist/index.d.ts CHANGED
@@ -365,6 +365,12 @@ declare function useHookCollector(): useHookCollector.ReturnType;
365
365
 
366
366
  type HookKind = "custom" | "useActionState" | "useCallback" | "useContext" | "useDebugValue" | "useDeferredValue" | "useEffect" | "useId" | "useImperativeHandle" | "useInsertionEffect" | "useLayoutEffect" | "useMemo" | "useOptimistic" | "useReducer" | "useRef" | "useState" | "useSyncExternalStore" | "useTransition";
367
367
 
368
+ /**
369
+ * Catch all identifiers that begin with "use" followed by an uppercase Latin
370
+ * character to exclude identifiers like "user".
371
+ * @param name The name of the identifier to check.
372
+ * @see https://github.com/facebook/react/blob/1d6c8168db1d82713202e842df3167787ffa00ed/packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts#L16
373
+ */
368
374
  declare function isReactHookName(name: string): boolean;
369
375
 
370
376
  declare function isReactHook(node: AST.TSESTreeFunction | _): boolean;
package/dist/index.js CHANGED
@@ -1549,7 +1549,7 @@ var isLazyCall = isReactAPICall("lazy");
1549
1549
 
1550
1550
  // src/hook/hook-name.ts
1551
1551
  function isReactHookName(name) {
1552
- return name.startsWith("use");
1552
+ return name === "use" || /^use[A-Z0-9]/.test(name);
1553
1553
  }
1554
1554
 
1555
1555
  // src/hook/is.ts
package/dist/index.mjs CHANGED
@@ -1522,7 +1522,7 @@ var isLazyCall = isReactAPICall("lazy");
1522
1522
 
1523
1523
  // src/hook/hook-name.ts
1524
1524
  function isReactHookName(name) {
1525
- return name.startsWith("use");
1525
+ return name === "use" || /^use[A-Z0-9]/.test(name);
1526
1526
  }
1527
1527
 
1528
1528
  // src/hook/is.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "1.45.0",
3
+ "version": "1.45.1-beta.0",
4
4
  "description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -41,12 +41,12 @@
41
41
  "@typescript-eslint/utils": "^8.29.1",
42
42
  "birecord": "^0.1.1",
43
43
  "ts-pattern": "^5.7.0",
44
- "@eslint-react/ast": "1.45.0",
45
- "@eslint-react/eff": "1.45.0",
46
- "@eslint-react/jsx": "1.45.0",
47
- "@eslint-react/kit": "1.45.0",
48
- "@eslint-react/shared": "1.45.0",
49
- "@eslint-react/var": "1.45.0"
44
+ "@eslint-react/ast": "1.45.1-beta.0",
45
+ "@eslint-react/eff": "1.45.1-beta.0",
46
+ "@eslint-react/shared": "1.45.1-beta.0",
47
+ "@eslint-react/kit": "1.45.1-beta.0",
48
+ "@eslint-react/var": "1.45.1-beta.0",
49
+ "@eslint-react/jsx": "1.45.1-beta.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "tsup": "^8.4.0",