eslint-plugin-react-dom 1.53.1-next.0 → 1.53.1-next.2
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 +23 -19
- package/dist/index.mjs +9 -12
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -5,11 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (
|
|
8
|
+
var __export = (all) => {
|
|
9
|
+
let target = {};
|
|
9
10
|
for (var name$2 in all) __defProp(target, name$2, {
|
|
10
11
|
get: all[name$2],
|
|
11
12
|
enumerable: true
|
|
12
13
|
});
|
|
14
|
+
return target;
|
|
13
15
|
};
|
|
14
16
|
var __copyProps = (to, from, except, desc) => {
|
|
15
17
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -27,17 +29,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
29
|
}) : target, mod));
|
|
28
30
|
|
|
29
31
|
//#endregion
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
let __eslint_react_shared = require("@eslint-react/shared");
|
|
33
|
+
__eslint_react_shared = __toESM(__eslint_react_shared);
|
|
34
|
+
let __eslint_react_core = require("@eslint-react/core");
|
|
35
|
+
__eslint_react_core = __toESM(__eslint_react_core);
|
|
36
|
+
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
37
|
+
__typescript_eslint_utils = __toESM(__typescript_eslint_utils);
|
|
38
|
+
let __typescript_eslint_types = require("@typescript-eslint/types");
|
|
39
|
+
__typescript_eslint_types = __toESM(__typescript_eslint_types);
|
|
40
|
+
let compare_versions = require("compare-versions");
|
|
41
|
+
compare_versions = __toESM(compare_versions);
|
|
42
|
+
let __eslint_react_kit = require("@eslint-react/kit");
|
|
43
|
+
__eslint_react_kit = __toESM(__eslint_react_kit);
|
|
44
|
+
let __eslint_react_eff = require("@eslint-react/eff");
|
|
45
|
+
__eslint_react_eff = __toESM(__eslint_react_eff);
|
|
37
46
|
|
|
38
47
|
//#region src/configs/recommended.ts
|
|
39
|
-
var recommended_exports = {
|
|
40
|
-
__export(recommended_exports, {
|
|
48
|
+
var recommended_exports = __export({
|
|
41
49
|
name: () => name$1,
|
|
42
50
|
rules: () => rules,
|
|
43
51
|
settings: () => settings
|
|
@@ -65,7 +73,7 @@ const settings = { "react-x": __eslint_react_shared.DEFAULT_ESLINT_REACT_SETTING
|
|
|
65
73
|
//#endregion
|
|
66
74
|
//#region package.json
|
|
67
75
|
var name = "eslint-plugin-react-dom";
|
|
68
|
-
var version = "1.53.1-next.
|
|
76
|
+
var version = "1.53.1-next.2";
|
|
69
77
|
|
|
70
78
|
//#endregion
|
|
71
79
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -158,8 +166,7 @@ function create$14(context) {
|
|
|
158
166
|
return { JSXElement(node) {
|
|
159
167
|
const attributes = node.openingElement.attributes;
|
|
160
168
|
const initialScope = context.sourceCode.getScope(node);
|
|
161
|
-
|
|
162
|
-
if (hasChildren && __eslint_react_core.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
169
|
+
if ((node.children.some(isSignificantChildren) || __eslint_react_core.hasAttribute(context, "children", attributes, initialScope)) && __eslint_react_core.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
163
170
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
164
171
|
node
|
|
165
172
|
});
|
|
@@ -1566,8 +1573,7 @@ function getDOMPropertyNames(context) {
|
|
|
1566
1573
|
* @returns Whether the node is a valid HTML tag in JSX
|
|
1567
1574
|
*/
|
|
1568
1575
|
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");
|
|
1576
|
+
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
1577
|
return false;
|
|
1572
1578
|
}
|
|
1573
1579
|
/**
|
|
@@ -1628,8 +1634,7 @@ function tagNameHasDot(node) {
|
|
|
1628
1634
|
function getStandardName(name$2, context) {
|
|
1629
1635
|
if (has(DOM_ATTRIBUTE_NAMES, name$2)) return DOM_ATTRIBUTE_NAMES[name$2];
|
|
1630
1636
|
if (has(SVGDOM_ATTRIBUTE_NAMES, name$2)) return SVGDOM_ATTRIBUTE_NAMES[name$2];
|
|
1631
|
-
|
|
1632
|
-
return names.find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1637
|
+
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1633
1638
|
}
|
|
1634
1639
|
/**
|
|
1635
1640
|
* Checks if an object has a property
|
|
@@ -1748,8 +1753,7 @@ function create$4(context) {
|
|
|
1748
1753
|
}
|
|
1749
1754
|
const standardName = getStandardName(name$2, context);
|
|
1750
1755
|
const hasStandardNameButIsNotUsed = !!standardName && standardName !== name$2;
|
|
1751
|
-
|
|
1752
|
-
if (usesStandardName) return;
|
|
1756
|
+
if (!!standardName && standardName === name$2) return;
|
|
1753
1757
|
if (hasStandardNameButIsNotUsed) {
|
|
1754
1758
|
report.send({
|
|
1755
1759
|
node,
|
package/dist/index.mjs
CHANGED
|
@@ -8,17 +8,18 @@ import { unit } from "@eslint-react/eff";
|
|
|
8
8
|
|
|
9
9
|
//#region rolldown:runtime
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
|
-
var __export = (
|
|
11
|
+
var __export = (all) => {
|
|
12
|
+
let target = {};
|
|
12
13
|
for (var name$2 in all) __defProp(target, name$2, {
|
|
13
14
|
get: all[name$2],
|
|
14
15
|
enumerable: true
|
|
15
16
|
});
|
|
17
|
+
return target;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
//#endregion
|
|
19
21
|
//#region src/configs/recommended.ts
|
|
20
|
-
var recommended_exports = {
|
|
21
|
-
__export(recommended_exports, {
|
|
22
|
+
var recommended_exports = __export({
|
|
22
23
|
name: () => name$1,
|
|
23
24
|
rules: () => rules,
|
|
24
25
|
settings: () => settings
|
|
@@ -46,7 +47,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
46
47
|
//#endregion
|
|
47
48
|
//#region package.json
|
|
48
49
|
var name = "eslint-plugin-react-dom";
|
|
49
|
-
var version = "1.53.1-next.
|
|
50
|
+
var version = "1.53.1-next.2";
|
|
50
51
|
|
|
51
52
|
//#endregion
|
|
52
53
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -139,8 +140,7 @@ function create$14(context) {
|
|
|
139
140
|
return { JSXElement(node) {
|
|
140
141
|
const attributes = node.openingElement.attributes;
|
|
141
142
|
const initialScope = context.sourceCode.getScope(node);
|
|
142
|
-
|
|
143
|
-
if (hasChildren && ER.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
143
|
+
if ((node.children.some(isSignificantChildren) || ER.hasAttribute(context, "children", attributes, initialScope)) && ER.hasAttribute(context, dangerouslySetInnerHTML, attributes, initialScope)) context.report({
|
|
144
144
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
145
145
|
node
|
|
146
146
|
});
|
|
@@ -1547,8 +1547,7 @@ function getDOMPropertyNames(context) {
|
|
|
1547
1547
|
* @returns Whether the node is a valid HTML tag in JSX
|
|
1548
1548
|
*/
|
|
1549
1549
|
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");
|
|
1550
|
+
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
1551
|
return false;
|
|
1553
1552
|
}
|
|
1554
1553
|
/**
|
|
@@ -1609,8 +1608,7 @@ function tagNameHasDot(node) {
|
|
|
1609
1608
|
function getStandardName(name$2, context) {
|
|
1610
1609
|
if (has(DOM_ATTRIBUTE_NAMES, name$2)) return DOM_ATTRIBUTE_NAMES[name$2];
|
|
1611
1610
|
if (has(SVGDOM_ATTRIBUTE_NAMES, name$2)) return SVGDOM_ATTRIBUTE_NAMES[name$2];
|
|
1612
|
-
|
|
1613
|
-
return names.find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1611
|
+
return getDOMPropertyNames(context).find((element) => element.toLowerCase() === name$2.toLowerCase());
|
|
1614
1612
|
}
|
|
1615
1613
|
/**
|
|
1616
1614
|
* Checks if an object has a property
|
|
@@ -1729,8 +1727,7 @@ function create$4(context) {
|
|
|
1729
1727
|
}
|
|
1730
1728
|
const standardName = getStandardName(name$2, context);
|
|
1731
1729
|
const hasStandardNameButIsNotUsed = !!standardName && standardName !== name$2;
|
|
1732
|
-
|
|
1733
|
-
if (usesStandardName) return;
|
|
1730
|
+
if (!!standardName && standardName === name$2) return;
|
|
1734
1731
|
if (hasStandardNameButIsNotUsed) {
|
|
1735
1732
|
report.send({
|
|
1736
1733
|
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.2",
|
|
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/core": "1.53.1-next.
|
|
54
|
-
"@eslint-react/eff": "1.53.1-next.
|
|
55
|
-
"@eslint-react/shared": "1.53.1-next.
|
|
56
|
-
"@eslint-react/kit": "1.53.1-next.
|
|
57
|
-
"@eslint-react/var": "1.53.1-next.
|
|
52
|
+
"@eslint-react/ast": "1.53.1-next.2",
|
|
53
|
+
"@eslint-react/core": "1.53.1-next.2",
|
|
54
|
+
"@eslint-react/eff": "1.53.1-next.2",
|
|
55
|
+
"@eslint-react/shared": "1.53.1-next.2",
|
|
56
|
+
"@eslint-react/kit": "1.53.1-next.2",
|
|
57
|
+
"@eslint-react/var": "1.53.1-next.2"
|
|
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": {
|