eslint-plugin-react-x 1.47.3-beta.0 → 1.47.3-next.0

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.47.3-beta.0";
144
+ var version = "1.47.3-next.0";
145
145
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
146
146
 
147
147
  // src/rules/avoid-shorthand-boolean.ts
@@ -1662,7 +1662,7 @@ var no_leaked_conditional_rendering_default = createRule({
1662
1662
  defaultOptions: []
1663
1663
  });
1664
1664
  function create29(context) {
1665
- if (!context.sourceCode.text.includes("&&")) return {};
1665
+ if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1666
1666
  const { version: version2 } = shared.getSettingsFromContext(context);
1667
1667
  const allowedVariants = [
1668
1668
  "any",
@@ -1679,10 +1679,7 @@ function create29(context) {
1679
1679
  const services = utils.ESLintUtils.getParserServices(context, false);
1680
1680
  function getReportDescriptor(node) {
1681
1681
  if (node == null) return eff._;
1682
- if (AST8__namespace.is(types.AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
1683
- if (AST8__namespace.isJSX(node)) return eff._;
1684
- if (AST8__namespace.isTypeExpression(node)) return getReportDescriptor(node.expression);
1685
- return tsPattern.match(node).with({ type: types.AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
1682
+ return tsPattern.match(node).when(AST8__namespace.isJSX, () => eff._).with({ type: types.AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
1686
1683
  const isLeftUnaryNot = left.type === types.AST_NODE_TYPES.UnaryExpression && left.operator === "!";
1687
1684
  if (isLeftUnaryNot) {
1688
1685
  return getReportDescriptor(right);
@@ -1715,8 +1712,10 @@ function create29(context) {
1715
1712
  return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff._);
1716
1713
  }).otherwise(() => eff._);
1717
1714
  }
1715
+ const visitorFunction = eff.flow(getReportDescriptor, kit.Report.make(context).send);
1718
1716
  return {
1719
- JSXExpressionContainer: eff.flow(getReportDescriptor, kit.Report.make(context).send)
1717
+ "JSXExpressionContainer > ConditionalExpression": visitorFunction,
1718
+ "JSXExpressionContainer > LogicalExpression": visitorFunction
1720
1719
  };
1721
1720
  }
1722
1721
  var RULE_NAME30 = "no-missing-component-display-name";
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.47.3-beta.0";
117
+ var version = "1.47.3-next.0";
118
118
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
119
119
 
120
120
  // src/rules/avoid-shorthand-boolean.ts
@@ -1635,7 +1635,7 @@ var no_leaked_conditional_rendering_default = createRule({
1635
1635
  defaultOptions: []
1636
1636
  });
1637
1637
  function create29(context) {
1638
- if (!context.sourceCode.text.includes("&&")) return {};
1638
+ if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1639
1639
  const { version: version2 } = getSettingsFromContext(context);
1640
1640
  const allowedVariants = [
1641
1641
  "any",
@@ -1652,10 +1652,7 @@ function create29(context) {
1652
1652
  const services = ESLintUtils.getParserServices(context, false);
1653
1653
  function getReportDescriptor(node) {
1654
1654
  if (node == null) return _;
1655
- if (AST8.is(AST_NODE_TYPES.JSXExpressionContainer)(node)) return getReportDescriptor(node.expression);
1656
- if (AST8.isJSX(node)) return _;
1657
- if (AST8.isTypeExpression(node)) return getReportDescriptor(node.expression);
1658
- return match(node).with({ type: AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
1655
+ return match(node).when(AST8.isJSX, () => _).with({ type: AST_NODE_TYPES.LogicalExpression, operator: "&&" }, ({ left, right }) => {
1659
1656
  const isLeftUnaryNot = left.type === AST_NODE_TYPES.UnaryExpression && left.operator === "!";
1660
1657
  if (isLeftUnaryNot) {
1661
1658
  return getReportDescriptor(right);
@@ -1688,8 +1685,10 @@ function create29(context) {
1688
1685
  return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => _);
1689
1686
  }).otherwise(() => _);
1690
1687
  }
1688
+ const visitorFunction = flow(getReportDescriptor, Report.make(context).send);
1691
1689
  return {
1692
- JSXExpressionContainer: flow(getReportDescriptor, Report.make(context).send)
1690
+ "JSXExpressionContainer > ConditionalExpression": visitorFunction,
1691
+ "JSXExpressionContainer > LogicalExpression": visitorFunction
1693
1692
  };
1694
1693
  }
1695
1694
  var RULE_NAME30 = "no-missing-component-display-name";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.47.3-beta.0",
3
+ "version": "1.47.3-next.0",
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",
@@ -42,23 +42,23 @@
42
42
  "./package.json"
43
43
  ],
44
44
  "dependencies": {
45
- "@typescript-eslint/scope-manager": "^8.30.1",
46
- "@typescript-eslint/type-utils": "^8.30.1",
47
- "@typescript-eslint/types": "^8.30.1",
48
- "@typescript-eslint/utils": "^8.30.1",
45
+ "@typescript-eslint/scope-manager": "^8.29.1",
46
+ "@typescript-eslint/type-utils": "^8.29.1",
47
+ "@typescript-eslint/types": "^8.29.1",
48
+ "@typescript-eslint/utils": "^8.29.1",
49
49
  "compare-versions": "^6.1.1",
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.47.3-beta.0",
54
- "@eslint-react/core": "1.47.3-beta.0",
55
- "@eslint-react/eff": "1.47.3-beta.0",
56
- "@eslint-react/kit": "1.47.3-beta.0",
57
- "@eslint-react/shared": "1.47.3-beta.0",
58
- "@eslint-react/var": "1.47.3-beta.0"
53
+ "@eslint-react/ast": "1.47.3-next.0",
54
+ "@eslint-react/core": "1.47.3-next.0",
55
+ "@eslint-react/eff": "1.47.3-next.0",
56
+ "@eslint-react/kit": "1.47.3-next.0",
57
+ "@eslint-react/shared": "1.47.3-next.0",
58
+ "@eslint-react/var": "1.47.3-next.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@types/react": "^19.1.2",
61
+ "@types/react": "^19.1.1",
62
62
  "@types/react-dom": "^19.1.2",
63
63
  "ts-api-utils": "^2.1.0",
64
64
  "tsup": "^8.4.0",