eslint-plugin-react-dom 1.53.1-next.0 → 1.53.1-next.1
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 +19 -16
- package/dist/index.mjs +5 -9
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -27,13 +27,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
}) : target, mod));
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
let __eslint_react_shared = require("@eslint-react/shared");
|
|
31
|
+
__eslint_react_shared = __toESM(__eslint_react_shared);
|
|
32
|
+
let __eslint_react_core = require("@eslint-react/core");
|
|
33
|
+
__eslint_react_core = __toESM(__eslint_react_core);
|
|
34
|
+
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
35
|
+
__typescript_eslint_utils = __toESM(__typescript_eslint_utils);
|
|
36
|
+
let __typescript_eslint_types = require("@typescript-eslint/types");
|
|
37
|
+
__typescript_eslint_types = __toESM(__typescript_eslint_types);
|
|
38
|
+
let compare_versions = require("compare-versions");
|
|
39
|
+
compare_versions = __toESM(compare_versions);
|
|
40
|
+
let __eslint_react_kit = require("@eslint-react/kit");
|
|
41
|
+
__eslint_react_kit = __toESM(__eslint_react_kit);
|
|
42
|
+
let __eslint_react_eff = require("@eslint-react/eff");
|
|
43
|
+
__eslint_react_eff = __toESM(__eslint_react_eff);
|
|
37
44
|
|
|
38
45
|
//#region src/configs/recommended.ts
|
|
39
46
|
var recommended_exports = {};
|
|
@@ -65,7 +72,7 @@ const settings = { "react-x": __eslint_react_shared.DEFAULT_ESLINT_REACT_SETTING
|
|
|
65
72
|
//#endregion
|
|
66
73
|
//#region package.json
|
|
67
74
|
var name = "eslint-plugin-react-dom";
|
|
68
|
-
var version = "1.53.1-next.
|
|
75
|
+
var version = "1.53.1-next.1";
|
|
69
76
|
|
|
70
77
|
//#endregion
|
|
71
78
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -158,8 +165,7 @@ function create$14(context) {
|
|
|
158
165
|
return { JSXElement(node) {
|
|
159
166
|
const attributes = node.openingElement.attributes;
|
|
160
167
|
const initialScope = context.sourceCode.getScope(node);
|
|
161
|
-
|
|
162
|
-
if (hasChildren && __eslint_react_core.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
168
|
+
if ((node.children.some(isSignificantChildren) || __eslint_react_core.hasAttribute(context, "children", attributes, initialScope)) && __eslint_react_core.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
163
169
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
164
170
|
node
|
|
165
171
|
});
|
|
@@ -1566,8 +1572,7 @@ function getDOMPropertyNames(context) {
|
|
|
1566
1572
|
* @returns Whether the node is a valid HTML tag in JSX
|
|
1567
1573
|
*/
|
|
1568
1574
|
function isValidHTMLTagInJSX(childNode) {
|
|
1569
|
-
|
|
1570
|
-
if (tagConvention.test(childNode.parent.name.name)) return !childNode.parent.attributes.some((attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is");
|
|
1575
|
+
if (/^[a-z][^-]*$/.test(childNode.parent.name.name)) return !childNode.parent.attributes.some((attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is");
|
|
1571
1576
|
return false;
|
|
1572
1577
|
}
|
|
1573
1578
|
/**
|
|
@@ -1628,8 +1633,7 @@ function tagNameHasDot(node) {
|
|
|
1628
1633
|
function getStandardName(name$2, context) {
|
|
1629
1634
|
if (has(DOM_ATTRIBUTE_NAMES, name$2)) return DOM_ATTRIBUTE_NAMES[name$2];
|
|
1630
1635
|
if (has(SVGDOM_ATTRIBUTE_NAMES, name$2)) return SVGDOM_ATTRIBUTE_NAMES[name$2];
|
|
1631
|
-
|
|
1632
|
-
return names.find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1636
|
+
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1633
1637
|
}
|
|
1634
1638
|
/**
|
|
1635
1639
|
* Checks if an object has a property
|
|
@@ -1748,8 +1752,7 @@ function create$4(context) {
|
|
|
1748
1752
|
}
|
|
1749
1753
|
const standardName = getStandardName(name$2, context);
|
|
1750
1754
|
const hasStandardNameButIsNotUsed = !!standardName && standardName !== name$2;
|
|
1751
|
-
|
|
1752
|
-
if (usesStandardName) return;
|
|
1755
|
+
if (!!standardName && standardName === name$2) return;
|
|
1753
1756
|
if (hasStandardNameButIsNotUsed) {
|
|
1754
1757
|
report.send({
|
|
1755
1758
|
node,
|
package/dist/index.mjs
CHANGED
|
@@ -46,7 +46,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region package.json
|
|
48
48
|
var name = "eslint-plugin-react-dom";
|
|
49
|
-
var version = "1.53.1-next.
|
|
49
|
+
var version = "1.53.1-next.1";
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -139,8 +139,7 @@ function create$14(context) {
|
|
|
139
139
|
return { JSXElement(node) {
|
|
140
140
|
const attributes = node.openingElement.attributes;
|
|
141
141
|
const initialScope = context.sourceCode.getScope(node);
|
|
142
|
-
|
|
143
|
-
if (hasChildren && ER.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
142
|
+
if ((node.children.some(isSignificantChildren) || ER.hasAttribute(context, "children", attributes, initialScope)) && ER.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
144
143
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
145
144
|
node
|
|
146
145
|
});
|
|
@@ -1547,8 +1546,7 @@ function getDOMPropertyNames(context) {
|
|
|
1547
1546
|
* @returns Whether the node is a valid HTML tag in JSX
|
|
1548
1547
|
*/
|
|
1549
1548
|
function isValidHTMLTagInJSX(childNode) {
|
|
1550
|
-
|
|
1551
|
-
if (tagConvention.test(childNode.parent.name.name)) return !childNode.parent.attributes.some((attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is");
|
|
1549
|
+
if (/^[a-z][^-]*$/.test(childNode.parent.name.name)) return !childNode.parent.attributes.some((attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is");
|
|
1552
1550
|
return false;
|
|
1553
1551
|
}
|
|
1554
1552
|
/**
|
|
@@ -1609,8 +1607,7 @@ function tagNameHasDot(node) {
|
|
|
1609
1607
|
function getStandardName(name$2, context) {
|
|
1610
1608
|
if (has(DOM_ATTRIBUTE_NAMES, name$2)) return DOM_ATTRIBUTE_NAMES[name$2];
|
|
1611
1609
|
if (has(SVGDOM_ATTRIBUTE_NAMES, name$2)) return SVGDOM_ATTRIBUTE_NAMES[name$2];
|
|
1612
|
-
|
|
1613
|
-
return names.find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1610
|
+
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1614
1611
|
}
|
|
1615
1612
|
/**
|
|
1616
1613
|
* Checks if an object has a property
|
|
@@ -1729,8 +1726,7 @@ function create$4(context) {
|
|
|
1729
1726
|
}
|
|
1730
1727
|
const standardName = getStandardName(name$2, context);
|
|
1731
1728
|
const hasStandardNameButIsNotUsed = !!standardName && standardName !== name$2;
|
|
1732
|
-
|
|
1733
|
-
if (usesStandardName) return;
|
|
1729
|
+
if (!!standardName && standardName === name$2) return;
|
|
1734
1730
|
if (hasStandardNameButIsNotUsed) {
|
|
1735
1731
|
report.send({
|
|
1736
1732
|
node,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "1.53.1-next.
|
|
3
|
+
"version": "1.53.1-next.1",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"./package.json"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
47
|
-
"@typescript-eslint/types": "^8.
|
|
48
|
-
"@typescript-eslint/utils": "^8.
|
|
46
|
+
"@typescript-eslint/scope-manager": "^8.43.0",
|
|
47
|
+
"@typescript-eslint/types": "^8.43.0",
|
|
48
|
+
"@typescript-eslint/utils": "^8.43.0",
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.8.0",
|
|
52
|
-
"@eslint-react/ast": "1.53.1-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/shared": "1.53.1-next.
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/var": "1.53.1-next.
|
|
52
|
+
"@eslint-react/ast": "1.53.1-next.1",
|
|
53
|
+
"@eslint-react/eff": "1.53.1-next.1",
|
|
54
|
+
"@eslint-react/kit": "1.53.1-next.1",
|
|
55
|
+
"@eslint-react/shared": "1.53.1-next.1",
|
|
56
|
+
"@eslint-react/core": "1.53.1-next.1",
|
|
57
|
+
"@eslint-react/var": "1.53.1-next.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/react": "^19.1.12",
|
|
61
61
|
"@types/react-dom": "^19.1.9",
|
|
62
|
-
"tsdown": "^0.
|
|
62
|
+
"tsdown": "^0.15.0",
|
|
63
63
|
"@local/configs": "0.0.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|