eslint-plugin-react-jsx 5.2.5-next.0 → 5.3.0-beta.0
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 +6 -6
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region package.json
|
|
26
26
|
var name$2 = "eslint-plugin-react-jsx";
|
|
27
|
-
var version = "5.
|
|
27
|
+
var version = "5.3.0-beta.0";
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/rules/no-children-prop-with-children/lib.ts
|
|
@@ -150,7 +150,7 @@ function getChildrenPropText(context, prop) {
|
|
|
150
150
|
const { expression } = value;
|
|
151
151
|
if (expression.type === AST_NODE_TYPES.JSXEmptyExpression) return null;
|
|
152
152
|
const exprText = sourceCode.getText(expression);
|
|
153
|
-
if (Check.
|
|
153
|
+
if (Check.isJSXElementOrFragment(expression)) return exprText;
|
|
154
154
|
return `{${exprText}}`;
|
|
155
155
|
}
|
|
156
156
|
return null;
|
|
@@ -239,7 +239,7 @@ function create$5(context) {
|
|
|
239
239
|
return /^\s*\/(?:\/|\*)/mu.test(context.sourceCode.getText(node));
|
|
240
240
|
}
|
|
241
241
|
const visitorFunction = (node) => {
|
|
242
|
-
if (!Check.
|
|
242
|
+
if (!Check.isJSXElementOrFragment(node.parent)) return;
|
|
243
243
|
if (!hasCommentLike(node)) return;
|
|
244
244
|
context.report({
|
|
245
245
|
messageId: "default",
|
|
@@ -366,7 +366,7 @@ function hasLeakedSemicolon(text) {
|
|
|
366
366
|
}
|
|
367
367
|
function create$2(context) {
|
|
368
368
|
const visitorFunction = (node) => {
|
|
369
|
-
if (!Check.
|
|
369
|
+
if (!Check.isJSXElementOrFragment(node.parent)) return;
|
|
370
370
|
if (!hasLeakedSemicolon(context.sourceCode.getText(node))) return;
|
|
371
371
|
context.report({
|
|
372
372
|
messageId: "default",
|
|
@@ -487,7 +487,7 @@ function create(context, [option]) {
|
|
|
487
487
|
*/
|
|
488
488
|
function isContentUseless(node) {
|
|
489
489
|
if (node.children.length === 0) return !allowEmptyFragment;
|
|
490
|
-
const insideJsx = Check.
|
|
490
|
+
const insideJsx = Check.isJSXElementOrFragment(node.parent);
|
|
491
491
|
if (!allowExpressions) {
|
|
492
492
|
if (insideJsx) return true;
|
|
493
493
|
if (node.children.length === 1) return true;
|
|
@@ -506,7 +506,7 @@ function create(context, [option]) {
|
|
|
506
506
|
* @param node The fragment node to check.
|
|
507
507
|
*/
|
|
508
508
|
function isSafeToFix(node) {
|
|
509
|
-
if (Check.
|
|
509
|
+
if (Check.isJSXElementOrFragment(node.parent)) return isHostElement(node.parent);
|
|
510
510
|
if (node.children.length === 0) return false;
|
|
511
511
|
return !node.children.some((child) => {
|
|
512
512
|
if (child.type === AST_NODE_TYPES.JSXExpressionContainer) return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-jsx",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0-beta.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Flavored JSX rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"@typescript-eslint/utils": "^8.58.2",
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"ts-pattern": "^5.9.0",
|
|
46
|
-
"@eslint-react/ast": "5.
|
|
47
|
-
"@eslint-react/core": "5.
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/jsx": "5.
|
|
50
|
-
"@eslint-react/var": "5.
|
|
51
|
-
"@eslint-react/
|
|
46
|
+
"@eslint-react/ast": "5.3.0-beta.0",
|
|
47
|
+
"@eslint-react/core": "5.3.0-beta.0",
|
|
48
|
+
"@eslint-react/eslint": "5.3.0-beta.0",
|
|
49
|
+
"@eslint-react/jsx": "5.3.0-beta.0",
|
|
50
|
+
"@eslint-react/var": "5.3.0-beta.0",
|
|
51
|
+
"@eslint-react/shared": "5.3.0-beta.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/react": "^19.2.14",
|
|
55
55
|
"@types/react-dom": "^19.2.3",
|
|
56
|
-
"eslint": "^10.2.
|
|
56
|
+
"eslint": "^10.2.1",
|
|
57
57
|
"tsdown": "^0.21.9",
|
|
58
58
|
"@local/configs": "0.0.0",
|
|
59
59
|
"@local/eff": "3.0.0-beta.72"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"eslint": "^10.2.
|
|
62
|
+
"eslint": "^10.2.1",
|
|
63
63
|
"typescript": "*"
|
|
64
64
|
},
|
|
65
65
|
"engines": {
|