eslint-plugin-react-jsx 5.17.1 → 5.17.3

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -3
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var __exportAll = (all, no_symbols) => {
26
26
  //#endregion
27
27
  //#region package.json
28
28
  var name$2 = "eslint-plugin-react-jsx";
29
- var version = "5.17.1";
29
+ var version = "5.17.3";
30
30
 
31
31
  //#endregion
32
32
  //#region src/utils/create-rule.ts
@@ -49,7 +49,7 @@ function findCreateElementChildrenProp(context, node) {
49
49
  if (propsArg == null) return null;
50
50
  const propsObject = Extract.unwrap(propsArg);
51
51
  if (propsObject.type !== AST_NODE_TYPES.ObjectExpression) return null;
52
- for (const prop of propsObject.properties) if (prop.type === AST_NODE_TYPES.Property && Extract.getStaticPropertyName(prop) === "children") return prop;
52
+ for (const prop of propsObject.properties) if (prop.type === AST_NODE_TYPES.Property && Extract.getPropertyName(prop, "max") === "children") return prop;
53
53
  return null;
54
54
  }
55
55
 
@@ -753,10 +753,12 @@ var no_key_after_spread_default = createRule({
753
753
  defaultOptions: []
754
754
  });
755
755
  function create$4(context) {
756
+ if (!context.sourceCode.text.includes("key=")) return {};
756
757
  const { jsx } = core.getJsxConfig(context);
757
758
  if (jsx !== ts.JsxEmit.ReactJSX && jsx !== ts.JsxEmit.ReactJSXDev) return {};
759
+ const isJsxSpreadAttribute = Check.is(AST_NODE_TYPES.JSXSpreadAttribute);
758
760
  return { JSXOpeningElement(node) {
759
- for (const n of dropWhile(node.attributes, not(Check.is(AST_NODE_TYPES.JSXSpreadAttribute))).filter(isAttribute("key"))) context.report({
761
+ for (const n of dropWhile(node.attributes, not(isJsxSpreadAttribute)).filter(isAttribute("key"))) context.report({
760
762
  messageId: "default",
761
763
  node: n
762
764
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-jsx",
3
- "version": "5.17.1",
3
+ "version": "5.17.3",
4
4
  "description": "ESLint React's ESLint plugin for React Flavored JSX rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -39,18 +39,18 @@
39
39
  "dependencies": {
40
40
  "@typescript-eslint/types": "^8.64.0",
41
41
  "@typescript-eslint/utils": "^8.64.0",
42
- "@eslint-react/ast": "5.17.1",
43
- "@eslint-react/eslint": "5.17.1",
44
- "@eslint-react/core": "5.17.1",
45
- "@eslint-react/jsx": "5.17.1",
46
- "@eslint-react/shared": "5.17.1"
42
+ "@eslint-react/ast": "5.17.3",
43
+ "@eslint-react/core": "5.17.3",
44
+ "@eslint-react/jsx": "5.17.3",
45
+ "@eslint-react/shared": "5.17.3",
46
+ "@eslint-react/eslint": "5.17.3"
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.8",
53
+ "tsdown": "^0.22.9",
54
54
  "typescript": "6.0.3",
55
55
  "@local/configs": "0.0.0",
56
56
  "@local/eff": "0.0.0"