eslint-plugin-react-dom 5.23.5 → 5.24.0-beta.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 +22 -22
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region package.json
|
|
29
29
|
var name$2 = "eslint-plugin-react-dom";
|
|
30
|
-
var version = "5.
|
|
30
|
+
var version = "5.24.0-beta.1";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/create-rule.ts
|
|
@@ -268,8 +268,8 @@ var no_missing_button_type_default = createRule({
|
|
|
268
268
|
docs: { description: "Enforces an explicit 'type' attribute for 'button' elements." },
|
|
269
269
|
hasSuggestions: true,
|
|
270
270
|
messages: {
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
"add-type-attribute": "Add type attribute with value '{{ type }}'.",
|
|
272
|
+
"missing-type-attribute": "Missing an explicit type attribute for button."
|
|
273
273
|
},
|
|
274
274
|
schema: []
|
|
275
275
|
},
|
|
@@ -284,14 +284,14 @@ function create$10(context) {
|
|
|
284
284
|
if (domElementType !== "button") return;
|
|
285
285
|
if (hasAttribute(context, node, "type")) return;
|
|
286
286
|
context.report({
|
|
287
|
-
messageId: "
|
|
287
|
+
messageId: "missing-type-attribute",
|
|
288
288
|
node: node.openingElement,
|
|
289
289
|
suggest: BUTTON_TYPES.map((type) => ({
|
|
290
290
|
data: { type },
|
|
291
291
|
fix(fixer) {
|
|
292
292
|
return fixer.insertTextAfter(node.openingElement.name, ` type="${type}"`);
|
|
293
293
|
},
|
|
294
|
-
messageId: "
|
|
294
|
+
messageId: "add-type-attribute"
|
|
295
295
|
}))
|
|
296
296
|
});
|
|
297
297
|
} };
|
|
@@ -307,8 +307,8 @@ var no_missing_iframe_sandbox_default = createRule({
|
|
|
307
307
|
fixable: "code",
|
|
308
308
|
hasSuggestions: true,
|
|
309
309
|
messages: {
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
"add-sandbox-attribute": "Add sandbox attribute with value '{{ value }}'.",
|
|
311
|
+
"missing-sandbox-attribute": "Missing an explicit sandbox attribute for iframe."
|
|
312
312
|
},
|
|
313
313
|
schema: []
|
|
314
314
|
},
|
|
@@ -324,14 +324,14 @@ function create$9(context) {
|
|
|
324
324
|
const sandboxProp = findAttribute(context, node, "sandbox");
|
|
325
325
|
if (sandboxProp == null) {
|
|
326
326
|
context.report({
|
|
327
|
-
messageId: "
|
|
327
|
+
messageId: "missing-sandbox-attribute",
|
|
328
328
|
node: node.openingElement,
|
|
329
329
|
suggest: [{
|
|
330
330
|
data: { value: "" },
|
|
331
331
|
fix(fixer) {
|
|
332
332
|
return fixer.insertTextAfter(node.openingElement.name, ` sandbox=""`);
|
|
333
333
|
},
|
|
334
|
-
messageId: "
|
|
334
|
+
messageId: "add-sandbox-attribute"
|
|
335
335
|
}]
|
|
336
336
|
});
|
|
337
337
|
return;
|
|
@@ -339,7 +339,7 @@ function create$9(context) {
|
|
|
339
339
|
const sandboxValue = resolveAttributeValue(context, sandboxProp, "sandbox");
|
|
340
340
|
if (isMatching(P.string, sandboxValue.toStatic())) return;
|
|
341
341
|
context.report({
|
|
342
|
-
messageId: "
|
|
342
|
+
messageId: "missing-sandbox-attribute",
|
|
343
343
|
node: sandboxValue.node ?? sandboxProp,
|
|
344
344
|
suggest: [{
|
|
345
345
|
data: { value: "" },
|
|
@@ -347,7 +347,7 @@ function create$9(context) {
|
|
|
347
347
|
if (sandboxValue.kind === "spreadProps") return null;
|
|
348
348
|
return fixer.replaceText(sandboxProp, `sandbox=""`);
|
|
349
349
|
},
|
|
350
|
-
messageId: "
|
|
350
|
+
messageId: "add-sandbox-attribute"
|
|
351
351
|
}]
|
|
352
352
|
});
|
|
353
353
|
} };
|
|
@@ -1599,10 +1599,10 @@ const DEFAULTS = {
|
|
|
1599
1599
|
requireDataLowercase: false
|
|
1600
1600
|
};
|
|
1601
1601
|
const messages = {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1602
|
+
"data-lowercase-required": "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
|
|
1603
|
+
"invalid-prop-on-tag": "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
|
|
1604
|
+
"unknown-prop": "Unknown property '{{name}}' found",
|
|
1605
|
+
"unknown-prop-with-standard-name": "Unknown property '{{name}}' found, use '{{standardName}}' instead"
|
|
1606
1606
|
};
|
|
1607
1607
|
var no_unknown_property_default = createRule({
|
|
1608
1608
|
meta: {
|
|
@@ -1648,7 +1648,7 @@ function create$4(context) {
|
|
|
1648
1648
|
name: actualName,
|
|
1649
1649
|
lowerCaseName: actualName.toLowerCase()
|
|
1650
1650
|
},
|
|
1651
|
-
messageId: "
|
|
1651
|
+
messageId: "data-lowercase-required",
|
|
1652
1652
|
node
|
|
1653
1653
|
});
|
|
1654
1654
|
return;
|
|
@@ -1666,7 +1666,7 @@ function create$4(context) {
|
|
|
1666
1666
|
allowedTags: allowedTags.join(", "),
|
|
1667
1667
|
tagName
|
|
1668
1668
|
},
|
|
1669
|
-
messageId: "
|
|
1669
|
+
messageId: "invalid-prop-on-tag",
|
|
1670
1670
|
node
|
|
1671
1671
|
});
|
|
1672
1672
|
return;
|
|
@@ -1683,14 +1683,14 @@ function create$4(context) {
|
|
|
1683
1683
|
fix(fixer) {
|
|
1684
1684
|
return fixer.replaceText(node.name, standardName);
|
|
1685
1685
|
},
|
|
1686
|
-
messageId: "
|
|
1686
|
+
messageId: "unknown-prop-with-standard-name",
|
|
1687
1687
|
node
|
|
1688
1688
|
});
|
|
1689
1689
|
return;
|
|
1690
1690
|
}
|
|
1691
1691
|
context.report({
|
|
1692
1692
|
data: { name: actualName },
|
|
1693
|
-
messageId: "
|
|
1693
|
+
messageId: "unknown-prop",
|
|
1694
1694
|
node
|
|
1695
1695
|
});
|
|
1696
1696
|
} };
|
|
@@ -1761,7 +1761,7 @@ var no_unsafe_target_blank_default = createRule({
|
|
|
1761
1761
|
fixable: "code",
|
|
1762
1762
|
hasSuggestions: true,
|
|
1763
1763
|
messages: {
|
|
1764
|
-
|
|
1764
|
+
"add-rel-noreferrer-noopener": `Add 'rel="noreferrer noopener"' to the link to prevent security risks.`,
|
|
1765
1765
|
default: `Using 'target="_blank"' on an external link without 'rel="noreferrer noopener"' is a security risk.`
|
|
1766
1766
|
},
|
|
1767
1767
|
schema: []
|
|
@@ -1787,7 +1787,7 @@ function create$2(context) {
|
|
|
1787
1787
|
fix(fixer) {
|
|
1788
1788
|
return fixer.insertTextAfter(node.openingElement.name, ` rel="noreferrer noopener"`);
|
|
1789
1789
|
},
|
|
1790
|
-
messageId: "
|
|
1790
|
+
messageId: "add-rel-noreferrer-noopener"
|
|
1791
1791
|
}]
|
|
1792
1792
|
});
|
|
1793
1793
|
return;
|
|
@@ -1801,7 +1801,7 @@ function create$2(context) {
|
|
|
1801
1801
|
fix(fixer) {
|
|
1802
1802
|
return fixer.replaceText(relProp, `rel="noreferrer noopener"`);
|
|
1803
1803
|
},
|
|
1804
|
-
messageId: "
|
|
1804
|
+
messageId: "add-rel-noreferrer-noopener"
|
|
1805
1805
|
}]
|
|
1806
1806
|
});
|
|
1807
1807
|
} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0-beta.1",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.
|
|
41
|
-
"@eslint-react/eslint": "5.
|
|
42
|
-
"@eslint-react/jsx": "5.
|
|
43
|
-
"@eslint-react/shared": "5.
|
|
44
|
-
"@eslint-react/var": "5.
|
|
40
|
+
"@eslint-react/ast": "5.24.0-beta.1",
|
|
41
|
+
"@eslint-react/eslint": "5.24.0-beta.1",
|
|
42
|
+
"@eslint-react/jsx": "5.24.0-beta.1",
|
|
43
|
+
"@eslint-react/shared": "5.24.0-beta.1",
|
|
44
|
+
"@eslint-react/var": "5.24.0-beta.1",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0",
|
|
47
47
|
"compare-versions": "^6.1.1",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@local/configs": "0.0.0",
|
|
52
|
+
"@local/testkit": "0.0.0",
|
|
52
53
|
"@types/react": "^19.3.0",
|
|
53
54
|
"@types/react-dom": "^19.3.0",
|
|
54
55
|
"dedent": "^1.7.2",
|