eslint-plugin-react-dom 5.8.2 → 5.8.4-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +29 -4
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ var __exportAll = (all, no_symbols) => {
25
25
  //#endregion
26
26
  //#region package.json
27
27
  var name$2 = "eslint-plugin-react-dom";
28
- var version = "5.8.2";
28
+ var version = "5.8.4-beta.0";
29
29
 
30
30
  //#endregion
31
31
  //#region src/utils/create-rule.ts
@@ -1454,6 +1454,18 @@ const POPOVER_API_PROPS = [
1454
1454
  "onToggle",
1455
1455
  "onBeforeToggle"
1456
1456
  ];
1457
+ const REACT_19_PROPS = [...POPOVER_API_PROPS];
1458
+ /**
1459
+ * Tag-specific attributes added in React 19
1460
+ */
1461
+ const REACT_19_ATTRIBUTE_TAGS_MAP = {
1462
+ blocking: [
1463
+ "link",
1464
+ "script",
1465
+ "style"
1466
+ ],
1467
+ precedence: ["link", "style"]
1468
+ };
1457
1469
  /**
1458
1470
  * Tests React version against a comparator
1459
1471
  * @param context ESLint context
@@ -1477,11 +1489,23 @@ function getDOMPropertyNames(context) {
1477
1489
  return ALL_DOM_PROPERTY_NAMES;
1478
1490
  }
1479
1491
  if (testReactVersion(context, ">=", "16.4.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_ON_PROPS);
1480
- if (testReactVersion(context, ">=", "19.0.0-rc.0")) ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS);
1481
- else ALL_DOM_PROPERTY_NAMES.push(...POPOVER_API_PROPS.map((prop) => prop.toLowerCase()));
1492
+ if (testReactVersion(context, ">=", "19.0.0-rc.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_19_PROPS);
1493
+ else ALL_DOM_PROPERTY_NAMES.push(...REACT_19_PROPS.map((prop) => prop.toLowerCase()));
1482
1494
  return ALL_DOM_PROPERTY_NAMES;
1483
1495
  }
1484
1496
  /**
1497
+ * Gets the map of attributes to their allowed tags based on React version
1498
+ * @param context ESLint rule context
1499
+ * @returns Map of attributes to allowed tags
1500
+ */
1501
+ function getAttributeTagsMap(context) {
1502
+ if (testReactVersion(context, ">=", "19.0.0-rc.0")) return {
1503
+ ...ATTRIBUTE_TAGS_MAP,
1504
+ ...REACT_19_ATTRIBUTE_TAGS_MAP
1505
+ };
1506
+ return ATTRIBUTE_TAGS_MAP;
1507
+ }
1508
+ /**
1485
1509
  * Check if a node's parent is a JSX tag that is written with lowercase letters,
1486
1510
  * and is not a custom web component.
1487
1511
  * @param childNode JSX element being tested
@@ -1649,7 +1673,8 @@ function create$4(context) {
1649
1673
  const tagName = getTagName(node);
1650
1674
  if (tagName === "fbt" || tagName === "fbs") return;
1651
1675
  if (!isValidHTMLTagInJSX(node)) return;
1652
- const allowedTags = has(ATTRIBUTE_TAGS_MAP, name) ? ATTRIBUTE_TAGS_MAP[name] : null;
1676
+ const attributeTagsMap = getAttributeTagsMap(context);
1677
+ const allowedTags = has(attributeTagsMap, name) ? attributeTagsMap[name] : null;
1653
1678
  if (tagName != null && allowedTags != null) {
1654
1679
  if (!allowedTags.includes(tagName)) context.report({
1655
1680
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-dom",
3
- "version": "5.8.2",
3
+ "version": "5.8.4-beta.0",
4
4
  "description": "ESLint React's ESLint plugin for DOM related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -40,10 +40,10 @@
40
40
  "@typescript-eslint/types": "^8.59.3",
41
41
  "@typescript-eslint/utils": "^8.59.3",
42
42
  "compare-versions": "^6.1.1",
43
- "@eslint-react/jsx": "5.8.2",
44
- "@eslint-react/shared": "5.8.2",
45
- "@eslint-react/ast": "5.8.2",
46
- "@eslint-react/eslint": "5.8.2"
43
+ "@eslint-react/ast": "5.8.4-beta.0",
44
+ "@eslint-react/jsx": "5.8.4-beta.0",
45
+ "@eslint-react/shared": "5.8.4-beta.0",
46
+ "@eslint-react/eslint": "5.8.4-beta.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/react": "^19.2.14",
@@ -52,8 +52,8 @@
52
52
  "eslint": "^10.4.0",
53
53
  "tsdown": "^0.22.0",
54
54
  "typescript": "^6.0.3",
55
- "@local/configs": "0.0.0",
56
- "@local/eff": "3.0.0-beta.72"
55
+ "@local/eff": "3.0.0-beta.72",
56
+ "@local/configs": "0.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "eslint": "^10.3.0",