@eslint-react/core 5.11.2 → 5.11.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.ts CHANGED
@@ -451,9 +451,9 @@ declare const FunctionComponentDetectionHint: {
451
451
  readonly DoNotIncludeFunctionDefinedAsObjectMethod: bigint;
452
452
  readonly DoNotIncludeFunctionDefinedAsArrayExpressionElement: bigint;
453
453
  readonly DoNotIncludeFunctionDefinedAsArrayPatternElement: bigint;
454
- readonly DoNotIncludeFunctionDefinedAsArbitraryCallExpressionCallback: bigint;
455
454
  readonly DoNotIncludeFunctionDefinedAsArrayFlatMapCallback: bigint;
456
455
  readonly DoNotIncludeFunctionDefinedAsArrayMapCallback: bigint;
456
+ readonly DoNotIncludeFunctionDefinedAsArbitraryCallExpressionCallback: bigint;
457
457
  readonly None: 0n;
458
458
  readonly DoNotIncludeJsxWithNullValue: bigint;
459
459
  readonly DoNotIncludeJsxWithNumberValue: bigint;
package/dist/index.js CHANGED
@@ -577,9 +577,11 @@ function getFunctionComponentId(context, node) {
577
577
  if (functionId != null) return functionId;
578
578
  let parent = node.parent;
579
579
  while (Check.isTypeExpression(parent)) parent = parent.parent;
580
- if (parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent) && parent.parent.type === AST_NODE_TYPES.VariableDeclarator) return parent.parent.id;
581
- if (parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent) && parent.parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent.parent) && parent.parent.parent.type === AST_NODE_TYPES.VariableDeclarator) return parent.parent.parent.id;
582
- return null;
580
+ switch (true) {
581
+ case parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent) && parent.parent.type === AST_NODE_TYPES.VariableDeclarator: return parent.parent.id;
582
+ case parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent) && parent.parent.type === AST_NODE_TYPES.CallExpression && isFunctionComponentWrapperCall(context, parent.parent) && parent.parent.parent.type === AST_NODE_TYPES.VariableDeclarator: return parent.parent.parent.id;
583
+ default: return null;
584
+ }
583
585
  }
584
586
  /**
585
587
  * Check if a string matches the strict component name pattern
@@ -619,9 +621,9 @@ const FunctionComponentDetectionHint = {
619
621
  DoNotIncludeFunctionDefinedAsObjectMethod: 1n << 13n,
620
622
  DoNotIncludeFunctionDefinedAsArrayExpressionElement: 1n << 14n,
621
623
  DoNotIncludeFunctionDefinedAsArrayPatternElement: 1n << 15n,
622
- DoNotIncludeFunctionDefinedAsArbitraryCallExpressionCallback: 1n << 18n,
623
624
  DoNotIncludeFunctionDefinedAsArrayFlatMapCallback: 1n << 16n,
624
- DoNotIncludeFunctionDefinedAsArrayMapCallback: 1n << 17n
625
+ DoNotIncludeFunctionDefinedAsArrayMapCallback: 1n << 17n,
626
+ DoNotIncludeFunctionDefinedAsArbitraryCallExpressionCallback: 1n << 18n
625
627
  };
626
628
  /**
627
629
  * Default component detection hint
@@ -657,7 +659,7 @@ function isFunctionComponentDefinition(context, node, hint) {
657
659
  case Check.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(node) && parent.type === AST_NODE_TYPES.MethodDefinition:
658
660
  if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsClassMethod) return false;
659
661
  break;
660
- case Check.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(node) && parent.type === AST_NODE_TYPES.Property:
662
+ case Check.isOneOf([AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionExpression])(node) && parent.type === AST_NODE_TYPES.PropertyDefinition:
661
663
  if (hint & FunctionComponentDetectionHint.DoNotIncludeFunctionDefinedAsClassProperty) return false;
662
664
  break;
663
665
  case parent.type === AST_NODE_TYPES.ArrayPattern:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "5.11.2",
3
+ "version": "5.11.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": {
@@ -33,11 +33,11 @@
33
33
  "@typescript-eslint/types": "^8.62.1",
34
34
  "@typescript-eslint/utils": "^8.62.1",
35
35
  "ts-pattern": "^5.9.0",
36
- "@eslint-react/ast": "5.11.2",
37
- "@eslint-react/eslint": "5.11.2",
38
- "@eslint-react/jsx": "5.11.2",
39
- "@eslint-react/var": "5.11.2",
40
- "@eslint-react/shared": "5.11.2"
36
+ "@eslint-react/ast": "5.11.3",
37
+ "@eslint-react/eslint": "5.11.3",
38
+ "@eslint-react/jsx": "5.11.3",
39
+ "@eslint-react/shared": "5.11.3",
40
+ "@eslint-react/var": "5.11.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@typescript-eslint/parser": "^8.62.1",
@@ -46,8 +46,8 @@
46
46
  "tsdown": "^0.22.3",
47
47
  "typescript": "6.0.3",
48
48
  "vitest": "^4.1.9",
49
- "@local/eff": "0.0.0",
50
- "@local/configs": "0.0.0"
49
+ "@local/configs": "0.0.0",
50
+ "@local/eff": "0.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "eslint": "*",