eslint-plugin-react-dom 5.24.2 → 5.24.4

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -120
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -6,38 +6,27 @@ import { Check, Extract } from "@eslint-react/ast";
6
6
  import { createImportLookup } from "@eslint-react/var";
7
7
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
8
8
  import { compare } from "compare-versions";
9
-
10
9
  //#region \0rolldown/runtime.js
11
10
  var __defProp = Object.defineProperty;
12
11
  var __exportAll = (all, no_symbols) => {
13
12
  let target = {};
14
- for (var name in all) {
15
- __defProp(target, name, {
16
- get: all[name],
17
- enumerable: true
18
- });
19
- }
20
- if (!no_symbols) {
21
- __defProp(target, Symbol.toStringTag, { value: "Module" });
22
- }
13
+ for (var name in all) __defProp(target, name, {
14
+ get: all[name],
15
+ enumerable: true
16
+ });
17
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
23
18
  return target;
24
19
  };
25
-
26
20
  //#endregion
27
21
  //#region package.json
28
22
  var name$2 = "eslint-plugin-react-dom";
29
- var version = "5.24.2";
30
-
23
+ var version = "5.24.4";
31
24
  //#endregion
32
25
  //#region src/utils/create-rule.ts
33
26
  function getDocsUrl(ruleName) {
34
27
  return `https://eslint-react.xyz/docs/rules/dom-${ruleName}`;
35
28
  }
36
29
  const createRule = ESLintUtils.RuleCreator(getDocsUrl);
37
-
38
- //#endregion
39
- //#region src/rules/no-dangerously-set-innerhtml-with-children/no-dangerously-set-innerhtml-with-children.ts
40
- const RULE_NAME$15 = "no-dangerously-set-innerhtml-with-children";
41
30
  var no_dangerously_set_innerhtml_with_children_default = createRule({
42
31
  meta: {
43
32
  type: "problem",
@@ -45,7 +34,7 @@ var no_dangerously_set_innerhtml_with_children_default = createRule({
45
34
  messages: { default: "A DOM component cannot use both children and 'dangerouslySetInnerHTML'." },
46
35
  schema: []
47
36
  },
48
- name: RULE_NAME$15,
37
+ name: "no-dangerously-set-innerhtml-with-children",
49
38
  create: create$15,
50
39
  defaultOptions: []
51
40
  });
@@ -61,10 +50,6 @@ function create$15(context) {
61
50
  });
62
51
  } };
63
52
  }
64
-
65
- //#endregion
66
- //#region src/rules/no-dangerously-set-innerhtml/no-dangerously-set-innerhtml.ts
67
- const RULE_NAME$14 = "no-dangerously-set-innerhtml";
68
53
  var no_dangerously_set_innerhtml_default = createRule({
69
54
  meta: {
70
55
  type: "problem",
@@ -72,7 +57,7 @@ var no_dangerously_set_innerhtml_default = createRule({
72
57
  messages: { default: "Using 'dangerouslySetInnerHTML' may have security implications." },
73
58
  schema: []
74
59
  },
75
- name: RULE_NAME$14,
60
+ name: "no-dangerously-set-innerhtml",
76
61
  create: create$14,
77
62
  defaultOptions: []
78
63
  });
@@ -87,10 +72,6 @@ function create$14(context) {
87
72
  });
88
73
  } };
89
74
  }
90
-
91
- //#endregion
92
- //#region src/rules/no-find-dom-node/no-find-dom-node.ts
93
- const RULE_NAME$13 = "no-find-dom-node";
94
75
  var no_find_dom_node_default = createRule({
95
76
  meta: {
96
77
  type: "problem",
@@ -98,7 +79,7 @@ var no_find_dom_node_default = createRule({
98
79
  messages: { default: "[Deprecated] Use alternatives instead." },
99
80
  schema: []
100
81
  },
101
- name: RULE_NAME$13,
82
+ name: "no-find-dom-node",
102
83
  create: create$13,
103
84
  defaultOptions: []
104
85
  });
@@ -126,10 +107,6 @@ function create$13(context) {
126
107
  }
127
108
  } };
