eslint-plugin-react-jsx 4.0.2-beta.6 → 4.1.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 +9 -8
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region package.json
|
|
25
25
|
var name$2 = "eslint-plugin-react-jsx";
|
|
26
|
-
var version = "4.0
|
|
26
|
+
var version = "4.1.0-beta.0";
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/utils/create-rule.ts
|
|
@@ -111,7 +111,8 @@ function getChildrenSourceText(context, node) {
|
|
|
111
111
|
const opener = node.type === AST_NODE_TYPES.JSXFragment ? node.openingFragment : node.openingElement;
|
|
112
112
|
const closer = node.type === AST_NODE_TYPES.JSXFragment ? node.closingFragment : node.closingElement;
|
|
113
113
|
if (opener.type === AST_NODE_TYPES.JSXOpeningElement && opener.selfClosing) return "";
|
|
114
|
-
|
|
114
|
+
if (closer == null) return "";
|
|
115
|
+
return sourceCode.text.slice(opener.range[1], closer.range[0]);
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
//#endregion
|
|
@@ -264,9 +265,9 @@ function create$3(context) {
|
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
//#endregion
|
|
267
|
-
//#region src/rules/no-
|
|
268
|
-
const RULE_NAME$2 = "no-
|
|
269
|
-
var
|
|
268
|
+
//#region src/rules/no-key-after-spread/no-key-after-spread.ts
|
|
269
|
+
const RULE_NAME$2 = "no-key-after-spread";
|
|
270
|
+
var no_key_after_spread_default = createRule({
|
|
270
271
|
meta: {
|
|
271
272
|
type: "problem",
|
|
272
273
|
docs: { description: "Prevent patterns that cause deoptimization when using the automatic JSX runtime." },
|
|
@@ -288,7 +289,7 @@ function create$2(context) {
|
|
|
288
289
|
continue;
|
|
289
290
|
}
|
|
290
291
|
if (firstSpreadPropIndex == null) continue;
|
|
291
|
-
if (prop.name.name === "key" && index > firstSpreadPropIndex) context.report({
|
|
292
|
+
if (prop.name.type === AST_NODE_TYPES.JSXIdentifier && prop.name.name === "key" && index > firstSpreadPropIndex) context.report({
|
|
292
293
|
messageId: "noKeyAfterSpread",
|
|
293
294
|
node: prop
|
|
294
295
|
});
|
|
@@ -450,7 +451,7 @@ const plugin = {
|
|
|
450
451
|
"no-children-prop": no_children_prop_default,
|
|
451
452
|
"no-children-prop-with-children": no_children_prop_with_children_default,
|
|
452
453
|
"no-comment-textnodes": no_comment_textnodes_default,
|
|
453
|
-
"no-
|
|
454
|
+
"no-key-after-spread": no_key_after_spread_default,
|
|
454
455
|
"no-namespace": no_namespace_default,
|
|
455
456
|
"no-useless-fragment": no_useless_fragment_default
|
|
456
457
|
}
|
|
@@ -468,7 +469,7 @@ const name$1 = "react-jsx/recommended";
|
|
|
468
469
|
const rules$1 = {
|
|
469
470
|
"react-jsx/no-children-prop": "warn",
|
|
470
471
|
"react-jsx/no-comment-textnodes": "warn",
|
|
471
|
-
"react-jsx/no-
|
|
472
|
+
"react-jsx/no-key-after-spread": "error",
|
|
472
473
|
"react-jsx/no-namespace": "error"
|
|
473
474
|
};
|
|
474
475
|
const plugins$1 = { "react-jsx": plugin };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-jsx",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-beta.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for React Flavored JSX rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@typescript-eslint/utils": "^8.57.2",
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"ts-pattern": "^5.9.0",
|
|
46
|
-
"@eslint-react/ast": "4.0
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
46
|
+
"@eslint-react/ast": "4.1.0-beta.0",
|
|
47
|
+
"@eslint-react/core": "4.1.0-beta.0",
|
|
48
|
+
"@eslint-react/shared": "4.1.0-beta.0",
|
|
49
|
+
"@eslint-react/jsx": "4.1.0-beta.0",
|
|
50
|
+
"@eslint-react/var": "4.1.0-beta.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.2.14",
|