@eslint-react/core 5.8.8 → 5.8.9

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 CHANGED
@@ -304,7 +304,7 @@ type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticN
304
304
  * @param node - The function node to analyze.
305
305
  * @returns The identifier node if found, `null` otherwise.
306
306
  */
307
- declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.TemplateLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | TSESTree.PrivateIdentifier | null;
307
+ declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | null;
308
308
  /**
309
309
  * Identifies the initialization path of a function node in the AST.
310
310
  *
package/dist/index.js CHANGED
@@ -357,7 +357,13 @@ function isThisSetStateCall(node) {
357
357
  */
358
358
  function isAssignmentToThisState(node) {
359
359
  const { left } = node;
360
- return left.type === AST_NODE_TYPES.MemberExpression && left.object.type === AST_NODE_TYPES.ThisExpression && Extract.getPropertyName(left.property) === "state";
360
+ let current = Extract.unwrap(left);
361
+ while (current.type === AST_NODE_TYPES.MemberExpression) {
362
+ const { object, property } = current;
363
+ if (object.type === AST_NODE_TYPES.ThisExpression && Extract.getPropertyName(property) === "state") return true;
364
+ current = Extract.unwrap(object);
365
+ }
366
+ return false;
361
367
  }
362
368
 
363
369
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.8.8",
3
+ "version": "5.8.9",
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.60.0",
34
34
  "@typescript-eslint/utils": "^8.60.0",
35
35
  "ts-pattern": "^5.9.0",
36
- "@eslint-react/ast": "5.8.8",
37
- "@eslint-react/eslint": "5.8.8",
38
- "@eslint-react/shared": "5.8.8",
39
- "@eslint-react/var": "5.8.8",
40
- "@eslint-react/jsx": "5.8.8"
36
+ "@eslint-react/ast": "5.8.9",
37
+ "@eslint-react/eslint": "5.8.9",
38
+ "@eslint-react/shared": "5.8.9",
39
+ "@eslint-react/jsx": "5.8.9",
40
+ "@eslint-react/var": "5.8.9"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@typescript-eslint/parser": "^8.60.0",
@@ -46,8 +46,8 @@
46
46
  "tsdown": "^0.22.1",
47
47
  "typescript": "5.9.3",
48
48
  "vitest": "^4.1.7",
49
- "@local/eff": "3.0.0-beta.72",
50
- "@local/configs": "0.0.0"
49
+ "@local/configs": "0.0.0",
50
+ "@local/eff": "3.0.0-beta.72"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "eslint": "^10.3.0",