@eslint-react/core 5.9.3 → 5.9.5

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -349,7 +349,7 @@ function isRenderMethodCallback(node) {
349
349
  */
350
350
  function isThisSetStateCall(node) {
351
351
  const callee = Extract.unwrap(node.callee);
352
- return callee.type === AST_NODE_TYPES.MemberExpression && callee.object.type === AST_NODE_TYPES.ThisExpression && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "setState";
352
+ return callee.type === AST_NODE_TYPES.MemberExpression && callee.object.type === AST_NODE_TYPES.ThisExpression && Extract.getPropertyName(callee.property) === "setState";
353
353
  }
354
354
  /**
355
355
  * @param node The assignment expression node to check.
@@ -690,10 +690,10 @@ function isFunctionComponentDefinition(context, node, hint) {
690
690
  case parent.type === AST_NODE_TYPES.ArrayExpression:
691
691
  if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayExpressionElement) return false;
692
692
  break;
693
- case parentCallee != null && parentCallee.type === AST_NODE_TYPES.MemberExpression && parentCallee.property.type === AST_NODE_TYPES.Identifier && parentCallee.property.name === "map":
693
+ case parentCallee != null && parentCallee.type === AST_NODE_TYPES.MemberExpression && Extract.getPropertyName(parentCallee.property) === "map":
694
694
  if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayMapCallback) return false;
695
695
  break;
696
- case parentCallee != null && parentCallee.type === AST_NODE_TYPES.MemberExpression && parentCallee.property.type === AST_NODE_TYPES.Identifier && parentCallee.property.name === "flatMap":
696
+ case parentCallee != null && parentCallee.type === AST_NODE_TYPES.MemberExpression && Extract.getPropertyName(parentCallee.property) === "flatMap":
697
697
  if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsArrayFlatMapCallback) return false;
698
698
  break;
699
699
  case parent.type === AST_NODE_TYPES.CallExpression && getFunctionId(node) == null && !isFunctionComponentWrapperCall(context, parent) && !isCreateElementCall(context, parent):
@@ -895,7 +895,7 @@ function isJsxLike(context, node, hint = DEFAULT_JSX_DETECTION_HINT) {
895
895
  const callee = Extract.unwrap(node.callee);
896
896
  switch (callee.type) {
897
897
  case AST_NODE_TYPES.Identifier: return callee.name === "createElement";
898
- case AST_NODE_TYPES.MemberExpression: return callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "createElement";
898
+ case AST_NODE_TYPES.MemberExpression: return Extract.getPropertyName(callee.property) === "createElement";
899
899
  default: return false;
900
900
  }
901
901
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.9.3",
3
+ "version": "5.9.5",
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": {
@@ -33,11 +33,11 @@
33
33
  "@typescript-eslint/types": "^8.62.0",
34
34
  "@typescript-eslint/utils": "^8.62.0",
35
35
  "ts-pattern": "^5.9.0",
36
- "@eslint-react/ast": "5.9.3",
37
- "@eslint-react/eslint": "5.9.3",
38
- "@eslint-react/jsx": "5.9.3",
39
- "@eslint-react/shared": "5.9.3",
40
- "@eslint-react/var": "5.9.3"
36
+ "@eslint-react/ast": "5.9.5",
37
+ "@eslint-react/eslint": "5.9.5",
38
+ "@eslint-react/shared": "5.9.5",
39
+ "@eslint-react/jsx": "5.9.5",
40
+ "@eslint-react/var": "5.9.5"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@typescript-eslint/parser": "^8.62.0",