eslint-plugin-react-dom 1.29.1-next.5 → 1.29.1-next.7
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 +9 -9
- package/dist/index.mjs +9 -9
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var settings = {
|
|
|
62
62
|
|
|
63
63
|
// package.json
|
|
64
64
|
var name2 = "eslint-plugin-react-dom";
|
|
65
|
-
var version = "1.29.1-next.
|
|
65
|
+
var version = "1.29.1-next.7";
|
|
66
66
|
var createRule = shared.createRuleForPlugin("dom");
|
|
67
67
|
|
|
68
68
|
// src/utils/find-custom-component.ts
|
|
@@ -72,8 +72,8 @@ function findCustomComponent(name3, components) {
|
|
|
72
72
|
function findCustomComponentProp(name3, props) {
|
|
73
73
|
return props.findLast((a) => a.as === name3);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const name3 = JSX__namespace.
|
|
75
|
+
function getElementTypeOnJsxAndDom(context, node, polymorphicPropName, additionalComponents = []) {
|
|
76
|
+
const name3 = JSX__namespace.getElementType(node);
|
|
77
77
|
if (name3 === name3.toLowerCase()) return [name3, name3];
|
|
78
78
|
const component = additionalComponents.findLast((c) => c.name === name3 || c.re.test(name3));
|
|
79
79
|
if (component != null) return [name3, component.as];
|
|
@@ -269,7 +269,7 @@ var no_missing_button_type_default = createRule({
|
|
|
269
269
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "button");
|
|
270
270
|
return {
|
|
271
271
|
JSXElement(node) {
|
|
272
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
272
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
273
273
|
context,
|
|
274
274
|
node,
|
|
275
275
|
polymorphicPropName,
|
|
@@ -351,7 +351,7 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
351
351
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "iframe");
|
|
352
352
|
return {
|
|
353
353
|
JSXElement(node) {
|
|
354
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
354
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
355
355
|
context,
|
|
356
356
|
node,
|
|
357
357
|
polymorphicPropName,
|
|
@@ -408,7 +408,7 @@ var no_namespace_default = createRule({
|
|
|
408
408
|
create(context) {
|
|
409
409
|
return {
|
|
410
410
|
JSXElement(node) {
|
|
411
|
-
const name3 = JSX__namespace.
|
|
411
|
+
const name3 = JSX__namespace.getElementType(node);
|
|
412
412
|
if (typeof name3 !== "string" || !name3.includes(":")) {
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
@@ -1604,7 +1604,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
|
|
|
1604
1604
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "iframe");
|
|
1605
1605
|
return {
|
|
1606
1606
|
JSXElement(node) {
|
|
1607
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
1607
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
1608
1608
|
context,
|
|
1609
1609
|
node,
|
|
1610
1610
|
polymorphicPropName,
|
|
@@ -1674,7 +1674,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1674
1674
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "a");
|
|
1675
1675
|
return {
|
|
1676
1676
|
JSXElement(node) {
|
|
1677
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
1677
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
1678
1678
|
context,
|
|
1679
1679
|
node,
|
|
1680
1680
|
polymorphicPropName,
|
|
@@ -1755,7 +1755,7 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1755
1755
|
create(context) {
|
|
1756
1756
|
return {
|
|
1757
1757
|
JSXElement(node) {
|
|
1758
|
-
const elementName = JSX__namespace.
|
|
1758
|
+
const elementName = JSX__namespace.getElementType(node);
|
|
1759
1759
|
if (elementName.length === 0 || !voidElements.has(elementName)) {
|
|
1760
1760
|
return;
|
|
1761
1761
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -39,7 +39,7 @@ var settings = {
|
|
|
39
39
|
|
|
40
40
|
// package.json
|
|
41
41
|
var name2 = "eslint-plugin-react-dom";
|
|
42
|
-
var version = "1.29.1-next.
|
|
42
|
+
var version = "1.29.1-next.7";
|
|
43
43
|
var createRule = createRuleForPlugin("dom");
|
|
44
44
|
|
|
45
45
|
// src/utils/find-custom-component.ts
|
|
@@ -49,8 +49,8 @@ function findCustomComponent(name3, components) {
|
|
|
49
49
|
function findCustomComponentProp(name3, props) {
|
|
50
50
|
return props.findLast((a) => a.as === name3);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const name3 = JSX.
|
|
52
|
+
function getElementTypeOnJsxAndDom(context, node, polymorphicPropName, additionalComponents = []) {
|
|
53
|
+
const name3 = JSX.getElementType(node);
|
|
54
54
|
if (name3 === name3.toLowerCase()) return [name3, name3];
|
|
55
55
|
const component = additionalComponents.findLast((c) => c.name === name3 || c.re.test(name3));
|
|
56
56
|
if (component != null) return [name3, component.as];
|
|
@@ -246,7 +246,7 @@ var no_missing_button_type_default = createRule({
|
|
|
246
246
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "button");
|
|
247
247
|
return {
|
|
248
248
|
JSXElement(node) {
|
|
249
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
249
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
250
250
|
context,
|
|
251
251
|
node,
|
|
252
252
|
polymorphicPropName,
|
|
@@ -328,7 +328,7 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
328
328
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "iframe");
|
|
329
329
|
return {
|
|
330
330
|
JSXElement(node) {
|
|
331
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
331
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
332
332
|
context,
|
|
333
333
|
node,
|
|
334
334
|
polymorphicPropName,
|
|
@@ -385,7 +385,7 @@ var no_namespace_default = createRule({
|
|
|
385
385
|
create(context) {
|
|
386
386
|
return {
|
|
387
387
|
JSXElement(node) {
|
|
388
|
-
const name3 = JSX.
|
|
388
|
+
const name3 = JSX.getElementType(node);
|
|
389
389
|
if (typeof name3 !== "string" || !name3.includes(":")) {
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
@@ -1581,7 +1581,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
|
|
|
1581
1581
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "iframe");
|
|
1582
1582
|
return {
|
|
1583
1583
|
JSXElement(node) {
|
|
1584
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
1584
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
1585
1585
|
context,
|
|
1586
1586
|
node,
|
|
1587
1587
|
polymorphicPropName,
|
|
@@ -1651,7 +1651,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1651
1651
|
const additionalComponents = settings2.additionalComponents.filter((c) => c.as === "a");
|
|
1652
1652
|
return {
|
|
1653
1653
|
JSXElement(node) {
|
|
1654
|
-
const [elementNameOnJsx, elementNameOnDom] =
|
|
1654
|
+
const [elementNameOnJsx, elementNameOnDom] = getElementTypeOnJsxAndDom(
|
|
1655
1655
|
context,
|
|
1656
1656
|
node,
|
|
1657
1657
|
polymorphicPropName,
|
|
@@ -1732,7 +1732,7 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1732
1732
|
create(context) {
|
|
1733
1733
|
return {
|
|
1734
1734
|
JSXElement(node) {
|
|
1735
|
-
const elementName = JSX.
|
|
1735
|
+
const elementName = JSX.getElementType(node);
|
|
1736
1736
|
if (elementName.length === 0 || !voidElements.has(elementName)) {
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "1.29.1-next.
|
|
3
|
+
"version": "1.29.1-next.7",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"compare-versions": "^6.1.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.6.2",
|
|
52
|
-
"@eslint-react/ast": "1.29.1-next.
|
|
53
|
-
"@eslint-react/core": "1.29.1-next.
|
|
54
|
-
"@eslint-react/jsx": "1.29.1-next.
|
|
55
|
-
"@eslint-react/eff": "1.29.1-next.
|
|
56
|
-
"@eslint-react/shared": "1.29.1-next.
|
|
57
|
-
"@eslint-react/var": "1.29.1-next.
|
|
52
|
+
"@eslint-react/ast": "1.29.1-next.7",
|
|
53
|
+
"@eslint-react/core": "1.29.1-next.7",
|
|
54
|
+
"@eslint-react/jsx": "1.29.1-next.7",
|
|
55
|
+
"@eslint-react/eff": "1.29.1-next.7",
|
|
56
|
+
"@eslint-react/shared": "1.29.1-next.7",
|
|
57
|
+
"@eslint-react/var": "1.29.1-next.7"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/react": "^19.0.10",
|