@eslint-react/core 5.2.5-beta.0 → 5.2.5-beta.1

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
@@ -315,7 +315,7 @@ type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticN
315
315
  * @param node - The function node to analyze.
316
316
  * @returns The identifier node if found, `null` otherwise.
317
317
  */
318
- 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;
318
+ 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;
319
319
  /**
320
320
  * Identifies the initialization path of a function node in the AST.
321
321
  *
package/dist/index.js CHANGED
@@ -309,7 +309,7 @@ function isPureComponent(node) {
309
309
  return false;
310
310
  }
311
311
  function createLifecycleChecker(methodName, isStatic = false) {
312
- return (node) => Check.isMethodOrProperty(node) && node.static === isStatic && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === methodName;
312
+ return (node) => Check.isPropertyOrMethod(node) && node.static === isStatic && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === methodName;
313
313
  }
314
314
  /** @deprecated Class components are legacy. */
315
315
  const isRender = createLifecycleChecker("render");
@@ -352,7 +352,7 @@ const isGetDerivedStateFromError = createLifecycleChecker("getDerivedStateFromEr
352
352
  * @deprecated Class components are legacy. This function exists only to support legacy rules.
353
353
  */
354
354
  function isRenderMethodLike(node) {
355
- return Check.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name.startsWith("render") && isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression])(node.parent.parent);
355
+ return Check.isPropertyOrMethod(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name.startsWith("render") && isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression])(node.parent.parent);
356
356
  }
357
357
  function isRenderMethodCallback(node) {
358
358
  const parent = node.parent;
@@ -436,7 +436,7 @@ function getFunctionId(node) {
436
436
  case node.parent.type === AST_NODE_TYPES.VariableDeclarator && node.parent.init === node: return node.parent.id;
437
437
  case node.parent.type === AST_NODE_TYPES.AssignmentExpression && node.parent.right === node && node.parent.operator === "=": return node.parent.left;
438
438
  case node.parent.type === AST_NODE_TYPES.Property && node.parent.value === node && !node.parent.computed: return node.parent.key;
439
- case Check.isMethodOrProperty(node.parent) && node.parent.value === node: return node.parent.key;
439
+ case Check.isPropertyOrMethod(node.parent) && node.parent.value === node: return node.parent.key;
440
440
  case node.parent.type === AST_NODE_TYPES.AssignmentPattern && node.parent.right === node: return node.parent.left;
441
441
  case node.parent.type === AST_NODE_TYPES.ConditionalExpression: return getFunctionId(node.parent);
442
442
  case Check.isTypeAssertionExpression(node.parent): return getFunctionId(node.parent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.2.5-beta.0",
3
+ "version": "5.2.5-beta.1",
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": {
@@ -34,11 +34,11 @@
34
34
  "@typescript-eslint/types": "^8.58.2",
35
35
  "@typescript-eslint/utils": "^8.58.2",
36
36
  "ts-pattern": "^5.9.0",
37
- "@eslint-react/ast": "5.2.5-beta.0",
38
- "@eslint-react/eslint": "5.2.5-beta.0",
39
- "@eslint-react/jsx": "5.2.5-beta.0",
40
- "@eslint-react/shared": "5.2.5-beta.0",
41
- "@eslint-react/var": "5.2.5-beta.0"
37
+ "@eslint-react/ast": "5.2.5-beta.1",
38
+ "@eslint-react/jsx": "5.2.5-beta.1",
39
+ "@eslint-react/eslint": "5.2.5-beta.1",
40
+ "@eslint-react/shared": "5.2.5-beta.1",
41
+ "@eslint-react/var": "5.2.5-beta.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@typescript-eslint/typescript-estree": "^8.58.2",