eslint-plugin-react-x 1.17.4-next.5 → 1.17.4-next.8

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/README.md CHANGED
@@ -48,6 +48,7 @@ export default [
48
48
  "react-x/no-default-props": "error",
49
49
  "react-x/no-direct-mutation-state": "error",
50
50
  "react-x/no-duplicate-key": "error",
51
+ "react-x/no-forward-ref": "warn",
51
52
  "react-x/no-implicit-key": "warn",
52
53
  "react-x/no-missing-key": "error",
53
54
  "react-x/no-nested-components": "warn",
@@ -97,6 +98,7 @@ export default [
97
98
  | `no-default-props` | Prevents using `defaultProps` property in favor of ES6 default parameters. | ✔️ | | |
98
99
  | `no-direct-mutation-state` | Prevents direct mutation of `this.state`. | ✔️ | | |
99
100
  | `no-duplicate-key` | Prevents duplicate `key` on elements in the same array or a list of `children`. | ✔️ | | |
101
+ | `no-forward-ref` | Prevents using `forwardRef`. | 🧐 | | |
100
102
  | `no-implicit-key` | Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects). | 🧐 | | |
101
103
  | `no-leaked-conditional-rendering` | Prevents problematic leaked values from being rendered. | 🧐 | 💭 | |
102
104
  | `no-missing-component-display-name` | Enforces that all components have a `displayName` which can be used in devtools. | 🐞 | | |
package/dist/index.d.mts CHANGED
@@ -38,6 +38,7 @@ declare const _default: {
38
38
  "no-default-props": _typescript_eslint_utils_ts_eslint.RuleModule<"noDefaultProps", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
39
39
  "no-direct-mutation-state": _typescript_eslint_utils_ts_eslint.RuleModule<"noDirectMutationState", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
40
40
  "no-duplicate-key": _typescript_eslint_utils_ts_eslint.RuleModule<"noDuplicateKey", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
41
+ "no-forward-ref": _typescript_eslint_utils_ts_eslint.RuleModule<"noForwardRef", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
41
42
  "no-implicit-key": _typescript_eslint_utils_ts_eslint.RuleModule<"noImplicitKey", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
42
43
  "no-leaked-conditional-rendering": _typescript_eslint_utils_ts_eslint.RuleModule<"noLeakedConditionalRendering", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
43
44
  "no-missing-component-display-name": _typescript_eslint_utils_ts_eslint.RuleModule<"noMissingComponentDisplayName", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ declare const _default: {
38
38
  "no-default-props": _typescript_eslint_utils_ts_eslint.RuleModule<"noDefaultProps", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
39
39
  "no-direct-mutation-state": _typescript_eslint_utils_ts_eslint.RuleModule<"noDirectMutationState", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
40
40
  "no-duplicate-key": _typescript_eslint_utils_ts_eslint.RuleModule<"noDuplicateKey", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
41
+ "no-forward-ref": _typescript_eslint_utils_ts_eslint.RuleModule<"noForwardRef", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
41
42
  "no-implicit-key": _typescript_eslint_utils_ts_eslint.RuleModule<"noImplicitKey", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
42
43
  "no-leaked-conditional-rendering": _typescript_eslint_utils_ts_eslint.RuleModule<"noLeakedConditionalRendering", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
43
44
  "no-missing-component-display-name": _typescript_eslint_utils_ts_eslint.RuleModule<"noMissingComponentDisplayName", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@ var core = require('@eslint-react/core');
8
8
  var types = require('@typescript-eslint/types');
9
9
  var tsPattern = require('ts-pattern');
10
10
  var VAR = require('@eslint-react/var');
11
+ var compareVersions = require('compare-versions');
11
12
  var typeUtils = require('@typescript-eslint/type-utils');
12
13
  var utils = require('@typescript-eslint/utils');
13
- var compareVersions = require('compare-versions');
14
14
  var ts = require('typescript');
15
15
  var isImmutableType = require('is-immutable-type');
16
16
 
@@ -41,7 +41,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
41
41
 
42
42
  // package.json
43
43
  var name = "eslint-plugin-react-x";
44
- var version = "1.17.4-next.5";
44
+ var version = "1.17.4-next.8";
45
45
  var createRule = shared.createRuleForPlugin("x");
46
46
 
47
47
  // src/rules/avoid-shorthand-boolean.ts
@@ -1118,7 +1118,35 @@ var no_duplicate_key_default = createRule({
1118
1118
  },
1119
1119
  defaultOptions: []
1120
1120
  });
1121
- var RULE_NAME25 = "no-implicit-key";
1121
+ var RULE_NAME25 = "no-forward-ref";
1122
+ var no_forward_ref_default = createRule({
1123
+ meta: {
1124
+ type: "problem",
1125
+ docs: {
1126
+ description: "disallow the use of 'forwardRef'"
1127
+ },
1128
+ messages: {
1129
+ noForwardRef: "In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead."
1130
+ },
1131
+ schema: []
1132
+ },
1133
+ name: RULE_NAME25,
1134
+ create(context) {
1135
+ const { version: version2 } = shared.normalizeSettings(shared.decodeSettings(context.settings));
1136
+ if (compareVersions.compare(version2, "19.0.0", "<")) return {};
1137
+ return {
1138
+ CallExpression(node) {
1139
+ if (!core.isForwardRefCall(node, context)) return;
1140
+ context.report({
1141
+ messageId: "noForwardRef",
1142
+ node
1143
+ });
1144
+ }
1145
+ };
1146
+ },
1147
+ defaultOptions: []
1148
+ });
1149
+ var RULE_NAME26 = "no-implicit-key";
1122
1150
  var no_implicit_key_default = createRule({
1123
1151
  meta: {
1124
1152
  type: "problem",
@@ -1130,7 +1158,7 @@ var no_implicit_key_default = createRule({
1130
1158
  },
1131
1159
  schema: []
1132
1160
  },
1133
- name: RULE_NAME25,
1161
+ name: RULE_NAME26,
1134
1162
  create(context) {
1135
1163
  function getReportDescriptor(node) {
1136
1164
  const initialScope = context.sourceCode.getScope(node);
@@ -1173,7 +1201,7 @@ function isTrueLiteralType(type) {
1173
1201
  function unionTypeParts(type) {
1174
1202
  return isUnionType(type) ? type.types : [type];
1175
1203
  }
1176
- var RULE_NAME26 = "no-leaked-conditional-rendering";
1204
+ var RULE_NAME27 = "no-leaked-conditional-rendering";
1177
1205
  var tsHelpers = {
1178
1206
  isAnyType: (type) => isTypeFlagSet(type, ts__default.default.TypeFlags.TypeParameter | ts__default.default.TypeFlags.Any),
1179
1207
  isBigIntType: (type) => isTypeFlagSet(type, ts__default.default.TypeFlags.BigIntLike),
@@ -1277,7 +1305,7 @@ var no_leaked_conditional_rendering_default = createRule({
1277
1305
  },
1278
1306
  schema: []
1279
1307
  },
1280
- name: RULE_NAME26,
1308
+ name: RULE_NAME27,
1281
1309
  create(context) {
1282
1310
  if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1283
1311
  const { version: version2 } = shared.normalizeSettings(shared.decodeSettings(context.settings));
@@ -1334,7 +1362,7 @@ var no_leaked_conditional_rendering_default = createRule({
1334
1362
  },
1335
1363
  defaultOptions: []
1336
1364
  });
1337
- var RULE_NAME27 = "no-missing-component-display-name";
1365
+ var RULE_NAME28 = "no-missing-component-display-name";
1338
1366
  var no_missing_component_display_name_default = createRule({
1339
1367
  meta: {
1340
1368
  type: "problem",
@@ -1346,7 +1374,7 @@ var no_missing_component_display_name_default = createRule({
1346
1374
  },
1347
1375
  schema: []
1348
1376
  },
1349
- name: RULE_NAME27,
1377
+ name: RULE_NAME28,
1350
1378
  create(context) {
1351
1379
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1352
1380
  const { ctx, listeners } = core.useComponentCollector(context);
@@ -1370,7 +1398,7 @@ var no_missing_component_display_name_default = createRule({
1370
1398
  },
1371
1399
  defaultOptions: []
1372
1400
  });
1373
- var RULE_NAME28 = "no-missing-key";
1401
+ var RULE_NAME29 = "no-missing-key";
1374
1402
  var no_missing_key_default = createRule({
1375
1403
  meta: {
1376
1404
  type: "problem",
@@ -1383,7 +1411,7 @@ var no_missing_key_default = createRule({
1383
1411
  },
1384
1412
  schema: []
1385
1413
  },
1386
- name: RULE_NAME28,
1414
+ name: RULE_NAME29,
1387
1415
  create(context) {
1388
1416
  const isWithinChildrenToArrayRef = tools.MutRef.make(false);
1389
1417
  function checkIteratorElement(node) {
@@ -1487,7 +1515,7 @@ var no_missing_key_default = createRule({
1487
1515
  },
1488
1516
  defaultOptions: []
1489
1517
  });
1490
- var RULE_NAME29 = "no-nested-components";
1518
+ var RULE_NAME30 = "no-nested-components";
1491
1519
  var no_nested_components_default = createRule({
1492
1520
  meta: {
1493
1521
  type: "problem",
@@ -1500,7 +1528,7 @@ var no_nested_components_default = createRule({
1500
1528
  },
1501
1529
  schema: []
1502
1530
  },
1503
- name: RULE_NAME29,
1531
+ name: RULE_NAME30,
1504
1532
  create(context) {
1505
1533
  const hint = core.ERComponentHint.SkipMapCallback | core.ERComponentHint.SkipNullLiteral | core.ERComponentHint.SkipUndefinedLiteral | core.ERComponentHint.SkipBooleanLiteral | core.ERComponentHint.SkipStringLiteral | core.ERComponentHint.SkipNumberLiteral | core.ERComponentHint.StrictLogical | core.ERComponentHint.StrictConditional;
1506
1534
  const collector = core.useComponentCollector(context, hint);
@@ -1584,7 +1612,7 @@ var no_nested_components_default = createRule({
1584
1612
  },
1585
1613
  defaultOptions: []
1586
1614
  });
1587
- var RULE_NAME30 = "no-prop-types";
1615
+ var RULE_NAME31 = "no-prop-types";
1588
1616
  var no_prop_types_default = createRule({
1589
1617
  meta: {
1590
1618
  type: "problem",
@@ -1596,7 +1624,7 @@ var no_prop_types_default = createRule({
1596
1624
  },
1597
1625
  schema: []
1598
1626
  },
1599
- name: RULE_NAME30,
1627
+ name: RULE_NAME31,
1600
1628
  create(context) {
1601
1629
  if (!context.sourceCode.text.includes("propTypes")) return {};
1602
1630
  return {
@@ -1623,7 +1651,7 @@ var no_prop_types_default = createRule({
1623
1651
  },
1624
1652
  defaultOptions: []
1625
1653
  });
1626
- var RULE_NAME31 = "no-redundant-should-component-update";
1654
+ var RULE_NAME32 = "no-redundant-should-component-update";
1627
1655
  function isShouldComponentUpdate(node) {
1628
1656
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
1629
1657
  }
@@ -1638,7 +1666,7 @@ var no_redundant_should_component_update_default = createRule({
1638
1666
  },
1639
1667
  schema: []
1640
1668
  },
1641
- name: RULE_NAME31,
1669
+ name: RULE_NAME32,
1642
1670
  create(context) {
1643
1671
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
1644
1672
  const { ctx, listeners } = core.useComponentCollectorLegacy();
@@ -1666,7 +1694,7 @@ var no_redundant_should_component_update_default = createRule({
1666
1694
  },
1667
1695
  defaultOptions: []
1668
1696
  });
1669
- var RULE_NAME32 = "no-set-state-in-component-did-mount";
1697
+ var RULE_NAME33 = "no-set-state-in-component-did-mount";
1670
1698
  function isComponentDidMount(node) {
1671
1699
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
1672
1700
  }
@@ -1681,7 +1709,7 @@ var no_set_state_in_component_did_mount_default = createRule({
1681
1709
  },
1682
1710
  schema: []
1683
1711
  },
1684
- name: RULE_NAME32,
1712
+ name: RULE_NAME33,
1685
1713
  create(context) {
1686
1714
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
1687
1715
  function getReportDescriptor(node) {
@@ -1709,7 +1737,7 @@ var no_set_state_in_component_did_mount_default = createRule({
1709
1737
  },
1710
1738
  defaultOptions: []
1711
1739
  });
1712
- var RULE_NAME33 = "no-set-state-in-component-did-update";
1740
+ var RULE_NAME34 = "no-set-state-in-component-did-update";
1713
1741
  function isComponentDidUpdate(node) {
1714
1742
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
1715
1743
  }
@@ -1724,7 +1752,7 @@ var no_set_state_in_component_did_update_default = createRule({
1724
1752
  },
1725
1753
  schema: []
1726
1754
  },
1727
- name: RULE_NAME33,
1755
+ name: RULE_NAME34,
1728
1756
  create(context) {
1729
1757
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
1730
1758
  function getReportDescriptor(node) {
@@ -1752,7 +1780,7 @@ var no_set_state_in_component_did_update_default = createRule({
1752
1780
  },
1753
1781
  defaultOptions: []
1754
1782
  });
1755
- var RULE_NAME34 = "no-set-state-in-component-will-update";
1783
+ var RULE_NAME35 = "no-set-state-in-component-will-update";
1756
1784
  function isComponentWillUpdate3(node) {
1757
1785
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
1758
1786
  }
@@ -1767,7 +1795,7 @@ var no_set_state_in_component_will_update_default = createRule({
1767
1795
  },
1768
1796
  schema: []
1769
1797
  },
1770
- name: RULE_NAME34,
1798
+ name: RULE_NAME35,
1771
1799
  create(context) {
1772
1800
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
1773
1801
  function getReportDescriptor(node) {
@@ -1795,7 +1823,7 @@ var no_set_state_in_component_will_update_default = createRule({
1795
1823
  },
1796
1824
  defaultOptions: []
1797
1825
  });
1798
- var RULE_NAME35 = "no-string-refs";
1826
+ var RULE_NAME36 = "no-string-refs";
1799
1827
  function containsStringLiteral({ value }) {
1800
1828
  return value?.type === types.AST_NODE_TYPES.Literal && tools.isString(value.value);
1801
1829
  }
@@ -1815,7 +1843,7 @@ var no_string_refs_default = createRule({
1815
1843
  },
1816
1844
  schema: []
1817
1845
  },
1818
- name: RULE_NAME35,
1846
+ name: RULE_NAME36,
1819
1847
  create(context) {
1820
1848
  return {
1821
1849
  JSXAttribute(node) {
@@ -1831,7 +1859,7 @@ var no_string_refs_default = createRule({
1831
1859
  },
1832
1860
  defaultOptions: []
1833
1861
  });
1834
- var RULE_NAME36 = "no-unsafe-component-will-mount";
1862
+ var RULE_NAME37 = "no-unsafe-component-will-mount";
1835
1863
  function isUnsafeComponentWillMount(node) {
1836
1864
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
1837
1865
  }
@@ -1846,7 +1874,7 @@ var no_unsafe_component_will_mount_default = createRule({
1846
1874
  },
1847
1875
  schema: []
1848
1876
  },
1849
- name: RULE_NAME36,
1877
+ name: RULE_NAME37,
1850
1878
  create(context) {
1851
1879
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
1852
1880
  const { ctx, listeners } = core.useComponentCollectorLegacy();
@@ -1870,7 +1898,7 @@ var no_unsafe_component_will_mount_default = createRule({
1870
1898
  },
1871
1899
  defaultOptions: []
1872
1900
  });
1873
- var RULE_NAME37 = "no-unsafe-component-will-receive-props";
1901
+ var RULE_NAME38 = "no-unsafe-component-will-receive-props";
1874
1902
  function isUnsafeComponentWillReceiveProps(node) {
1875
1903
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
1876
1904
  }
@@ -1885,7 +1913,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
1885
1913
  },
1886
1914
  schema: []
1887
1915
  },
1888
- name: RULE_NAME37,
1916
+ name: RULE_NAME38,
1889
1917
  create(context) {
1890
1918
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
1891
1919
  const { ctx, listeners } = core.useComponentCollectorLegacy();
@@ -1909,7 +1937,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
1909
1937
  },
1910
1938
  defaultOptions: []
1911
1939
  });
1912
- var RULE_NAME38 = "no-unsafe-component-will-update";
1940
+ var RULE_NAME39 = "no-unsafe-component-will-update";
1913
1941
  function isUnsafeComponentWillUpdate(node) {
1914
1942
  return AST11__namespace.isOneOf([types.AST_NODE_TYPES.MethodDefinition, types.AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
1915
1943
  }
@@ -1924,7 +1952,7 @@ var no_unsafe_component_will_update_default = createRule({
1924
1952
  },
1925
1953
  schema: []
1926
1954
  },
1927
- name: RULE_NAME38,
1955
+ name: RULE_NAME39,
1928
1956
  create(context) {
1929
1957
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
1930
1958
  const { ctx, listeners } = core.useComponentCollectorLegacy();
@@ -1948,7 +1976,7 @@ var no_unsafe_component_will_update_default = createRule({
1948
1976
  },
1949
1977
  defaultOptions: []
1950
1978
  });
1951
- var RULE_NAME39 = "no-unstable-context-value";
1979
+ var RULE_NAME40 = "no-unstable-context-value";
1952
1980
  var no_unstable_context_value_default = createRule({
1953
1981
  meta: {
1954
1982
  type: "problem",
@@ -1962,7 +1990,7 @@ var no_unstable_context_value_default = createRule({
1962
1990
  },
1963
1991
  schema: []
1964
1992
  },
1965
- name: RULE_NAME39,
1993
+ name: RULE_NAME40,
1966
1994
  create(context) {
1967
1995
  const { ctx, listeners } = core.useComponentCollector(context);
1968
1996
  const possibleValueConstructions = /* @__PURE__ */ new Map();
@@ -2015,7 +2043,7 @@ var no_unstable_context_value_default = createRule({
2015
2043
  },
2016
2044
  defaultOptions: []
2017
2045
  });
2018
- var RULE_NAME40 = "no-unstable-default-props";
2046
+ var RULE_NAME41 = "no-unstable-default-props";
2019
2047
  var no_unstable_default_props_default = createRule({
2020
2048
  meta: {
2021
2049
  type: "problem",
@@ -2027,7 +2055,7 @@ var no_unstable_default_props_default = createRule({
2027
2055
  },
2028
2056
  schema: []
2029
2057
  },
2030
- name: RULE_NAME40,
2058
+ name: RULE_NAME41,
2031
2059
  create(context) {
2032
2060
  const { ctx, listeners } = core.useComponentCollector(context);
2033
2061
  const possibleDestructuringDeclarators = /* @__PURE__ */ new WeakMap();
@@ -2080,7 +2108,7 @@ var no_unstable_default_props_default = createRule({
2080
2108
  },
2081
2109
  defaultOptions: []
2082
2110
  });
2083
- var RULE_NAME41 = "no-unused-class-component-members";
2111
+ var RULE_NAME42 = "no-unused-class-component-members";
2084
2112
  var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
2085
2113
  "componentDidCatch",
2086
2114
  "componentDidMount",
@@ -2124,7 +2152,7 @@ var no_unused_class_component_members_default = createRule({
2124
2152
  },
2125
2153
  schema: []
2126
2154
  },
2127
- name: RULE_NAME41,
2155
+ name: RULE_NAME42,
2128
2156
  create(context) {
2129
2157
  const classStack = [];
2130
2158
  const methodStack = [];
@@ -2207,7 +2235,7 @@ var no_unused_class_component_members_default = createRule({
2207
2235
  },
2208
2236
  defaultOptions: []
2209
2237
  });
2210
- var RULE_NAME42 = "no-unused-state";
2238
+ var RULE_NAME43 = "no-unused-state";
2211
2239
  function getName4(node) {
2212
2240
  if (node.type === types.AST_NODE_TYPES.TSAsExpression) {
2213
2241
  return getName4(node.expression);
@@ -2247,7 +2275,7 @@ var no_unused_state_default = createRule({
2247
2275
  },
2248
2276
  schema: []
2249
2277
  },
2250
- name: RULE_NAME42,
2278
+ name: RULE_NAME43,
2251
2279
  create(context) {
2252
2280
  const classStack = [];
2253
2281
  const methodStack = [];
@@ -2348,7 +2376,7 @@ var no_unused_state_default = createRule({
2348
2376
  },
2349
2377
  defaultOptions: []
2350
2378
  });
2351
- var RULE_NAME43 = "no-useless-fragment";
2379
+ var RULE_NAME44 = "no-useless-fragment";
2352
2380
  function check(node, context, allowExpressions) {
2353
2381
  const initialScope = context.sourceCode.getScope(node);
2354
2382
  if (JSX7__namespace.isKeyedElement(node, initialScope)) return;
@@ -2390,7 +2418,7 @@ var no_useless_fragment_default = createRule({
2390
2418
  }
2391
2419
  }]
2392
2420
  },
2393
- name: RULE_NAME43,
2421
+ name: RULE_NAME44,
2394
2422
  create(context, [option]) {
2395
2423
  const { allowExpressions = true } = option;
2396
2424
  return {
@@ -2407,7 +2435,7 @@ var no_useless_fragment_default = createRule({
2407
2435
  allowExpressions: true
2408
2436
  }]
2409
2437
  });
2410
- var RULE_NAME44 = "prefer-destructuring-assignment";
2438
+ var RULE_NAME45 = "prefer-destructuring-assignment";
2411
2439
  function isMemberExpressionWithObjectName(node) {
2412
2440
  return node.object.type === types.AST_NODE_TYPES.Identifier && "name" in node.object;
2413
2441
  }
@@ -2422,7 +2450,7 @@ var prefer_destructuring_assignment_default = createRule({
2422
2450
  },
2423
2451
  schema: []
2424
2452
  },
2425
- name: RULE_NAME44,
2453
+ name: RULE_NAME45,
2426
2454
  create(context) {
2427
2455
  const { ctx, listeners } = core.useComponentCollector(context);
2428
2456
  const memberExpressionWithNames = [];
@@ -2477,7 +2505,7 @@ var prefer_destructuring_assignment_default = createRule({
2477
2505
  },
2478
2506
  defaultOptions: []
2479
2507
  });
2480
- var RULE_NAME45 = "prefer-react-namespace-import";
2508
+ var RULE_NAME46 = "prefer-react-namespace-import";
2481
2509
  var prefer_react_namespace_import_default = createRule({
2482
2510
  meta: {
2483
2511
  type: "problem",
@@ -2490,7 +2518,7 @@ var prefer_react_namespace_import_default = createRule({
2490
2518
  },
2491
2519
  schema: []
2492
2520
  },
2493
- name: RULE_NAME45,
2521
+ name: RULE_NAME46,
2494
2522
  create(context) {
2495
2523
  const importSource = shared.decodeSettings(context.settings).importSource ?? "react";
2496
2524
  return {
@@ -2526,7 +2554,7 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
2526
2554
  },
2527
2555
  defaultOptions: []
2528
2556
  });
2529
- var RULE_NAME46 = "prefer-read-only-props";
2557
+ var RULE_NAME47 = "prefer-read-only-props";
2530
2558
  function isReadonlyType(type, services) {
2531
2559
  try {
2532
2560
  const im = isImmutableType.getTypeImmutability(services.program, type);
@@ -2546,7 +2574,7 @@ var prefer_read_only_props_default = createRule({
2546
2574
  },
2547
2575
  schema: []
2548
2576
  },
2549
- name: RULE_NAME46,
2577
+ name: RULE_NAME47,
2550
2578
  create(context) {
2551
2579
  const services = utils.ESLintUtils.getParserServices(context, false);
2552
2580
  const { ctx, listeners } = core.useComponentCollector(context);
@@ -2566,7 +2594,7 @@ var prefer_read_only_props_default = createRule({
2566
2594
  },
2567
2595
  defaultOptions: []
2568
2596
  });
2569
- var RULE_NAME47 = "prefer-shorthand-boolean";
2597
+ var RULE_NAME48 = "prefer-shorthand-boolean";
2570
2598
  var prefer_shorthand_boolean_default = createRule({
2571
2599
  meta: {
2572
2600
  type: "problem",
@@ -2579,7 +2607,7 @@ var prefer_shorthand_boolean_default = createRule({
2579
2607
  },
2580
2608
  schema: []
2581
2609
  },
2582
- name: RULE_NAME47,
2610
+ name: RULE_NAME48,
2583
2611
  create(context) {
2584
2612
  function getReportDescriptor(node) {
2585
2613
  const { value } = node;
@@ -2601,7 +2629,7 @@ var prefer_shorthand_boolean_default = createRule({
2601
2629
  },
2602
2630
  defaultOptions: []
2603
2631
  });
2604
- var RULE_NAME48 = "prefer-shorthand-fragment";
2632
+ var RULE_NAME49 = "prefer-shorthand-fragment";
2605
2633
  var prefer_shorthand_fragment_default = createRule({
2606
2634
  meta: {
2607
2635
  type: "problem",
@@ -2613,7 +2641,7 @@ var prefer_shorthand_fragment_default = createRule({
2613
2641
  },
2614
2642
  schema: []
2615
2643
  },
2616
- name: RULE_NAME48,
2644
+ name: RULE_NAME49,
2617
2645
  create(context) {
2618
2646
  function getReportDescriptor(node) {
2619
2647
  if (!core.isFragmentElement(node, context)) return tools.O.none();
@@ -2670,6 +2698,7 @@ var src_default = {
2670
2698
  "no-default-props": no_default_props_default,
2671
2699
  "no-direct-mutation-state": no_direct_mutation_state_default,
2672
2700
  "no-duplicate-key": no_duplicate_key_default,
2701
+ "no-forward-ref": no_forward_ref_default,
2673
2702
  "no-implicit-key": no_implicit_key_default,
2674
2703
  "no-leaked-conditional-rendering": no_leaked_conditional_rendering_default,
2675
2704
  "no-missing-component-display-name": no_missing_component_display_name_default,
package/dist/index.mjs CHANGED
@@ -6,15 +6,15 @@ import { isForwardRefCall, isThisSetState, isClassComponent, isChildrenCount, is
6
6
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
7
7
  import { isMatching, P, match } from 'ts-pattern';
8
8
  import * as VAR from '@eslint-react/var';
9
+ import { compare } from 'compare-versions';
9
10
  import { getConstrainedTypeAtLocation, isTypeReadonly } from '@typescript-eslint/type-utils';
10
11
  import { ESLintUtils } from '@typescript-eslint/utils';
11
- import { compare } from 'compare-versions';
12
12
  import ts from 'typescript';
13
13
  import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReadonlyDeep } from 'is-immutable-type';
14
14
 
15
15
  // package.json
16
16
  var name = "eslint-plugin-react-x";
17
- var version = "1.17.4-next.5";
17
+ var version = "1.17.4-next.8";
18
18
  var createRule = createRuleForPlugin("x");
19
19
 
20
20
  // src/rules/avoid-shorthand-boolean.ts
@@ -1091,7 +1091,35 @@ var no_duplicate_key_default = createRule({
1091
1091
  },
1092
1092
  defaultOptions: []
1093
1093
  });
1094
- var RULE_NAME25 = "no-implicit-key";
1094
+ var RULE_NAME25 = "no-forward-ref";
1095
+ var no_forward_ref_default = createRule({
1096
+ meta: {
1097
+ type: "problem",
1098
+ docs: {
1099
+ description: "disallow the use of 'forwardRef'"
1100
+ },
1101
+ messages: {
1102
+ noForwardRef: "In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead."
1103
+ },
1104
+ schema: []
1105
+ },
1106
+ name: RULE_NAME25,
1107
+ create(context) {
1108
+ const { version: version2 } = normalizeSettings(decodeSettings(context.settings));
1109
+ if (compare(version2, "19.0.0", "<")) return {};
1110
+ return {
1111
+ CallExpression(node) {
1112
+ if (!isForwardRefCall(node, context)) return;
1113
+ context.report({
1114
+ messageId: "noForwardRef",
1115
+ node
1116
+ });
1117
+ }
1118
+ };
1119
+ },
1120
+ defaultOptions: []
1121
+ });
1122
+ var RULE_NAME26 = "no-implicit-key";
1095
1123
  var no_implicit_key_default = createRule({
1096
1124
  meta: {
1097
1125
  type: "problem",
@@ -1103,7 +1131,7 @@ var no_implicit_key_default = createRule({
1103
1131
  },
1104
1132
  schema: []
1105
1133
  },
1106
- name: RULE_NAME25,
1134
+ name: RULE_NAME26,
1107
1135
  create(context) {
1108
1136
  function getReportDescriptor(node) {
1109
1137
  const initialScope = context.sourceCode.getScope(node);
@@ -1146,7 +1174,7 @@ function isTrueLiteralType(type) {
1146
1174
  function unionTypeParts(type) {
1147
1175
  return isUnionType(type) ? type.types : [type];
1148
1176
  }
1149
- var RULE_NAME26 = "no-leaked-conditional-rendering";
1177
+ var RULE_NAME27 = "no-leaked-conditional-rendering";
1150
1178
  var tsHelpers = {
1151
1179
  isAnyType: (type) => isTypeFlagSet(type, ts.TypeFlags.TypeParameter | ts.TypeFlags.Any),
1152
1180
  isBigIntType: (type) => isTypeFlagSet(type, ts.TypeFlags.BigIntLike),
@@ -1250,7 +1278,7 @@ var no_leaked_conditional_rendering_default = createRule({
1250
1278
  },
1251
1279
  schema: []
1252
1280
  },
1253
- name: RULE_NAME26,
1281
+ name: RULE_NAME27,
1254
1282
  create(context) {
1255
1283
  if (!context.sourceCode.text.includes("&&") && !context.sourceCode.text.includes("?")) return {};
1256
1284
  const { version: version2 } = normalizeSettings(decodeSettings(context.settings));
@@ -1307,7 +1335,7 @@ var no_leaked_conditional_rendering_default = createRule({
1307
1335
  },
1308
1336
  defaultOptions: []
1309
1337
  });
1310
- var RULE_NAME27 = "no-missing-component-display-name";
1338
+ var RULE_NAME28 = "no-missing-component-display-name";
1311
1339
  var no_missing_component_display_name_default = createRule({
1312
1340
  meta: {
1313
1341
  type: "problem",
@@ -1319,7 +1347,7 @@ var no_missing_component_display_name_default = createRule({
1319
1347
  },
1320
1348
  schema: []
1321
1349
  },
1322
- name: RULE_NAME27,
1350
+ name: RULE_NAME28,
1323
1351
  create(context) {
1324
1352
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1325
1353
  const { ctx, listeners } = useComponentCollector(context);
@@ -1343,7 +1371,7 @@ var no_missing_component_display_name_default = createRule({
1343
1371
  },
1344
1372
  defaultOptions: []
1345
1373
  });
1346
- var RULE_NAME28 = "no-missing-key";
1374
+ var RULE_NAME29 = "no-missing-key";
1347
1375
  var no_missing_key_default = createRule({
1348
1376
  meta: {
1349
1377
  type: "problem",
@@ -1356,7 +1384,7 @@ var no_missing_key_default = createRule({
1356
1384
  },
1357
1385
  schema: []
1358
1386
  },
1359
- name: RULE_NAME28,
1387
+ name: RULE_NAME29,
1360
1388
  create(context) {
1361
1389
  const isWithinChildrenToArrayRef = MutRef.make(false);
1362
1390
  function checkIteratorElement(node) {
@@ -1460,7 +1488,7 @@ var no_missing_key_default = createRule({
1460
1488
  },
1461
1489
  defaultOptions: []
1462
1490
  });
1463
- var RULE_NAME29 = "no-nested-components";
1491
+ var RULE_NAME30 = "no-nested-components";
1464
1492
  var no_nested_components_default = createRule({
1465
1493
  meta: {
1466
1494
  type: "problem",
@@ -1473,7 +1501,7 @@ var no_nested_components_default = createRule({
1473
1501
  },
1474
1502
  schema: []
1475
1503
  },
1476
- name: RULE_NAME29,
1504
+ name: RULE_NAME30,
1477
1505
  create(context) {
1478
1506
  const hint = ERComponentHint.SkipMapCallback | ERComponentHint.SkipNullLiteral | ERComponentHint.SkipUndefinedLiteral | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipNumberLiteral | ERComponentHint.StrictLogical | ERComponentHint.StrictConditional;
1479
1507
  const collector = useComponentCollector(context, hint);
@@ -1557,7 +1585,7 @@ var no_nested_components_default = createRule({
1557
1585
  },
1558
1586
  defaultOptions: []
1559
1587
  });
1560
- var RULE_NAME30 = "no-prop-types";
1588
+ var RULE_NAME31 = "no-prop-types";
1561
1589
  var no_prop_types_default = createRule({
1562
1590
  meta: {
1563
1591
  type: "problem",
@@ -1569,7 +1597,7 @@ var no_prop_types_default = createRule({
1569
1597
  },
1570
1598
  schema: []
1571
1599
  },
1572
- name: RULE_NAME30,
1600
+ name: RULE_NAME31,
1573
1601
  create(context) {
1574
1602
  if (!context.sourceCode.text.includes("propTypes")) return {};
1575
1603
  return {
@@ -1596,7 +1624,7 @@ var no_prop_types_default = createRule({
1596
1624
  },
1597
1625
  defaultOptions: []
1598
1626
  });
1599
- var RULE_NAME31 = "no-redundant-should-component-update";
1627
+ var RULE_NAME32 = "no-redundant-should-component-update";
1600
1628
  function isShouldComponentUpdate(node) {
1601
1629
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
1602
1630
  }
@@ -1611,7 +1639,7 @@ var no_redundant_should_component_update_default = createRule({
1611
1639
  },
1612
1640
  schema: []
1613
1641
  },
1614
- name: RULE_NAME31,
1642
+ name: RULE_NAME32,
1615
1643
  create(context) {
1616
1644
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
1617
1645
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -1639,7 +1667,7 @@ var no_redundant_should_component_update_default = createRule({
1639
1667
  },
1640
1668
  defaultOptions: []
1641
1669
  });
1642
- var RULE_NAME32 = "no-set-state-in-component-did-mount";
1670
+ var RULE_NAME33 = "no-set-state-in-component-did-mount";
1643
1671
  function isComponentDidMount(node) {
1644
1672
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
1645
1673
  }
@@ -1654,7 +1682,7 @@ var no_set_state_in_component_did_mount_default = createRule({
1654
1682
  },
1655
1683
  schema: []
1656
1684
  },
1657
- name: RULE_NAME32,
1685
+ name: RULE_NAME33,
1658
1686
  create(context) {
1659
1687
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
1660
1688
  function getReportDescriptor(node) {
@@ -1682,7 +1710,7 @@ var no_set_state_in_component_did_mount_default = createRule({
1682
1710
  },
1683
1711
  defaultOptions: []
1684
1712
  });
1685
- var RULE_NAME33 = "no-set-state-in-component-did-update";
1713
+ var RULE_NAME34 = "no-set-state-in-component-did-update";
1686
1714
  function isComponentDidUpdate(node) {
1687
1715
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
1688
1716
  }
@@ -1697,7 +1725,7 @@ var no_set_state_in_component_did_update_default = createRule({
1697
1725
  },
1698
1726
  schema: []
1699
1727
  },
1700
- name: RULE_NAME33,
1728
+ name: RULE_NAME34,
1701
1729
  create(context) {
1702
1730
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
1703
1731
  function getReportDescriptor(node) {
@@ -1725,7 +1753,7 @@ var no_set_state_in_component_did_update_default = createRule({
1725
1753
  },
1726
1754
  defaultOptions: []
1727
1755
  });
1728
- var RULE_NAME34 = "no-set-state-in-component-will-update";
1756
+ var RULE_NAME35 = "no-set-state-in-component-will-update";
1729
1757
  function isComponentWillUpdate3(node) {
1730
1758
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
1731
1759
  }
@@ -1740,7 +1768,7 @@ var no_set_state_in_component_will_update_default = createRule({
1740
1768
  },
1741
1769
  schema: []
1742
1770
  },
1743
- name: RULE_NAME34,
1771
+ name: RULE_NAME35,
1744
1772
  create(context) {
1745
1773
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
1746
1774
  function getReportDescriptor(node) {
@@ -1768,7 +1796,7 @@ var no_set_state_in_component_will_update_default = createRule({
1768
1796
  },
1769
1797
  defaultOptions: []
1770
1798
  });
1771
- var RULE_NAME35 = "no-string-refs";
1799
+ var RULE_NAME36 = "no-string-refs";
1772
1800
  function containsStringLiteral({ value }) {
1773
1801
  return value?.type === AST_NODE_TYPES.Literal && isString(value.value);
1774
1802
  }
@@ -1788,7 +1816,7 @@ var no_string_refs_default = createRule({
1788
1816
  },
1789
1817
  schema: []
1790
1818
  },
1791
- name: RULE_NAME35,
1819
+ name: RULE_NAME36,
1792
1820
  create(context) {
1793
1821
  return {
1794
1822
  JSXAttribute(node) {
@@ -1804,7 +1832,7 @@ var no_string_refs_default = createRule({
1804
1832
  },
1805
1833
  defaultOptions: []
1806
1834
  });
1807
- var RULE_NAME36 = "no-unsafe-component-will-mount";
1835
+ var RULE_NAME37 = "no-unsafe-component-will-mount";
1808
1836
  function isUnsafeComponentWillMount(node) {
1809
1837
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
1810
1838
  }
@@ -1819,7 +1847,7 @@ var no_unsafe_component_will_mount_default = createRule({
1819
1847
  },
1820
1848
  schema: []
1821
1849
  },
1822
- name: RULE_NAME36,
1850
+ name: RULE_NAME37,
1823
1851
  create(context) {
1824
1852
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
1825
1853
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -1843,7 +1871,7 @@ var no_unsafe_component_will_mount_default = createRule({
1843
1871
  },
1844
1872
  defaultOptions: []
1845
1873
  });
1846
- var RULE_NAME37 = "no-unsafe-component-will-receive-props";
1874
+ var RULE_NAME38 = "no-unsafe-component-will-receive-props";
1847
1875
  function isUnsafeComponentWillReceiveProps(node) {
1848
1876
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
1849
1877
  }
@@ -1858,7 +1886,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
1858
1886
  },
1859
1887
  schema: []
1860
1888
  },
1861
- name: RULE_NAME37,
1889
+ name: RULE_NAME38,
1862
1890
  create(context) {
1863
1891
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
1864
1892
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -1882,7 +1910,7 @@ var no_unsafe_component_will_receive_props_default = createRule({
1882
1910
  },
1883
1911
  defaultOptions: []
1884
1912
  });
1885
- var RULE_NAME38 = "no-unsafe-component-will-update";
1913
+ var RULE_NAME39 = "no-unsafe-component-will-update";
1886
1914
  function isUnsafeComponentWillUpdate(node) {
1887
1915
  return AST11.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
1888
1916
  }
@@ -1897,7 +1925,7 @@ var no_unsafe_component_will_update_default = createRule({
1897
1925
  },
1898
1926
  schema: []
1899
1927
  },
1900
- name: RULE_NAME38,
1928
+ name: RULE_NAME39,
1901
1929
  create(context) {
1902
1930
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
1903
1931
  const { ctx, listeners } = useComponentCollectorLegacy();
@@ -1921,7 +1949,7 @@ var no_unsafe_component_will_update_default = createRule({
1921
1949
  },
1922
1950
  defaultOptions: []
1923
1951
  });
1924
- var RULE_NAME39 = "no-unstable-context-value";
1952
+ var RULE_NAME40 = "no-unstable-context-value";
1925
1953
  var no_unstable_context_value_default = createRule({
1926
1954
  meta: {
1927
1955
  type: "problem",
@@ -1935,7 +1963,7 @@ var no_unstable_context_value_default = createRule({
1935
1963
  },
1936
1964
  schema: []
1937
1965
  },
1938
- name: RULE_NAME39,
1966
+ name: RULE_NAME40,
1939
1967
  create(context) {
1940
1968
  const { ctx, listeners } = useComponentCollector(context);
1941
1969
  const possibleValueConstructions = /* @__PURE__ */ new Map();
@@ -1988,7 +2016,7 @@ var no_unstable_context_value_default = createRule({
1988
2016
  },
1989
2017
  defaultOptions: []
1990
2018
  });
1991
- var RULE_NAME40 = "no-unstable-default-props";
2019
+ var RULE_NAME41 = "no-unstable-default-props";
1992
2020
  var no_unstable_default_props_default = createRule({
1993
2021
  meta: {
1994
2022
  type: "problem",
@@ -2000,7 +2028,7 @@ var no_unstable_default_props_default = createRule({
2000
2028
  },
2001
2029
  schema: []
2002
2030
  },
2003
- name: RULE_NAME40,
2031
+ name: RULE_NAME41,
2004
2032
  create(context) {
2005
2033
  const { ctx, listeners } = useComponentCollector(context);
2006
2034
  const possibleDestructuringDeclarators = /* @__PURE__ */ new WeakMap();
@@ -2053,7 +2081,7 @@ var no_unstable_default_props_default = createRule({
2053
2081
  },
2054
2082
  defaultOptions: []
2055
2083
  });
2056
- var RULE_NAME41 = "no-unused-class-component-members";
2084
+ var RULE_NAME42 = "no-unused-class-component-members";
2057
2085
  var LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
2058
2086
  "componentDidCatch",
2059
2087
  "componentDidMount",
@@ -2097,7 +2125,7 @@ var no_unused_class_component_members_default = createRule({
2097
2125
  },
2098
2126
  schema: []
2099
2127
  },
2100
- name: RULE_NAME41,
2128
+ name: RULE_NAME42,
2101
2129
  create(context) {
2102
2130
  const classStack = [];
2103
2131
  const methodStack = [];
@@ -2180,7 +2208,7 @@ var no_unused_class_component_members_default = createRule({
2180
2208
  },
2181
2209
  defaultOptions: []
2182
2210
  });
2183
- var RULE_NAME42 = "no-unused-state";
2211
+ var RULE_NAME43 = "no-unused-state";
2184
2212
  function getName4(node) {
2185
2213
  if (node.type === AST_NODE_TYPES.TSAsExpression) {
2186
2214
  return getName4(node.expression);
@@ -2220,7 +2248,7 @@ var no_unused_state_default = createRule({
2220
2248
  },
2221
2249
  schema: []
2222
2250
  },
2223
- name: RULE_NAME42,
2251
+ name: RULE_NAME43,
2224
2252
  create(context) {
2225
2253
  const classStack = [];
2226
2254
  const methodStack = [];
@@ -2321,7 +2349,7 @@ var no_unused_state_default = createRule({
2321
2349
  },
2322
2350
  defaultOptions: []
2323
2351
  });
2324
- var RULE_NAME43 = "no-useless-fragment";
2352
+ var RULE_NAME44 = "no-useless-fragment";
2325
2353
  function check(node, context, allowExpressions) {
2326
2354
  const initialScope = context.sourceCode.getScope(node);
2327
2355
  if (JSX7.isKeyedElement(node, initialScope)) return;
@@ -2363,7 +2391,7 @@ var no_useless_fragment_default = createRule({
2363
2391
  }
2364
2392
  }]
2365
2393
  },
2366
- name: RULE_NAME43,
2394
+ name: RULE_NAME44,
2367
2395
  create(context, [option]) {
2368
2396
  const { allowExpressions = true } = option;
2369
2397
  return {
@@ -2380,7 +2408,7 @@ var no_useless_fragment_default = createRule({
2380
2408
  allowExpressions: true
2381
2409
  }]
2382
2410
  });
2383
- var RULE_NAME44 = "prefer-destructuring-assignment";
2411
+ var RULE_NAME45 = "prefer-destructuring-assignment";
2384
2412
  function isMemberExpressionWithObjectName(node) {
2385
2413
  return node.object.type === AST_NODE_TYPES.Identifier && "name" in node.object;
2386
2414
  }
@@ -2395,7 +2423,7 @@ var prefer_destructuring_assignment_default = createRule({
2395
2423
  },
2396
2424
  schema: []
2397
2425
  },
2398
- name: RULE_NAME44,
2426
+ name: RULE_NAME45,
2399
2427
  create(context) {
2400
2428
  const { ctx, listeners } = useComponentCollector(context);
2401
2429
  const memberExpressionWithNames = [];
@@ -2450,7 +2478,7 @@ var prefer_destructuring_assignment_default = createRule({
2450
2478
  },
2451
2479
  defaultOptions: []
2452
2480
  });
2453
- var RULE_NAME45 = "prefer-react-namespace-import";
2481
+ var RULE_NAME46 = "prefer-react-namespace-import";
2454
2482
  var prefer_react_namespace_import_default = createRule({
2455
2483
  meta: {
2456
2484
  type: "problem",
@@ -2463,7 +2491,7 @@ var prefer_react_namespace_import_default = createRule({
2463
2491
  },
2464
2492
  schema: []
2465
2493
  },
2466
- name: RULE_NAME45,
2494
+ name: RULE_NAME46,
2467
2495
  create(context) {
2468
2496
  const importSource = decodeSettings(context.settings).importSource ?? "react";
2469
2497
  return {
@@ -2499,7 +2527,7 @@ ${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semiColon}`
2499
2527
  },
2500
2528
  defaultOptions: []
2501
2529
  });
2502
- var RULE_NAME46 = "prefer-read-only-props";
2530
+ var RULE_NAME47 = "prefer-read-only-props";
2503
2531
  function isReadonlyType(type, services) {
2504
2532
  try {
2505
2533
  const im = getTypeImmutability(services.program, type);
@@ -2519,7 +2547,7 @@ var prefer_read_only_props_default = createRule({
2519
2547
  },
2520
2548
  schema: []
2521
2549
  },
2522
- name: RULE_NAME46,
2550
+ name: RULE_NAME47,
2523
2551
  create(context) {
2524
2552
  const services = ESLintUtils.getParserServices(context, false);
2525
2553
  const { ctx, listeners } = useComponentCollector(context);
@@ -2539,7 +2567,7 @@ var prefer_read_only_props_default = createRule({
2539
2567
  },
2540
2568
  defaultOptions: []
2541
2569
  });
2542
- var RULE_NAME47 = "prefer-shorthand-boolean";
2570
+ var RULE_NAME48 = "prefer-shorthand-boolean";
2543
2571
  var prefer_shorthand_boolean_default = createRule({
2544
2572
  meta: {
2545
2573
  type: "problem",
@@ -2552,7 +2580,7 @@ var prefer_shorthand_boolean_default = createRule({
2552
2580
  },
2553
2581
  schema: []
2554
2582
  },
2555
- name: RULE_NAME47,
2583
+ name: RULE_NAME48,
2556
2584
  create(context) {
2557
2585
  function getReportDescriptor(node) {
2558
2586
  const { value } = node;
@@ -2574,7 +2602,7 @@ var prefer_shorthand_boolean_default = createRule({
2574
2602
  },
2575
2603
  defaultOptions: []
2576
2604
  });
2577
- var RULE_NAME48 = "prefer-shorthand-fragment";
2605
+ var RULE_NAME49 = "prefer-shorthand-fragment";
2578
2606
  var prefer_shorthand_fragment_default = createRule({
2579
2607
  meta: {
2580
2608
  type: "problem",
@@ -2586,7 +2614,7 @@ var prefer_shorthand_fragment_default = createRule({
2586
2614
  },
2587
2615
  schema: []
2588
2616
  },
2589
- name: RULE_NAME48,
2617
+ name: RULE_NAME49,
2590
2618
  create(context) {
2591
2619
  function getReportDescriptor(node) {
2592
2620
  if (!isFragmentElement(node, context)) return O.none();
@@ -2643,6 +2671,7 @@ var src_default = {
2643
2671
  "no-default-props": no_default_props_default,
2644
2672
  "no-direct-mutation-state": no_direct_mutation_state_default,
2645
2673
  "no-duplicate-key": no_duplicate_key_default,
2674
+ "no-forward-ref": no_forward_ref_default,
2646
2675
  "no-implicit-key": no_implicit_key_default,
2647
2676
  "no-leaked-conditional-rendering": no_leaked_conditional_rendering_default,
2648
2677
  "no-missing-component-display-name": no_missing_component_display_name_default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.17.4-next.5",
3
+ "version": "1.17.4-next.8",
4
4
  "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -49,17 +49,17 @@
49
49
  "compare-versions": "^6.1.1",
50
50
  "is-immutable-type": "^5.0.0",
51
51
  "ts-pattern": "^5.5.0",
52
- "@eslint-react/ast": "1.17.4-next.5",
53
- "@eslint-react/core": "1.17.4-next.5",
54
- "@eslint-react/shared": "1.17.4-next.5",
55
- "@eslint-react/jsx": "1.17.4-next.5",
56
- "@eslint-react/tools": "1.17.4-next.5",
57
- "@eslint-react/types": "1.17.4-next.5",
58
- "@eslint-react/var": "1.17.4-next.5"
52
+ "@eslint-react/ast": "1.17.4-next.8",
53
+ "@eslint-react/jsx": "1.17.4-next.8",
54
+ "@eslint-react/shared": "1.17.4-next.8",
55
+ "@eslint-react/tools": "1.17.4-next.8",
56
+ "@eslint-react/var": "1.17.4-next.8",
57
+ "@eslint-react/types": "1.17.4-next.8",
58
+ "@eslint-react/core": "1.17.4-next.8"
59
59
  },
60
60
  "devDependencies": {
61
- "@types/react": "^18.3.12",
62
- "@types/react-dom": "^18.3.1",
61
+ "@types/react": "^19.0.1",
62
+ "@types/react-dom": "^19.0.1",
63
63
  "string-ts": "^2.2.0",
64
64
  "ts-api-utils": "^2.0.0",
65
65
  "tsup": "^8.3.5"