eslint-plugin-react-dom 2.0.0-beta.2 → 2.0.0-beta.21
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 +10 -5
- package/package.json +14 -15
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { getDocsUrl, getSettingsFromContext, DEFAULT_ESLINT_REACT_SETTINGS } fro
|
|
|
2
2
|
import * as ER from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
4
|
import { unit } from '@eslint-react/eff';
|
|
5
|
-
import * as AST from '@eslint-react/ast';
|
|
6
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
7
6
|
import { compare } from 'compare-versions';
|
|
8
7
|
import { RegExp, Reporter } from '@eslint-react/kit';
|
|
@@ -44,7 +43,7 @@ var settings = {
|
|
|
44
43
|
|
|
45
44
|
// package.json
|
|
46
45
|
var name2 = "eslint-plugin-react-dom";
|
|
47
|
-
var version = "2.0.0-beta.
|
|
46
|
+
var version = "2.0.0-beta.21";
|
|
48
47
|
function createJsxElementResolver(context) {
|
|
49
48
|
const { components, polymorphicPropName } = getSettingsFromContext(context);
|
|
50
49
|
return {
|
|
@@ -186,7 +185,7 @@ function create2(context) {
|
|
|
186
185
|
JSXElement(node) {
|
|
187
186
|
const attributes = node.openingElement.attributes;
|
|
188
187
|
const initialScope = context.sourceCode.getScope(node);
|
|
189
|
-
const hasChildren =
|
|
188
|
+
const hasChildren = node.children.some(isSignificantChildren) || ER.hasAttribute(context, "children", attributes, initialScope);
|
|
190
189
|
if (hasChildren && ER.hasAttribute(context, dangerouslySetInnerHTML2, attributes, initialScope)) {
|
|
191
190
|
context.report({
|
|
192
191
|
messageId: "noDangerouslySetInnerhtmlWithChildren",
|
|
@@ -196,8 +195,14 @@ function create2(context) {
|
|
|
196
195
|
}
|
|
197
196
|
};
|
|
198
197
|
}
|
|
199
|
-
function
|
|
200
|
-
return node.
|
|
198
|
+
function isWhiteSpace(node) {
|
|
199
|
+
return typeof node.value === "string" && node.raw.trim() === "";
|
|
200
|
+
}
|
|
201
|
+
function isPaddingSpaces(node) {
|
|
202
|
+
return ER.isJsxText(node) && isWhiteSpace(node) && node.raw.includes("\n");
|
|
203
|
+
}
|
|
204
|
+
function isSignificantChildren(node) {
|
|
205
|
+
return node.type !== AST_NODE_TYPES.JSXText || !isPaddingSpaces(node);
|
|
201
206
|
}
|
|
202
207
|
var RULE_NAME3 = "no-find-dom-node";
|
|
203
208
|
var RULE_FEATURES3 = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-dom",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.21",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React DOM related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
39
|
-
"@typescript-eslint/types": "^8.
|
|
40
|
-
"@typescript-eslint/utils": "^8.
|
|
38
|
+
"@typescript-eslint/scope-manager": "^8.38.0",
|
|
39
|
+
"@typescript-eslint/types": "^8.38.0",
|
|
40
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
41
41
|
"compare-versions": "^6.1.1",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
|
-
"ts-pattern": "^5.
|
|
44
|
-
"@eslint-react/ast": "2.0.0-beta.
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
43
|
+
"ts-pattern": "^5.8.0",
|
|
44
|
+
"@eslint-react/ast": "2.0.0-beta.21",
|
|
45
|
+
"@eslint-react/kit": "2.0.0-beta.21",
|
|
46
|
+
"@eslint-react/shared": "2.0.0-beta.21",
|
|
47
|
+
"@eslint-react/core": "2.0.0-beta.21",
|
|
48
|
+
"@eslint-react/var": "2.0.0-beta.21",
|
|
49
|
+
"@eslint-react/eff": "2.0.0-beta.21"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/react": "^19.1.
|
|
53
|
-
"@types/react-dom": "^19.1.
|
|
52
|
+
"@types/react": "^19.1.9",
|
|
53
|
+
"@types/react-dom": "^19.1.7",
|
|
54
54
|
"tsup": "^8.5.0",
|
|
55
55
|
"@local/configs": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.31.0",
|
|
59
59
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
|
-
"bun": ">=1.0.15",
|
|
71
70
|
"node": ">=20.19.0"
|
|
72
71
|
},
|
|
73
72
|
"publishConfig": {
|