eslint-plugin-react-dom 5.21.2 → 5.22.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 +43 -6
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region package.json
|
|
28
28
|
var name$2 = "eslint-plugin-react-dom";
|
|
29
|
-
var version = "5.
|
|
29
|
+
var version = "5.22.0";
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/utils/create-rule.ts
|
|
@@ -634,6 +634,7 @@ const ATTRIBUTE_TAGS_MAP = {
|
|
|
634
634
|
autoPictureInPicture: ["video"],
|
|
635
635
|
charset: ["meta"],
|
|
636
636
|
checked: ["input"],
|
|
637
|
+
closedby: ["dialog"],
|
|
637
638
|
controls: ["audio", "video"],
|
|
638
639
|
controlsList: ["audio", "video"],
|
|
639
640
|
crossOrigin: [
|
|
@@ -706,7 +707,8 @@ const ATTRIBUTE_TAGS_MAP = {
|
|
|
706
707
|
"picture",
|
|
707
708
|
"iframe",
|
|
708
709
|
"object",
|
|
709
|
-
"source"
|
|
710
|
+
"source",
|
|
711
|
+
"body"
|
|
710
712
|
],
|
|
711
713
|
onLoadedData: ["audio", "video"],
|
|
712
714
|
onLoadedMetadata: ["audio", "video"],
|
|
@@ -730,6 +732,10 @@ const ATTRIBUTE_TAGS_MAP = {
|
|
|
730
732
|
property: ["meta"],
|
|
731
733
|
returnValue: ["dialog"],
|
|
732
734
|
scrolling: ["iframe"],
|
|
735
|
+
shadowrootclonable: ["template"],
|
|
736
|
+
shadowrootdelegatesfocus: ["template"],
|
|
737
|
+
shadowrootmode: ["template"],
|
|
738
|
+
shadowrootserializable: ["template"],
|
|
733
739
|
valign: [
|
|
734
740
|
"tr",
|
|
735
741
|
"td",
|
|
@@ -1032,6 +1038,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
|
|
|
1032
1038
|
"onMouseUp",
|
|
1033
1039
|
"onPaste",
|
|
1034
1040
|
"onScroll",
|
|
1041
|
+
"onScrollEnd",
|
|
1035
1042
|
"onSelect",
|
|
1036
1043
|
"onSubmit",
|
|
1037
1044
|
"onToggle",
|
|
@@ -1280,6 +1287,7 @@ const DOM_PROPERTY_NAMES_TWO_WORDS = [
|
|
|
1280
1287
|
"onTouchMoveCapture",
|
|
1281
1288
|
"onTouchStartCapture",
|
|
1282
1289
|
"onScrollCapture",
|
|
1290
|
+
"onScrollEndCapture",
|
|
1283
1291
|
"onWheelCapture",
|
|
1284
1292
|
"onAnimationEndCapture",
|
|
1285
1293
|
"onAnimationIteration",
|
|
@@ -1426,6 +1434,25 @@ const REACT_19_ATTRIBUTE_TAGS_MAP = {
|
|
|
1426
1434
|
precedence: ["link", "style"]
|
|
1427
1435
|
};
|
|
1428
1436
|
/**
|
|
1437
|
+
* DOM properties added in React 19.3
|
|
1438
|
+
*/
|
|
1439
|
+
const REACT_19_3_PROPS = [
|
|
1440
|
+
"credentialless",
|
|
1441
|
+
"maskType",
|
|
1442
|
+
"onFullscreenChange",
|
|
1443
|
+
"onFullscreenChangeCapture",
|
|
1444
|
+
"onFullscreenError",
|
|
1445
|
+
"onFullscreenErrorCapture"
|
|
1446
|
+
];
|
|
1447
|
+
/**
|
|
1448
|
+
* Tag-specific attributes added in React 19.3
|
|
1449
|
+
*/
|
|
1450
|
+
const REACT_19_3_ATTRIBUTE_TAGS_MAP = { credentialless: ["iframe"] };
|
|
1451
|
+
/**
|
|
1452
|
+
* SVG attribute mappings added in React 19.3
|
|
1453
|
+
*/
|
|
1454
|
+
const REACT_19_3_SVGDOM_ATTRIBUTE_NAMES = { "mask-type": "maskType" };
|
|
1455
|
+
/**
|
|
1429
1456
|
* Tests React version against a comparator
|
|
1430
1457
|
* @param context ESLint context
|
|
1431
1458
|
* @param comparator Comparison operator
|
|
@@ -1450,6 +1477,7 @@ function getDOMPropertyNames(context) {
|
|
|
1450
1477
|
if (testReactVersion(context, ">=", "16.4.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_ON_PROPS);
|
|
1451
1478
|
if (testReactVersion(context, ">=", "19.0.0-rc.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_19_PROPS);
|
|
1452
1479
|
else ALL_DOM_PROPERTY_NAMES.push(...REACT_19_PROPS.map((prop) => prop.toLowerCase()));
|
|
1480
|
+
if (testReactVersion(context, ">=", "19.3.0")) ALL_DOM_PROPERTY_NAMES.push(...REACT_19_3_PROPS);
|
|
1453
1481
|
return ALL_DOM_PROPERTY_NAMES;
|
|
1454
1482
|
}
|
|
1455
1483
|
/**
|
|
@@ -1458,11 +1486,16 @@ function getDOMPropertyNames(context) {
|
|
|
1458
1486
|
* @returns Map of attributes to allowed tags
|
|
1459
1487
|
*/
|
|
1460
1488
|
function getAttributeTagsMap(context) {
|
|
1461
|
-
|
|
1462
|
-
|
|
1489
|
+
let attributeTagsMap = ATTRIBUTE_TAGS_MAP;
|
|
1490
|
+
if (testReactVersion(context, ">=", "19.0.0-rc.0")) attributeTagsMap = {
|
|
1491
|
+
...attributeTagsMap,
|
|
1463
1492
|
...REACT_19_ATTRIBUTE_TAGS_MAP
|
|
1464
1493
|
};
|
|
1465
|
-
|
|
1494
|
+
if (testReactVersion(context, ">=", "19.3.0")) attributeTagsMap = {
|
|
1495
|
+
...attributeTagsMap,
|
|
1496
|
+
...REACT_19_3_ATTRIBUTE_TAGS_MAP
|
|
1497
|
+
};
|
|
1498
|
+
return attributeTagsMap;
|
|
1466
1499
|
}
|
|
1467
1500
|
/**
|
|
1468
1501
|
* Check if a node's parent is a JSX tag that is written with lowercase letters,
|
|
@@ -1540,7 +1573,11 @@ function has(obj, key) {
|
|
|
1540
1573
|
*/
|
|
1541
1574
|
function getStandardName(name, context) {
|
|
1542
1575
|
if (has(DOM_ATTRIBUTE_NAMES, name)) return DOM_ATTRIBUTE_NAMES[name] ?? null;
|
|
1543
|
-
|
|
1576
|
+
const svgAttributeNames = testReactVersion(context, ">=", "19.3.0") ? {
|
|
1577
|
+
...SVGDOM_ATTRIBUTE_NAMES,
|
|
1578
|
+
...REACT_19_3_SVGDOM_ATTRIBUTE_NAMES
|
|
1579
|
+
} : SVGDOM_ATTRIBUTE_NAMES;
|
|
1580
|
+
if (has(svgAttributeNames, name)) return svgAttributeNames[name] ?? null;
|
|
1544
1581
|
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name.toLowerCase()) ?? null;
|
|
1545
1582
|
}
|
|
1546
1583
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.22.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.
|
|
41
|
-
"@eslint-react/core": "5.
|
|
42
|
-
"@eslint-react/eslint": "5.
|
|
43
|
-
"@eslint-react/jsx": "5.
|
|
44
|
-
"@eslint-react/shared": "5.
|
|
45
|
-
"@eslint-react/var": "5.
|
|
40
|
+
"@eslint-react/ast": "5.22.0",
|
|
41
|
+
"@eslint-react/core": "5.22.0",
|
|
42
|
+
"@eslint-react/eslint": "5.22.0",
|
|
43
|
+
"@eslint-react/jsx": "5.22.0",
|
|
44
|
+
"@eslint-react/shared": "5.22.0",
|
|
45
|
+
"@eslint-react/var": "5.22.0",
|
|
46
46
|
"@typescript-eslint/types": "^8.70.1",
|
|
47
47
|
"@typescript-eslint/utils": "^8.70.1",
|
|
48
48
|
"compare-versions": "^6.1.1"
|