eslint-plugin-react-x 1.48.2-next.0 → 1.48.2

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.js CHANGED
@@ -141,7 +141,7 @@ var settings3 = {
141
141
 
142
142
  // package.json
143
143
  var name4 = "eslint-plugin-react-x";
144
- var version = "1.48.2-next.0";
144
+ var version = "1.48.2";
145
145
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
146
146
 
147
147
  // src/rules/avoid-shorthand-boolean.ts
@@ -1453,7 +1453,7 @@ function create27(context) {
1453
1453
  if (!ER25__namespace.isForwardRefCall(context, node)) {
1454
1454
  return;
1455
1455
  }
1456
- const id = AST8__namespace.getFunctionIdentifier(node);
1456
+ const id = AST8__namespace.getFunctionId(node);
1457
1457
  context.report({
1458
1458
  messageId: "noForwardRef",
1459
1459
  node: id ?? node,
@@ -1756,14 +1756,14 @@ function create30(context) {
1756
1756
  const components = ctx.getAllComponents(program);
1757
1757
  for (const { node, displayName, flag } of components.values()) {
1758
1758
  const isMemoOrForwardRef = (flag & (ER25__namespace.ComponentFlag.ForwardRef | ER25__namespace.ComponentFlag.Memo)) > 0n;
1759
- if (AST8__namespace.getFunctionIdentifier(node) != null) {
1759
+ if (AST8__namespace.getFunctionId(node) != null) {
1760
1760
  continue;
1761
1761
  }
1762
1762
  if (!isMemoOrForwardRef) {
1763
1763
  continue;
1764
1764
  }
1765
1765
  if (displayName == null) {
1766
- const id = AST8__namespace.getFunctionIdentifier(node);
1766
+ const id = AST8__namespace.getFunctionId(node);
1767
1767
  context.report({
1768
1768
  messageId: "noMissingComponentDisplayName",
1769
1769
  node: id ?? node
@@ -2636,7 +2636,7 @@ function create45(context) {
2636
2636
  if (value?.type !== types.AST_NODE_TYPES.JSXExpressionContainer) return;
2637
2637
  const valueExpression = value.expression;
2638
2638
  const initialScope = context.sourceCode.getScope(valueExpression);
2639
- const construction = VAR2__namespace.getConstructionDetectionResult(valueExpression, initialScope);
2639
+ const construction = VAR2__namespace.getConstruction(valueExpression, initialScope);
2640
2640
  if (construction == null) return;
2641
2641
  if (ER25__namespace.isReactHookCall(construction.node)) {
2642
2642
  return;
@@ -2653,7 +2653,7 @@ function create45(context) {
2653
2653
  messageId: "unstableContextValue",
2654
2654
  node: constructionNode,
2655
2655
  data: {
2656
- type: AST8__namespace.toReadableNodeType(constructionNode),
2656
+ type: AST8__namespace.toDelimiterCaseType(constructionNode),
2657
2657
  suggestion
2658
2658
  }
2659
2659
  });
@@ -2710,7 +2710,7 @@ function create46(context) {
2710
2710
  const { value } = prop;
2711
2711
  const { right } = value;
2712
2712
  const initialScope = context.sourceCode.getScope(value);
2713
- const construction = VAR2__namespace.getConstructionDetectionResult(
2713
+ const construction = VAR2__namespace.getConstruction(
2714
2714
  value,
2715
2715
  initialScope,
2716
2716
  VAR2__namespace.ConstructionDetectionHint.StrictCallExpression
@@ -2721,7 +2721,7 @@ function create46(context) {
2721
2721
  if (ER25__namespace.isReactHookCall(construction.node)) {
2722
2722
  continue;
2723
2723
  }
2724
- const forbiddenType = AST8__namespace.toReadableNodeType(right);
2724
+ const forbiddenType = AST8__namespace.toDelimiterCaseType(right);
2725
2725
  context.report({
2726
2726
  messageId: "noUnstableDefaultProps",
2727
2727
  node: right,
@@ -2799,7 +2799,7 @@ function create47(context) {
2799
2799
  if (currentClass == null || !ER25__namespace.isClassComponent(currentClass)) {
2800
2800
  return;
2801
2801
  }
2802
- const className = AST8__namespace.getClassIdentifier(currentClass)?.name;
2802
+ const className = AST8__namespace.getClassId(currentClass)?.name;
2803
2803
  const defs = propertyDefs.get(currentClass);
2804
2804
  const usages = propertyUsages.get(currentClass);
2805
2805
  if (defs == null) {
@@ -2925,7 +2925,7 @@ function create48(context) {
2925
2925
  if (currentClass == null || !ER25__namespace.isClassComponent(currentClass)) {
2926
2926
  return;
2927
2927
  }
2928
- const className = AST8__namespace.getClassIdentifier(currentClass)?.name;
2928
+ const className = AST8__namespace.getClassId(currentClass)?.name;
2929
2929
  const { node: defNode, isUsed = false } = stateDefs.get(currentClass) ?? {};
2930
2930
  if (defNode == null || isUsed) {
2931
2931
  return;
@@ -3379,7 +3379,7 @@ function create52(context) {
3379
3379
  if (!AST8__namespace.isFunction(block)) {
3380
3380
  return false;
3381
3381
  }
3382
- const id = AST8__namespace.getFunctionIdentifier(block);
3382
+ const id = AST8__namespace.getFunctionId(block);
3383
3383
  return id != null && ER25__namespace.isComponentNameLoose(id.name) && components.some((component) => component.node === block);
3384
3384
  }
3385
3385
  for (const [initialScope, memberExpression] of memberExpressionWithNames) {
package/dist/index.mjs CHANGED
@@ -114,7 +114,7 @@ var settings3 = {
114
114
 
115
115
  // package.json
116
116
  var name4 = "eslint-plugin-react-x";
117
- var version = "1.48.2-next.0";
117
+ var version = "1.48.2";
118
118
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
119
119
 
120
120
  // src/rules/avoid-shorthand-boolean.ts
@@ -1426,7 +1426,7 @@ function create27(context) {
1426
1426
  if (!ER25.isForwardRefCall(context, node)) {
1427
1427
  return;
1428
1428
  }
1429
- const id = AST8.getFunctionIdentifier(node);
1429
+ const id = AST8.getFunctionId(node);
1430
1430
  context.report({
1431
1431
  messageId: "noForwardRef",
1432
1432
  node: id ?? node,
@@ -1729,14 +1729,14 @@ function create30(context) {
1729
1729
  const components = ctx.getAllComponents(program);
1730
1730
  for (const { node, displayName, flag } of components.values()) {
1731
1731
  const isMemoOrForwardRef = (flag & (ER25.ComponentFlag.ForwardRef | ER25.ComponentFlag.Memo)) > 0n;
1732
- if (AST8.getFunctionIdentifier(node) != null) {
1732
+ if (AST8.getFunctionId(node) != null) {
1733
1733
  continue;
1734
1734
  }
1735
1735
  if (!isMemoOrForwardRef) {
1736
1736
  continue;
1737
1737
  }
1738
1738
  if (displayName == null) {
1739
- const id = AST8.getFunctionIdentifier(node);
1739
+ const id = AST8.getFunctionId(node);
1740
1740
  context.report({
1741
1741
  messageId: "noMissingComponentDisplayName",
1742
1742
  node: id ?? node
@@ -2609,7 +2609,7 @@ function create45(context) {
2609
2609
  if (value?.type !== AST_NODE_TYPES.JSXExpressionContainer) return;
2610
2610
  const valueExpression = value.expression;
2611
2611
  const initialScope = context.sourceCode.getScope(valueExpression);
2612
- const construction = VAR2.getConstructionDetectionResult(valueExpression, initialScope);
2612
+ const construction = VAR2.getConstruction(valueExpression, initialScope);
2613
2613
  if (construction == null) return;
2614
2614
  if (ER25.isReactHookCall(construction.node)) {
2615
2615
  return;
@@ -2626,7 +2626,7 @@ function create45(context) {
2626
2626
  messageId: "unstableContextValue",
2627
2627
  node: constructionNode,
2628
2628
  data: {
2629
- type: AST8.toReadableNodeType(constructionNode),
2629
+ type: AST8.toDelimiterCaseType(constructionNode),
2630
2630
  suggestion
2631
2631
  }
2632
2632
  });
@@ -2683,7 +2683,7 @@ function create46(context) {
2683
2683
  const { value } = prop;
2684
2684
  const { right } = value;
2685
2685
  const initialScope = context.sourceCode.getScope(value);
2686
- const construction = VAR2.getConstructionDetectionResult(
2686
+ const construction = VAR2.getConstruction(
2687
2687
  value,
2688
2688
  initialScope,
2689
2689
  VAR2.ConstructionDetectionHint.StrictCallExpression
@@ -2694,7 +2694,7 @@ function create46(context) {
2694
2694
  if (ER25.isReactHookCall(construction.node)) {
2695
2695
  continue;
2696
2696
  }
2697
- const forbiddenType = AST8.toReadableNodeType(right);
2697
+ const forbiddenType = AST8.toDelimiterCaseType(right);
2698
2698
  context.report({
2699
2699
  messageId: "noUnstableDefaultProps",
2700
2700
  node: right,
@@ -2772,7 +2772,7 @@ function create47(context) {
2772
2772
  if (currentClass == null || !ER25.isClassComponent(currentClass)) {
2773
2773
  return;
2774
2774
  }
2775
- const className = AST8.getClassIdentifier(currentClass)?.name;
2775
+ const className = AST8.getClassId(currentClass)?.name;
2776
2776
  const defs = propertyDefs.get(currentClass);
2777
2777
  const usages = propertyUsages.get(currentClass);
2778
2778
  if (defs == null) {
@@ -2898,7 +2898,7 @@ function create48(context) {
2898
2898
  if (currentClass == null || !ER25.isClassComponent(currentClass)) {
2899
2899
  return;
2900
2900
  }
2901
- const className = AST8.getClassIdentifier(currentClass)?.name;
2901
+ const className = AST8.getClassId(currentClass)?.name;
2902
2902
  const { node: defNode, isUsed = false } = stateDefs.get(currentClass) ?? {};
2903
2903
  if (defNode == null || isUsed) {
2904
2904
  return;
@@ -3352,7 +3352,7 @@ function create52(context) {
3352
3352
  if (!AST8.isFunction(block)) {
3353
3353
  return false;
3354
3354
  }
3355
- const id = AST8.getFunctionIdentifier(block);
3355
+ const id = AST8.getFunctionId(block);
3356
3356
  return id != null && ER25.isComponentNameLoose(id.name) && components.some((component) => component.node === block);
3357
3357
  }
3358
3358
  for (const [initialScope, memberExpression] of memberExpressionWithNames) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.48.2-next.0",
3
+ "version": "1.48.2",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -50,12 +50,12 @@
50
50
  "is-immutable-type": "^5.0.1",
51
51
  "string-ts": "^2.2.1",
52
52
  "ts-pattern": "^5.7.0",
53
- "@eslint-react/ast": "1.48.2-next.0",
54
- "@eslint-react/core": "1.48.2-next.0",
55
- "@eslint-react/shared": "1.48.2-next.0",
56
- "@eslint-react/var": "1.48.2-next.0",
57
- "@eslint-react/kit": "1.48.2-next.0",
58
- "@eslint-react/eff": "1.48.2-next.0"
53
+ "@eslint-react/ast": "1.48.2",
54
+ "@eslint-react/eff": "1.48.2",
55
+ "@eslint-react/core": "1.48.2",
56
+ "@eslint-react/shared": "1.48.2",
57
+ "@eslint-react/kit": "1.48.2",
58
+ "@eslint-react/var": "1.48.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.2",