eslint-plugin-react-dom 2.0.5-next.3 → 2.0.5-next.4
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 +19 -11
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region package.json
|
|
49
49
|
var name = "eslint-plugin-react-dom";
|
|
50
|
-
var version = "2.0.5-next.
|
|
50
|
+
var version = "2.0.5-next.4";
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/utils/create-jsx-element-resolver.ts
|
|
@@ -138,9 +138,9 @@ var no_dangerously_set_innerhtml_with_children_default = createRule({
|
|
|
138
138
|
});
|
|
139
139
|
const DSIH = "dangerouslySetInnerHTML";
|
|
140
140
|
/**
|
|
141
|
-
* Checks if a JSX child node is considered significant (i.e., not just whitespace for formatting)
|
|
142
|
-
* @param node The JSX child node to check
|
|
143
|
-
* @returns `true` if the node is significant, `false` otherwise
|
|
141
|
+
* Checks if a JSX child node is considered significant (i.e., not just whitespace for formatting)
|
|
142
|
+
* @param node The JSX child node to check
|
|
143
|
+
* @returns `true` if the node is significant, `false` otherwise
|
|
144
144
|
*/
|
|
145
145
|
function isSignificantChildren(node) {
|
|
146
146
|
if (!isJsxText(node)) return true;
|
|
@@ -504,6 +504,12 @@ function create$9(context) {
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* Provides a fixer function to replace `render(app, container)` with `createRoot(container).render(app)`
|
|
509
|
+
* @param context The rule context
|
|
510
|
+
* @param node The `CallExpression` node to fix
|
|
511
|
+
* @returns A fixer function or null if the fix cannot be applied
|
|
512
|
+
*/
|
|
507
513
|
function getFix$1(context, node) {
|
|
508
514
|
const getText$1 = (n) => context.sourceCode.getText(n);
|
|
509
515
|
return (fixer) => {
|
|
@@ -1775,9 +1781,11 @@ const RULE_NAME$4 = "no-unsafe-iframe-sandbox";
|
|
|
1775
1781
|
const RULE_FEATURES$4 = [];
|
|
1776
1782
|
const UNSAFE_SANDBOX_VALUES = ["allow-scripts", "allow-same-origin"];
|
|
1777
1783
|
/**
|
|
1778
|
-
* Checks if the sandbox attribute value contains an unsafe combination
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1784
|
+
* Checks if the sandbox attribute value contains an unsafe combination
|
|
1785
|
+
* An iframe with both "allow-scripts" and "allow-same-origin" can remove its sandbox attribute,
|
|
1786
|
+
* making it as insecure as an iframe without any sandboxing
|
|
1787
|
+
* @param value The value of the sandbox attribute
|
|
1788
|
+
* @returns `true` if the value is a string and contains an unsafe combination, `false` otherwise
|
|
1781
1789
|
*/
|
|
1782
1790
|
function isUnsafeSandboxCombination(value) {
|
|
1783
1791
|
if (typeof value !== "string") return false;
|
|
@@ -1993,7 +2001,7 @@ var no_void_elements_with_children_default = createRule({
|
|
|
1993
2001
|
description: "Disallow `children` in void DOM elements.",
|
|
1994
2002
|
[Symbol.for("rule_features")]: RULE_FEATURES$1
|
|
1995
2003
|
},
|
|
1996
|
-
messages: { noVoidElementsWithChildren: "'{{
|
|
2004
|
+
messages: { noVoidElementsWithChildren: "'{{elementType}}' is a void element tag and must not have children." },
|
|
1997
2005
|
schema: []
|
|
1998
2006
|
},
|
|
1999
2007
|
name: RULE_NAME$1,
|
|
@@ -2003,15 +2011,15 @@ var no_void_elements_with_children_default = createRule({
|
|
|
2003
2011
|
function create$1(context) {
|
|
2004
2012
|
const resolver = createJsxElementResolver(context);
|
|
2005
2013
|
return { JSXElement(node) {
|
|
2006
|
-
const { domElementType
|
|
2007
|
-
if (!voidElements.has(
|
|
2014
|
+
const { domElementType } = resolver.resolve(node);
|
|
2015
|
+
if (!voidElements.has(domElementType)) return;
|
|
2008
2016
|
const findJsxAttribute = getJsxAttribute(context, node);
|
|
2009
2017
|
const hasChildrenProp = findJsxAttribute("children") != null;
|
|
2010
2018
|
const hasDangerouslySetInnerHTML = findJsxAttribute("dangerouslySetInnerHTML") != null;
|
|
2011
2019
|
if (node.children.length > 0 || hasChildrenProp || hasDangerouslySetInnerHTML) context.report({
|
|
2012
2020
|
messageId: "noVoidElementsWithChildren",
|
|
2013
2021
|
node,
|
|
2014
|
-
data: {
|
|
2022
|
+
data: { elementType: domElementType }
|
|
2015
2023
|
});
|
|
2016
2024
|
} };
|
|
2017
2025
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "2.0.5-next.
|
|
3
|
+
"version": "2.0.5-next.4",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"compare-versions": "^6.1.1",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
43
|
"ts-pattern": "^5.8.0",
|
|
44
|
-
"@eslint-react/ast": "2.0.5-next.
|
|
45
|
-
"@eslint-react/core": "2.0.5-next.
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
44
|
+
"@eslint-react/ast": "2.0.5-next.4",
|
|
45
|
+
"@eslint-react/core": "2.0.5-next.4",
|
|
46
|
+
"@eslint-react/kit": "2.0.5-next.4",
|
|
47
|
+
"@eslint-react/eff": "2.0.5-next.4",
|
|
48
|
+
"@eslint-react/shared": "2.0.5-next.4",
|
|
49
|
+
"@eslint-react/var": "2.0.5-next.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/react": "^19.1.16",
|