@eslint-react/core 5.30.0-beta.15 → 5.30.0-beta.16

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
@@ -369,7 +369,7 @@ export type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSe
369
369
  * @param node The function node to analyze.
370
370
  * @returns The identifier node if found, `null` otherwise.
371
371
  */
372
- export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | 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.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
372
+ export declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ClassExpression | TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpressionWithBlockBody | TSESTree.ArrowFunctionExpressionWithExpressionBody | TSESTree.CallExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.TemplateLiteral | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSNonNullExpression | TSESTree.TSTypeAssertion | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.ChainExpression | TSESTree.ConditionalExpression | TSESTree.ImportExpression | TSESTree.LogicalExpression | TSESTree.NewExpression | TSESTree.PrivateIdentifier | TSESTree.TSInstantiationExpression | TSESTree.TSSatisfiesExpression | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldNoStarExpression | TSESTree.YieldStarExpression | null;
373
373
  /**
374
374
  * Get the initialization path of a function node in the AST.
375
375
  *
package/dist/index.js CHANGED
@@ -254,7 +254,7 @@ const isGetDefaultProps = createLifecycleChecker("getDefaultProps", true);
254
254
  const isGetDerivedStateFromProps = createLifecycleChecker("getDerivedStateFromProps", true);
255
255
  const isGetDerivedStateFromError = createLifecycleChecker("getDerivedStateFromError", true);
256
256
  function isRenderMethodLike(node) {
257
- return Check.isPropertyOrMethod(node) && Check.isIdentifier(node.key) && node.key.name.startsWith("render") && Check.isClass(node.parent.parent);
257
+ return Check.isPropertyOrMethod(node) && !node.computed && getStaticKeyName(node.key, node.computed)?.startsWith("render") === true && Check.isClass(node.parent.parent);
258
258
  }
259
259
  function isRenderMethodCallback(node) {
260
260
  let parent = node.parent;
@@ -895,7 +895,7 @@ function getFullyQualifiedNameEx(checker, symbol) {
895
895
  }
896
896
  const namespace = parent.getSourceFile().statements.find((n) => ts.isNamespaceExportDeclaration(n))?.name.text;
897
897
  if (namespace == null) return name;
898
- if (name.startsWith(`${namespace}.`)) return name;
898
+ if (name === namespace || name.startsWith(`${namespace}.`)) return name;
899
899
  return `${namespace}.${name}`;
900
900
  }
901
901
  // src/type-variant.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.30.0-beta.15",
3
+ "version": "5.30.0-beta.16",
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": {
@@ -29,11 +29,11 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/ast": "5.30.0-beta.15",
33
- "@eslint-react/eslint": "5.30.0-beta.15",
34
- "@eslint-react/jsx": "5.30.0-beta.15",
35
- "@eslint-react/shared": "5.30.0-beta.15",
36
- "@eslint-react/var": "5.30.0-beta.15",
32
+ "@eslint-react/ast": "5.30.0-beta.16",
33
+ "@eslint-react/eslint": "5.30.0-beta.16",
34
+ "@eslint-react/jsx": "5.30.0-beta.16",
35
+ "@eslint-react/shared": "5.30.0-beta.16",
36
+ "@eslint-react/var": "5.30.0-beta.16",
37
37
  "@typescript-eslint/types": "^8.72.1",
38
38
  "@typescript-eslint/utils": "^8.72.1",
39
39
  "ts-pattern": "^5.9.2"