@eslint-react/core 1.38.1-next.2 → 1.38.1-next.3

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
@@ -260,8 +260,8 @@ declare const DISPLAY_NAME_ASSIGNMENT_SELECTOR: string;
260
260
 
261
261
  type EREffectKind = "useEffect" | "useLayoutEffect" | "useInsertionEffect";
262
262
 
263
- declare function isFunctionOfUseEffectSetup(node: TSESTree.Node | _): boolean | undefined;
264
- declare function isFunctionOfUseEffectCleanup(node: TSESTree.Node | _): boolean | undefined;
263
+ declare function isFunctionOfUseEffectSetup(node: TSESTree.Node | _): boolean;
264
+ declare function isFunctionOfUseEffectCleanup(node: TSESTree.Node | _): boolean;
265
265
 
266
266
  interface ERHook extends ERSemanticNode {
267
267
  id: TSESTree.Identifier | _;
@@ -286,7 +286,7 @@ declare const RE_HOOK_NAME: RegExp;
286
286
  declare function isReactHookName(name: string): boolean;
287
287
  declare function isReactHookNameLoose(name: string): boolean;
288
288
 
289
- declare function isReactHook(node: AST.TSESTreeFunction | _): boolean | undefined;
289
+ declare function isReactHook(node: AST.TSESTreeFunction | _): boolean;
290
290
  /**
291
291
  * Check if the given node is a React Hook call by its name.
292
292
  * @param node The node to check.
package/dist/index.d.ts CHANGED
@@ -260,8 +260,8 @@ declare const DISPLAY_NAME_ASSIGNMENT_SELECTOR: string;
260
260
 
261
261
  type EREffectKind = "useEffect" | "useLayoutEffect" | "useInsertionEffect";
262
262
 
263
- declare function isFunctionOfUseEffectSetup(node: TSESTree.Node | _): boolean | undefined;
264
- declare function isFunctionOfUseEffectCleanup(node: TSESTree.Node | _): boolean | undefined;
263
+ declare function isFunctionOfUseEffectSetup(node: TSESTree.Node | _): boolean;
264
+ declare function isFunctionOfUseEffectCleanup(node: TSESTree.Node | _): boolean;
265
265
 
266
266
  interface ERHook extends ERSemanticNode {
267
267
  id: TSESTree.Identifier | _;
@@ -286,7 +286,7 @@ declare const RE_HOOK_NAME: RegExp;
286
286
  declare function isReactHookName(name: string): boolean;
287
287
  declare function isReactHookNameLoose(name: string): boolean;
288
288
 
289
- declare function isReactHook(node: AST.TSESTreeFunction | _): boolean | undefined;
289
+ declare function isReactHook(node: AST.TSESTreeFunction | _): boolean;
290
290
  /**
291
291
  * Check if the given node is a React Hook call by its name.
292
292
  * @param node The node to check.
package/dist/index.js CHANGED
@@ -663,7 +663,7 @@ var isMemoCall = isReactAPICall("memo");
663
663
 
664
664
  // src/hook/is.ts
665
665
  function isReactHook(node) {
666
- if (node == null) return eff._;
666
+ if (node == null) return false;
667
667
  const id = AST6__namespace.getFunctionIdentifier(node);
668
668
  return id?.name != null && isReactHookName(id.name);
669
669
  }
@@ -1202,11 +1202,11 @@ function isAssignmentToThisState(node) {
1202
1202
  return left.type === types.AST_NODE_TYPES.MemberExpression && AST6__namespace.isThisExpression(left.object) && AST6__namespace.getPropertyName(left.property) === "state";
1203
1203
  }
1204
1204
  function isFunctionOfUseEffectSetup(node) {
1205
- if (node == null) return eff._;
1205
+ if (node == null) return false;
1206
1206
  return node.parent?.type === types.AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === types.AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
1207
1207
  }
1208
1208
  function isFunctionOfUseEffectCleanup(node) {
1209
- if (node == null) return eff._;
1209
+ if (node == null) return false;
1210
1210
  const returnStatement = AST6__namespace.findParentNode(node, AST6__namespace.is(types.AST_NODE_TYPES.ReturnStatement));
1211
1211
  const enclosingFunction = AST6__namespace.findParentNode(node, AST6__namespace.isFunction);
1212
1212
  const functionOfReturnStatement = AST6__namespace.findParentNode(returnStatement, AST6__namespace.isFunction);
package/dist/index.mjs CHANGED
@@ -636,7 +636,7 @@ var isMemoCall = isReactAPICall("memo");
636
636
 
637
637
  // src/hook/is.ts
638
638
  function isReactHook(node) {
639
- if (node == null) return _;
639
+ if (node == null) return false;
640
640
  const id = AST6.getFunctionIdentifier(node);
641
641
  return id?.name != null && isReactHookName(id.name);
642
642
  }
@@ -1175,11 +1175,11 @@ function isAssignmentToThisState(node) {
1175
1175
  return left.type === AST_NODE_TYPES.MemberExpression && AST6.isThisExpression(left.object) && AST6.getPropertyName(left.property) === "state";
1176
1176
  }
1177
1177
  function isFunctionOfUseEffectSetup(node) {
1178
- if (node == null) return _;
1178
+ if (node == null) return false;
1179
1179
  return node.parent?.type === AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
1180
1180
  }
1181
1181
  function isFunctionOfUseEffectCleanup(node) {
1182
- if (node == null) return _;
1182
+ if (node == null) return false;
1183
1183
  const returnStatement = AST6.findParentNode(node, AST6.is(AST_NODE_TYPES.ReturnStatement));
1184
1184
  const enclosingFunction = AST6.findParentNode(node, AST6.isFunction);
1185
1185
  const functionOfReturnStatement = AST6.findParentNode(returnStatement, AST6.isFunction);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "1.38.1-next.2",
3
+ "version": "1.38.1-next.3",
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.28.0",
42
42
  "birecord": "^0.1.1",
43
43
  "ts-pattern": "^5.6.2",
44
- "@eslint-react/ast": "1.38.1-next.2",
45
- "@eslint-react/eff": "1.38.1-next.2",
46
- "@eslint-react/jsx": "1.38.1-next.2",
47
- "@eslint-react/shared": "1.38.1-next.2",
48
- "@eslint-react/kit": "1.38.1-next.2",
49
- "@eslint-react/var": "1.38.1-next.2"
44
+ "@eslint-react/ast": "1.38.1-next.3",
45
+ "@eslint-react/eff": "1.38.1-next.3",
46
+ "@eslint-react/kit": "1.38.1-next.3",
47
+ "@eslint-react/shared": "1.38.1-next.3",
48
+ "@eslint-react/var": "1.38.1-next.3",
49
+ "@eslint-react/jsx": "1.38.1-next.3"
50
50
  },
51
51
  "devDependencies": {
52
52
  "tsup": "^8.4.0",