eslint-plugin-react-dom 5.17.0 → 5.17.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 +7 -8
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS, RE_JAVASCRIPT_PROTOCOL, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
2
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
3
3
|
import "@eslint-react/eslint";
|
|
4
|
-
import { findAttribute, getAttributeStaticValue, getElementFullType, hasAnyAttribute, hasAttribute, isHostElement,
|
|
4
|
+
import { findAttribute, getAttributeStaticValue, getElementFullType, hasAnyAttribute, hasAttribute, isHostElement, isPaddingWhitespace, resolveAttributeValue } from "@eslint-react/jsx";
|
|
5
5
|
import { Check, Extract } from "@eslint-react/ast";
|
|
6
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
7
7
|
import { compare } from "compare-versions";
|
|
@@ -25,7 +25,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region package.json
|
|
27
27
|
var name$2 = "eslint-plugin-react-dom";
|
|
28
|
-
var version = "5.17.
|
|
28
|
+
var version = "5.17.2";
|
|
29
29
|
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/utils/create-rule.ts
|
|
@@ -52,7 +52,7 @@ function create$15(context) {
|
|
|
52
52
|
if (!context.sourceCode.text.includes("dangerouslySetInnerHTML")) return {};
|
|
53
53
|
return { JSXElement(node) {
|
|
54
54
|
if (!hasAttribute(context, node, "dangerouslySetInnerHTML")) return;
|
|
55
|
-
const childrenPropOrNode = findAttribute(context, node, "children") ?? node.children.find((child) => !
|
|
55
|
+
const childrenPropOrNode = findAttribute(context, node, "children") ?? node.children.find((child) => !isPaddingWhitespace(child));
|
|
56
56
|
if (childrenPropOrNode == null) return;
|
|
57
57
|
context.report({
|
|
58
58
|
messageId: "default",
|
|
@@ -317,16 +317,15 @@ function create$9(context) {
|
|
|
317
317
|
});
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
|
-
const sandboxValue = resolveAttributeValue(context, sandboxProp);
|
|
320
|
+
const sandboxValue = resolveAttributeValue(context, sandboxProp, "sandbox");
|
|
321
321
|
if (typeof sandboxValue.toStatic() === "string") return;
|
|
322
|
-
if (sandboxValue.kind === "spreadProps" && typeof sandboxValue.getProperty("sandbox") === "string") return;
|
|
323
322
|
context.report({
|
|
324
323
|
messageId: "missingSandboxAttribute",
|
|
325
324
|
node: sandboxValue.node ?? sandboxProp,
|
|
326
325
|
suggest: [{
|
|
327
326
|
data: { value: "" },
|
|
328
327
|
fix(fixer) {
|
|
329
|
-
if (sandboxValue.kind
|
|
328
|
+
if (sandboxValue.kind === "spreadProps") return null;
|
|
330
329
|
return fixer.replaceText(sandboxProp, `sandbox=""`);
|
|
331
330
|
},
|
|
332
331
|
messageId: "addSandboxAttribute"
|
|
@@ -1720,8 +1719,8 @@ function create$3(context) {
|
|
|
1720
1719
|
if (resolver.resolve(node).domElementType !== "iframe") return;
|
|
1721
1720
|
const sandboxProp = findAttribute(context, node, "sandbox");
|
|
1722
1721
|
if (sandboxProp == null) return;
|
|
1723
|
-
const sandboxValue = resolveAttributeValue(context, sandboxProp);
|
|
1724
|
-
if (isUnsafeSandboxCombination(sandboxValue.
|
|
1722
|
+
const sandboxValue = resolveAttributeValue(context, sandboxProp, "sandbox");
|
|
1723
|
+
if (isUnsafeSandboxCombination(sandboxValue.toStatic())) context.report({
|
|
1725
1724
|
messageId: "default",
|
|
1726
1725
|
node: sandboxValue.node ?? sandboxProp
|
|
1727
1726
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
"@typescript-eslint/types": "^8.64.0",
|
|
41
41
|
"@typescript-eslint/utils": "^8.64.0",
|
|
42
42
|
"compare-versions": "^6.1.1",
|
|
43
|
-
"@eslint-react/ast": "5.17.
|
|
44
|
-
"@eslint-react/eslint": "5.17.
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
43
|
+
"@eslint-react/ast": "5.17.2",
|
|
44
|
+
"@eslint-react/eslint": "5.17.2",
|
|
45
|
+
"@eslint-react/shared": "5.17.2",
|
|
46
|
+
"@eslint-react/jsx": "5.17.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/react": "^19.2.17",
|
|
50
50
|
"@types/react-dom": "^19.2.3",
|
|
51
51
|
"dedent": "^1.7.2",
|
|
52
52
|
"eslint": "^10.7.0",
|
|
53
|
-
"tsdown": "^0.22.
|
|
53
|
+
"tsdown": "^0.22.9",
|
|
54
54
|
"typescript": "6.0.3",
|
|
55
|
-
"@local/
|
|
56
|
-
"@local/
|
|
55
|
+
"@local/eff": "0.0.0",
|
|
56
|
+
"@local/configs": "0.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"eslint": "*",
|