128
109
  }
129
-
130
- //#endregion
131
- //#region src/rules/no-flush-sync/no-flush-sync.ts
132
- const RULE_NAME$12 = "no-flush-sync";
133
110
  var no_flush_sync_default = createRule({
134
111
  meta: {
135
112
  type: "problem",
@@ -137,7 +114,7 @@ var no_flush_sync_default = createRule({
137
114
  messages: { default: "Using 'flushSync' is uncommon and can hurt the performance of your app." },
138
115
  schema: []
139
116
  },
140
- name: RULE_NAME$12,
117
+ name: "no-flush-sync",
141
118
  create: create$12,
142
119
  defaultOptions: []
143
120
  });
@@ -162,10 +139,6 @@ function create$12(context) {
162
139
  }
163
140
  } };
164
141
  }
165
-
166
- //#endregion
167
- //#region src/rules/no-hydrate/no-hydrate.ts
168
- const RULE_NAME$11 = "no-hydrate";
169
142
  var no_hydrate_default = createRule({
170
143
  meta: {
171
144
  type: "problem",
@@ -174,7 +147,7 @@ var no_hydrate_default = createRule({
174
147
  messages: { default: "[Deprecated] Use 'hydrateRoot()' instead." },
175
148
  schema: []
176
149
  },
177
- name: RULE_NAME$11,
150
+ name: "no-hydrate",
178
151
  create: create$11,
179
152
  defaultOptions: []
180
153
  });
@@ -211,7 +184,6 @@ function buildFix$2(context, node) {
211
184
  return [fixer.insertTextBefore(context.sourceCode.ast, "import { hydrateRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `hydrateRoot(${getText(arg1)}, ${getText(arg0)})`)];
212
185
  };
213
186
  }
214
-
215
187
  //#endregion
216
188
  //#region ../../.pkgs/eff/dist/index.js
217
189
  const pipeArguments = (self, args) => {
@@ -236,7 +208,7 @@ const pipeArguments = (self, args) => {
236
208
  const Prototype = { pipe() {
237
209
  return pipeArguments(this, arguments);
238
210
  } };
239
- const Class = (function() {
211
+ (function() {
240
212
  function PipeableBase() {}
241
213
  PipeableBase.prototype = Prototype;
242
214
  return PipeableBase;
@@ -271,23 +243,18 @@ const dual = function(arity, body) {
271
243
  };
272
244
  const identity = (a) => a;
273
245
  const cast = identity;
274
- const constant = (value) => () => value;
275
- const constTrue = constant(true);
276
- const constFalse = constant(false);
277
- const constNull = constant(null);
278
- const constUndefined = constant(void 0);
279
- const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
246
+ dual(2, (ab, bc) => (a) => bc(ab(a)));
280
247
  const absurd = (_) => {
281
248
  throw new Error("Called `absurd` function which should be uncallable");
282
249
  };
283
- const hole = cast(absurd);
284
- const and = dual(2, (a, b) => (data) => a(data) && b(data));
285
- const or = dual(2, (a, b) => (data) => a(data) || b(data));
286
- const xor = dual(2, (a, b) => (data) => a(data) !== b(data));
287
- const eqv = dual(2, (a, b) => (data) => a(data) === b(data));
288
- const implies = dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
289
- const nor = dual(2, (a, b) => (data) => !a(data) && !b(data));
290
- const nand = dual(2, (a, b) => (data) => !a(data) || !b(data));
250
+ cast(absurd);
251
+ dual(2, (a, b) => (data) => a(data) && b(data));
252
+ dual(2, (a, b) => (data) => a(data) || b(data));
253
+ dual(2, (a, b) => (data) => a(data) !== b(data));
254
+ dual(2, (a, b) => (data) => a(data) === b(data));
255
+ dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
256
+ dual(2, (a, b) => (data) => !a(data) && !b(data));
257
+ dual(2, (a, b) => (data) => !a(data) || !b(data));
291
258
  function isString(input) {
292
259
  return typeof input === "string";
293
260
  }
@@ -297,22 +264,21 @@ function isFunction(input) {
297
264
  function isObjectKeyword(input) {
298
265
  return typeof input === "object" && input !== null || isFunction(input);
299
266
  }
300
- const hasProperty = dual(2, (data, property) => isObjectKeyword(data) && property in data);
301
- const dropWhile = dual(2, (self, predicate) => {
267
+ dual(2, (data, property) => isObjectKeyword(data) && property in data);
268
+ dual(2, (self, predicate) => {
302
269
  const input = Array.isArray(self) ? self : Array.from(self);
303
270
  const len = input.length;
304
271
  let idx = 0;
305
272
  while (idx < len && predicate(input[idx], idx)) idx++;
306
273
  return input.slice(idx);
307
274
  });
308
- const takeWhile = dual(2, (self, predicate) => {
275
+ dual(2, (self, predicate) => {
309
276
  const input = Array.isArray(self) ? self : Array.from(self);
310
277
  const len = input.length;
311
278
  let idx = 0;
312
279
  while (idx < len && predicate(input[idx], idx)) idx++;
313
280
  return input.slice(0, idx);
314
281
  });
315
-
316
282
  //#endregion
317
283
  //#region src/utils/create-jsx-element-resolver.ts
318
284
  function createJsxElementResolver(context) {
@@ -333,7 +299,6 @@ function createJsxElementResolver(context) {
333
299
  return result;
334
300
  } };
335
301
  }
336
-
337
302
  //#endregion
338
303
  //#region src/rules/no-missing-button-type/no-missing-button-type.ts
339
304
  const RULE_NAME$10 = "no-missing-button-type";
@@ -376,10 +341,6 @@ function create$10(context) {
376
341
  });
377
342
  } };
378
343
  }
379
-
380
- //#endregion
381
- //#region src/rules/no-missing-iframe-sandbox/no-missing-iframe-sandbox.ts
382
- const RULE_NAME$9 = "no-missing-iframe-sandbox";
383
344
  var no_missing_iframe_sandbox_default = createRule({
384
345
  meta: {
385
346
  type: "problem",
@@ -392,7 +353,7 @@ var no_missing_iframe_sandbox_default = createRule({
392
353
  },
393
354
  schema: []
394
355
  },
395
- name: RULE_NAME$9,
356
+ name: "no-missing-iframe-sandbox",
396
357
  create: create$9,
397
358
  defaultOptions: []
398
359
  });
@@ -432,7 +393,6 @@ function create$9(context) {
432
393
  });
433
394
  } };
434
395
  }
435
-
436
396
  //#endregion
437
397
  //#region src/rules/no-render-return-value/no-render-return-value.ts
438
398
  const RULE_NAME$8 = "no-render-return-value";
@@ -483,10 +443,6 @@ function isReturnValueUsed(node) {
483
443
  while (Check.isTypeExpression(parent)) parent = parent.parent;
484
444
  return BANNED_PARENT_TYPES.includes(parent.type);
485
445
  }
486
-
487
- //#endregion
488
- //#region src/rules/no-render/no-render.ts
489
- const RULE_NAME$7 = "no-render";
490
446
  var no_render_default = createRule({
491
447
  meta: {
492
448
  type: "problem",
@@ -495,7 +451,7 @@ var no_render_default = createRule({
495
451
  messages: { default: "[Deprecated] Use 'createRoot(node).render()' instead." },
496
452
  schema: []
497
453
  },
498
- name: RULE_NAME$7,
454
+ name: "no-render",
499
455
  create: create$7,
500
456
  defaultOptions: []
501
457
  });
@@ -535,10 +491,6 @@ function buildFix$1(context, node) {
535
491
  return [fixer.insertTextBefore(context.sourceCode.ast, "import { createRoot } from \"react-dom/client\";\n"), fixer.replaceText(node, `createRoot(${getText(arg1)}).render(${getText(arg0)})`)];
536
492
  };
537
493
  }
538
-
539
- //#endregion
540
- //#region src/rules/no-script-url/no-script-url.ts
541
- const RULE_NAME$6 = "no-script-url";
542
494
  var no_script_url_default = createRule({
543
495
  meta: {
544
496
  type: "problem",
@@ -546,7 +498,7 @@ var no_script_url_default = createRule({
546
498
  messages: { default: "Using a `javascript:` URL is a security risk and should be avoided." },
547
499
  schema: []
548
500
  },
549
- name: RULE_NAME$6,
501
+ name: "no-script-url",
550
502
  create: create$6,
551
503
  defaultOptions: []
552
504
  });
@@ -560,10 +512,6 @@ function create$6(context) {
560
512
  });
561
513
  } };
562
514
  }
563
-
564
- //#endregion
565
- //#region src/rules/no-string-style-prop/no-string-style-prop.ts
566
- const RULE_NAME$5 = "no-string-style-prop";
567
515
  var no_string_style_prop_default = createRule({
568
516
  meta: {
569
517
  type: "problem",
@@ -571,7 +519,7 @@ var no_string_style_prop_default = createRule({
571
519
  messages: { default: "Do not use string style prop. Use an object instead." },
572
520
  schema: []
573
521
  },
574
- name: RULE_NAME$5,
522
+ name: "no-string-style-prop",
575
523
  create: create$5,
576
524
  defaultOptions: []
577
525
  });
@@ -588,7 +536,6 @@ function create$5(context) {
588
536
  });
589
537
  } };
590
538
  }
591
-
592
539
  //#endregion
593
540
  //#region src/rules/no-unknown-property/lib.ts
594
541
  const DOM_ATTRIBUTE_NAMES = {
@@ -1468,14 +1415,13 @@ const REACT_ON_PROPS = [
1468
1415
  "onPointerUp",
1469
1416
  "onPointerUpCapture"
1470
1417
  ];
1471
- const POPOVER_API_PROPS = [
1418
+ const REACT_19_PROPS = [...[
1472
1419
  "popover",
1473
1420
  "popoverTarget",
1474
1421
  "popoverTargetAction",
1475
1422
  "onToggle",
1476
1423
  "onBeforeToggle"
1477
- ];
1478
- const REACT_19_PROPS = [...POPOVER_API_PROPS];
1424
+ ]];
1479
1425
  const REACT_19_ATTRIBUTE_TAGS_MAP = {
1480
1426
  blocking: [
1481
1427
  "link",
@@ -1560,7 +1506,6 @@ function getStandardName(name, context) {
1560
1506
  function getText(context, node) {
1561
1507
  return context.sourceCode.getText(node);
1562
1508
  }
1563
-
1564
1509
  //#endregion
1565
1510
  //#region src/rules/no-unknown-property/no-unknown-property.ts
1566
1511
  const RULE_NAME$4 = "no-unknown-property";
@@ -1568,18 +1513,17 @@ const DEFAULTS = {
1568
1513
  ignore: [],
1569
1514
  requireDataLowercase: false
1570
1515
  };
1571
- const messages = {
1572
- "data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
1573
- "invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
1574
- "unknown-prop": "Unknown property '{{name}}' found",
1575
- "unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
1576
- };
1577
1516
  var no_unknown_property_default = createRule({
1578
1517
  meta: {
1579
1518
  type: "problem",
1580
1519
  docs: { description: "Disallows unknown 'DOM' properties." },
1581
1520
  fixable: "code",
1582
- messages,
1521
+ messages: {
1522
+ "data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
1523
+ "invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
1524
+ "unknown-prop": "Unknown property '{{name}}' found",
1525
+ "unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
1526
+ },
1583
1527
  schema: [{
1584
1528
  type: "object",
1585
1529
  additionalProperties: false,
@@ -1665,7 +1609,6 @@ function create$4(context) {
1665
1609
  });
1666
1610
  } };
1667
1611
  }
1668
-
1669
1612
  //#endregion
1670
1613
  //#region src/rules/no-unsafe-iframe-sandbox/no-unsafe-iframe-sandbox.ts
1671
1614
  const RULE_NAME$3 = "no-unsafe-iframe-sandbox";
@@ -1697,7 +1640,6 @@ function create$3(context) {
1697
1640
  });
1698
1641
  } };
1699
1642
  }
1700
-
1701
1643
  //#endregion
1702
1644
  //#region src/rules/no-unsafe-target-blank/lib.ts
1703
1645
  function isExternalLinkLike(value) {
@@ -1708,10 +1650,6 @@ function isSafeRel(value) {
1708
1650
  if (!isString(value)) return false;
1709
1651
  return value === "noreferrer" || /\bnoreferrer\b/u.test(value);
1710
1652
  }
1711
-
1712
- //#endregion
1713
- //#region src/rules/no-unsafe-target-blank/no-unsafe-target-blank.ts
1714
- const RULE_NAME$2 = "no-unsafe-target-blank";
1715
1653
  var no_unsafe_target_blank_default = createRule({
1716
1654
  meta: {
1717
1655
  type: "problem",
@@ -1724,7 +1662,7 @@ var no_unsafe_target_blank_default = createRule({
1724
1662
  },
1725
1663
  schema: []
1726
1664
  },
1727
- name: RULE_NAME$2,
1665
+ name: "no-unsafe-target-blank",
1728
1666
  create: create$2,
1729
1667
  defaultOptions: []
1730
1668
  });
@@ -1734,8 +1672,7 @@ function create$2(context) {
1734
1672
  const { domElementType } = resolver.resolve(node);
1735
1673
  if (domElementType !== "a") return;
1736
1674
  if (getAttributeStaticValue(context, node, "target") !== "_blank") return;
1737
- const hrefValue = getAttributeStaticValue(context, node, "href");
1738
- if (!isExternalLinkLike(hrefValue)) return;
1675
+ if (!isExternalLinkLike(getAttributeStaticValue(context, node, "href"))) return;
1739
1676
  const relProp = findAttribute(context, node, "rel");
1740
1677
  if (relProp == null) {
1741
1678
  context.report({
@@ -1750,8 +1687,7 @@ function create$2(context) {
1750
1687
  });
1751
1688
  return;
1752
1689
  }
1753
- const relValue = getAttributeStaticValue(context, node, "rel");
1754
- if (isSafeRel(relValue)) return;
1690
+ if (isSafeRel(getAttributeStaticValue(context, node, "rel"))) return;
1755
1691
  context.report({
1756
1692
  messageId: "default",
1757
1693
  node: relProp,
@@ -1764,10 +1700,6 @@ function create$2(context) {
1764
1700
  });
1765
1701
  } };
1766
1702
  }
1767
-
1768
- //#endregion
1769
- //#region src/rules/no-use-form-state/no-use-form-state.ts
1770
- const RULE_NAME$1 = "no-use-form-state";
1771
1703
  var no_use_form_state_default = createRule({
1772
1704
  meta: {
1773
1705
  type: "problem",
@@ -1776,7 +1708,7 @@ var no_use_form_state_default = createRule({
1776
1708
  messages: { default: "[Deprecated] Use 'useActionState' from 'react' package instead." },
1777
1709
  schema: []
1778
1710
  },
1779
- name: RULE_NAME$1,
1711
+ name: "no-use-form-state",
1780
1712
  create: create$1,
1781
1713
  defaultOptions: []
1782
1714
  });
@@ -1811,7 +1743,6 @@ function buildFix(context, node) {
1811
1743
  return [fixer.insertTextBefore(context.sourceCode.ast, `import { useActionState } from "${importSource}";\n`), fixer.replaceText(node.callee, "useActionState")];
1812
1744
  };
1813
1745
  }
1814
-
1815
1746
  //#endregion
1816
1747
  //#region src/rules/no-void-elements-with-children/lib.ts
1817
1748
  const KNOWN_VOID_ELEMENTS = /* @__PURE__ */ new Set([
@@ -1832,10 +1763,6 @@ const KNOWN_VOID_ELEMENTS = /* @__PURE__ */ new Set([
1832
1763
  "track",
1833
1764
  "wbr"
1834
1765
  ]);
1835
-
1836
- //#endregion
1837
- //#region src/rules/no-void-elements-with-children/no-void-elements-with-children.ts
1838
- const RULE_NAME = "no-void-elements-with-children";
1839
1766
  var no_void_elements_with_children_default = createRule({
1840
1767
  meta: {
1841
1768
  type: "problem",
@@ -1843,7 +1770,7 @@ var no_void_elements_with_children_default = createRule({
1843
1770
  messages: { default: "'{{elementType}}' is a void element tag and must not have children." },
1844
1771
  schema: []
1845
1772
  },
1846
- name: RULE_NAME,
1773
+ name: "no-void-elements-with-children",
1847
1774
  create,
1848
1775
  defaultOptions: []
1849
1776
  });
@@ -1859,7 +1786,6 @@ function create(context) {
1859
1786
  });
1860
1787
  } };
1861
1788
  }
1862
-
1863
1789
  //#endregion
1864
1790
  //#region src/plugin.ts
1865
1791
  const plugin = {
@@ -1886,7 +1812,6 @@ const plugin = {
1886
1812
  "no-void-elements-with-children": no_void_elements_with_children_default
1887
1813
  }
1888
1814
  };
1889
-
1890
1815
  //#endregion
1891
1816
  //#region src/configs/recommended.ts
1892
1817
  var recommended_exports = /* @__PURE__ */ __exportAll({
@@ -1911,7 +1836,6 @@ const rules$1 = {
1911
1836
  };
1912
1837
  const plugins$1 = { "react-dom": plugin };
1913
1838
  const settings$1 = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
1914
-
1915
1839
  //#endregion
1916
1840
  //#region src/configs/strict.ts
1917
1841
  var strict_exports = /* @__PURE__ */ __exportAll({
@@ -1929,7 +1853,6 @@ const rules = {
1929
1853
  };
1930
1854
  const plugins = { ...plugins$1 };
1931
1855
  const settings = { ...settings$1 };
1932
-
1933
1856
  //#endregion
1934
1857
  //#region src/index.ts
1935
1858
  function createConfig(base) {
@@ -1950,6 +1873,5 @@ const finalPlugin = {
1950
1873
  ["strict"]: createConfig(strict_exports)
1951
1874
  }
1952
1875
  };
1953
-
1954
1876
  //#endregion
1955
- export { finalPlugin as default };
1877
+ export { finalPlugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-dom",
3
- "version": "5.24.2",
3
+ "version": "5.24.4",
4
4
  "description": "ESLint React's ESLint plugin for DOM related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,11 +37,11 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@eslint-react/ast": "5.24.2",
41
- "@eslint-react/eslint": "5.24.2",
42
- "@eslint-react/jsx": "5.24.2",
43
- "@eslint-react/shared": "5.24.2",
44
- "@eslint-react/var": "5.24.2",
40
+ "@eslint-react/ast": "5.24.4",
41
+ "@eslint-react/eslint": "5.24.4",
42
+ "@eslint-react/jsx": "5.24.4",
43
+ "@eslint-react/shared": "5.24.4",
44
+ "@eslint-react/var": "5.24.4",
45
45
  "@typescript-eslint/types": "^8.71.0",
46
46
  "@typescript-eslint/utils": "^8.71.0",
47
47
  "compare-versions": "^6.1.1",