eslint-plugin-react-dom 1.24.0-next.13 → 1.24.0-next.15
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 +16 -16
- package/dist/index.mjs +16 -16
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var AST__namespace = /*#__PURE__*/_interopNamespace(AST);
|
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
32
|
var name = "eslint-plugin-react-dom";
|
|
33
|
-
var version = "1.24.0-next.
|
|
33
|
+
var version = "1.24.0-next.15";
|
|
34
34
|
var createRule = shared.createRuleForPlugin("dom");
|
|
35
35
|
|
|
36
36
|
// src/utils/find-custom-component.ts
|
|
@@ -49,8 +49,8 @@ function getElementNameOnJsxAndDom(node, context, polymorphicPropName, additiona
|
|
|
49
49
|
const initialScope = context.sourceCode.getScope(node);
|
|
50
50
|
const attributeNode = JSX__namespace.getAttribute(
|
|
51
51
|
polymorphicPropName,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
node.openingElement.attributes,
|
|
53
|
+
initialScope
|
|
54
54
|
);
|
|
55
55
|
if (attributeNode == null) return [name2, name2];
|
|
56
56
|
const polymorphicPropValue = JSX__namespace.getAttributeValue(attributeNode, polymorphicPropName, initialScope);
|
|
@@ -85,8 +85,8 @@ var no_dangerously_set_innerhtml_default = createRule({
|
|
|
85
85
|
const attributes = node.openingElement.attributes;
|
|
86
86
|
const attribute = JSX__namespace.getAttribute(
|
|
87
87
|
"dangerouslySetInnerHTML",
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
attributes,
|
|
89
|
+
context.sourceCode.getScope(node)
|
|
90
90
|
);
|
|
91
91
|
if (attribute == null) return;
|
|
92
92
|
context.report({
|
|
@@ -121,8 +121,8 @@ var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
|
121
121
|
JSXElement(node) {
|
|
122
122
|
const attributes = node.openingElement.attributes;
|
|
123
123
|
const initialScope = context.sourceCode.getScope(node);
|
|
124
|
-
const hasChildren = hasChildrenWithin(node) || JSX__namespace.hasAttribute("children",
|
|
125
|
-
if (hasChildren && JSX__namespace.hasAttribute("dangerouslySetInnerHTML",
|
|
124
|
+
const hasChildren = hasChildrenWithin(node) || JSX__namespace.hasAttribute("children", attributes, initialScope);
|
|
125
|
+
if (hasChildren && JSX__namespace.hasAttribute("dangerouslySetInnerHTML", attributes, initialScope)) {
|
|
126
126
|
context.report({
|
|
127
127
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
128
128
|
node
|
|
@@ -211,8 +211,8 @@ var no_missing_button_type_default = createRule({
|
|
|
211
211
|
const propNameOnJsx = customComponentProp?.name ?? "type";
|
|
212
212
|
const attributeNode = JSX__namespace.getAttribute(
|
|
213
213
|
propNameOnJsx,
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
node.openingElement.attributes,
|
|
215
|
+
elementScope
|
|
216
216
|
);
|
|
217
217
|
if (attributeNode != null) {
|
|
218
218
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -293,8 +293,8 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
293
293
|
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
294
294
|
const attributeNode = JSX__namespace.getAttribute(
|
|
295
295
|
propNameOnJsx,
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
node.openingElement.attributes,
|
|
297
|
+
elementScope
|
|
298
298
|
);
|
|
299
299
|
if (attributeNode != null) {
|
|
300
300
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1546,8 +1546,8 @@ var no_unsafe_iframe_sandbox_default = createRule({
|
|
|
1546
1546
|
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
1547
1547
|
const attributeNode = JSX__namespace.getAttribute(
|
|
1548
1548
|
propNameOnJsx,
|
|
1549
|
-
|
|
1550
|
-
|
|
1549
|
+
node.openingElement.attributes,
|
|
1550
|
+
elementScope
|
|
1551
1551
|
);
|
|
1552
1552
|
if (attributeNode != null) {
|
|
1553
1553
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1617,8 +1617,8 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1617
1617
|
const propNameOnJsx = customComponentProp?.name ?? name2;
|
|
1618
1618
|
const attributeNode = JSX__namespace.getAttribute(
|
|
1619
1619
|
propNameOnJsx,
|
|
1620
|
-
|
|
1621
|
-
|
|
1620
|
+
node.openingElement.attributes,
|
|
1621
|
+
elementScope
|
|
1622
1622
|
);
|
|
1623
1623
|
if (attributeNode == null) return customComponentProp?.defaultValue;
|
|
1624
1624
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1699,7 +1699,7 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1699
1699
|
}
|
|
1700
1700
|
const { attributes } = node.openingElement;
|
|
1701
1701
|
const initialScope = context.sourceCode.getScope(node);
|
|
1702
|
-
const hasAttribute3 = (name2) => JSX__namespace.hasAttribute(name2,
|
|
1702
|
+
const hasAttribute3 = (name2) => JSX__namespace.hasAttribute(name2, attributes, initialScope);
|
|
1703
1703
|
if (hasAttribute3("children") || hasAttribute3("dangerouslySetInnerHTML")) {
|
|
1704
1704
|
context.report({
|
|
1705
1705
|
messageId: "noVoidElementsWithChildren",
|
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { _ } from '@eslint-react/eff';
|
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
var name = "eslint-plugin-react-dom";
|
|
10
|
-
var version = "1.24.0-next.
|
|
10
|
+
var version = "1.24.0-next.15";
|
|
11
11
|
var createRule = createRuleForPlugin("dom");
|
|
12
12
|
|
|
13
13
|
// src/utils/find-custom-component.ts
|
|
@@ -26,8 +26,8 @@ function getElementNameOnJsxAndDom(node, context, polymorphicPropName, additiona
|
|
|
26
26
|
const initialScope = context.sourceCode.getScope(node);
|
|
27
27
|
const attributeNode = JSX.getAttribute(
|
|
28
28
|
polymorphicPropName,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
node.openingElement.attributes,
|
|
30
|
+
initialScope
|
|
31
31
|
);
|
|
32
32
|
if (attributeNode == null) return [name2, name2];
|
|
33
33
|
const polymorphicPropValue = JSX.getAttributeValue(attributeNode, polymorphicPropName, initialScope);
|
|
@@ -62,8 +62,8 @@ var no_dangerously_set_innerhtml_default = createRule({
|
|
|
62
62
|
const attributes = node.openingElement.attributes;
|
|
63
63
|
const attribute = JSX.getAttribute(
|
|
64
64
|
"dangerouslySetInnerHTML",
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
attributes,
|
|
66
|
+
context.sourceCode.getScope(node)
|
|
67
67
|
);
|
|
68
68
|
if (attribute == null) return;
|
|
69
69
|
context.report({
|
|
@@ -98,8 +98,8 @@ var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
|
98
98
|
JSXElement(node) {
|
|
99
99
|
const attributes = node.openingElement.attributes;
|
|
100
100
|
const initialScope = context.sourceCode.getScope(node);
|
|
101
|
-
const hasChildren = hasChildrenWithin(node) || JSX.hasAttribute("children",
|
|
102
|
-
if (hasChildren && JSX.hasAttribute("dangerouslySetInnerHTML",
|
|
101
|
+
const hasChildren = hasChildrenWithin(node) || JSX.hasAttribute("children", attributes, initialScope);
|
|
102
|
+
if (hasChildren && JSX.hasAttribute("dangerouslySetInnerHTML", attributes, initialScope)) {
|
|
103
103
|
context.report({
|
|
104
104
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
105
105
|
node
|
|
@@ -188,8 +188,8 @@ var no_missing_button_type_default = createRule({
|
|
|
188
188
|
const propNameOnJsx = customComponentProp?.name ?? "type";
|
|
189
189
|
const attributeNode = JSX.getAttribute(
|
|
190
190
|
propNameOnJsx,
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
node.openingElement.attributes,
|
|
192
|
+
elementScope
|
|
193
193
|
);
|
|
194
194
|
if (attributeNode != null) {
|
|
195
195
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -270,8 +270,8 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
270
270
|
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
271
271
|
const attributeNode = JSX.getAttribute(
|
|
272
272
|
propNameOnJsx,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
node.openingElement.attributes,
|
|
274
|
+
elementScope
|
|
275
275
|
);
|
|
276
276
|
if (attributeNode != null) {
|
|
277
277
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1523,8 +1523,8 @@ var no_unsafe_iframe_sandbox_default = createRule({
|
|
|
1523
1523
|
const propNameOnJsx = customComponentProp?.name ?? "sandbox";
|
|
1524
1524
|
const attributeNode = JSX.getAttribute(
|
|
1525
1525
|
propNameOnJsx,
|
|
1526
|
-
|
|
1527
|
-
|
|
1526
|
+
node.openingElement.attributes,
|
|
1527
|
+
elementScope
|
|
1528
1528
|
);
|
|
1529
1529
|
if (attributeNode != null) {
|
|
1530
1530
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1594,8 +1594,8 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1594
1594
|
const propNameOnJsx = customComponentProp?.name ?? name2;
|
|
1595
1595
|
const attributeNode = JSX.getAttribute(
|
|
1596
1596
|
propNameOnJsx,
|
|
1597
|
-
|
|
1598
|
-
|
|
1597
|
+
node.openingElement.attributes,
|
|
1598
|
+
elementScope
|
|
1599
1599
|
);
|
|
1600
1600
|
if (attributeNode == null) return customComponentProp?.defaultValue;
|
|
1601
1601
|
const attributeScope = context.sourceCode.getScope(attributeNode);
|
|
@@ -1676,7 +1676,7 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1676
1676
|
}
|
|
1677
1677
|
const { attributes } = node.openingElement;
|
|
1678
1678
|
const initialScope = context.sourceCode.getScope(node);
|
|
1679
|
-
const hasAttribute3 = (name2) => JSX.hasAttribute(name2,
|
|
1679
|
+
const hasAttribute3 = (name2) => JSX.hasAttribute(name2, attributes, initialScope);
|
|
1680
1680
|
if (hasAttribute3("children") || hasAttribute3("dangerouslySetInnerHTML")) {
|
|
1681
1681
|
context.report({
|
|
1682
1682
|
messageId: "noVoidElementsWithChildren",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "1.24.0-next.
|
|
3
|
+
"version": "1.24.0-next.15",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"compare-versions": "^6.1.1",
|
|
48
48
|
"string-ts": "^2.2.0",
|
|
49
49
|
"ts-pattern": "^5.6.0",
|
|
50
|
-
"@eslint-react/ast": "1.24.0-next.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/jsx": "1.24.0-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/var": "1.24.0-next.
|
|
50
|
+
"@eslint-react/ast": "1.24.0-next.15",
|
|
51
|
+
"@eslint-react/eff": "1.24.0-next.15",
|
|
52
|
+
"@eslint-react/jsx": "1.24.0-next.15",
|
|
53
|
+
"@eslint-react/core": "1.24.0-next.15",
|
|
54
|
+
"@eslint-react/shared": "1.24.0-next.15",
|
|
55
|
+
"@eslint-react/var": "1.24.0-next.15"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^19.0.7",
|