eslint-plugin-react-x 2.4.0-beta.12 → 2.4.0-beta.14

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 -8
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __export = (all, symbols) => {
34
34
  //#endregion
35
35
  //#region package.json
36
36
  var name$6 = "eslint-plugin-react-x";
37
- var version = "2.4.0-beta.12";
37
+ var version = "2.4.0-beta.14";
38
38
 
39
39
  //#endregion
40
40
  //#region src/utils/create-rule.ts
@@ -174,10 +174,7 @@ function create$62(context) {
174
174
  });
175
175
  }
176
176
  };
177
- return {
178
- JSXElement: visitorFunction,
179
- JSXFragment: visitorFunction
180
- };
177
+ return Object.fromEntries(["JSXElement", "JSXFragment"].map((nodeType) => [nodeType, visitorFunction]));
181
178
  }
182
179
 
183
180
  //#endregion
@@ -613,7 +610,7 @@ function isUsingReactChildren(context, node) {
613
610
  if (!isReactChildrenMethod(callee.property.name)) return false;
614
611
  const initialScope = context.sourceCode.getScope(node);
615
612
  if (callee.object.type === AST_NODE_TYPES.Identifier && callee.object.name === "Children") return true;
616
- if (callee.object.type === AST_NODE_TYPES.MemberExpression && "name" in callee.object.object) return isInitializedFromReact(callee.object.object.name, importSource, initialScope);
613
+ if (callee.object.type === AST_NODE_TYPES.MemberExpression && "name" in callee.object.object) return isInitializedFromReact(callee.object.object.name, initialScope, importSource);
617
614
  return false;
618
615
  }
619
616
  function getMapIndexParamName(context, node) {
@@ -1246,8 +1243,8 @@ function canFix(context, node) {
1246
1243
  const { importSource } = getSettingsFromContext(context);
1247
1244
  const initialScope = context.sourceCode.getScope(node);
1248
1245
  switch (node.callee.type) {
1249
- case AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.callee.name, importSource, initialScope);
1250
- case AST_NODE_TYPES.MemberExpression: return node.callee.object.type === AST_NODE_TYPES.Identifier && isInitializedFromReact(node.callee.object.name, importSource, initialScope);
1246
+ case AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.callee.name, initialScope, importSource);
1247
+ case AST_NODE_TYPES.MemberExpression: return node.callee.object.type === AST_NODE_TYPES.Identifier && isInitializedFromReact(node.callee.object.name, initialScope, importSource);
1251
1248
  default: return false;
1252
1249
  }
1253
1250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "2.4.0-beta.12",
3
+ "version": "2.4.0-beta.14",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -46,16 +46,16 @@
46
46
  "string-ts": "^2.3.1",
47
47
  "ts-api-utils": "^2.1.0",
48
48
  "ts-pattern": "^5.9.0",
49
- "@eslint-react/ast": "2.4.0-beta.12",
50
- "@eslint-react/eff": "2.4.0-beta.12",
51
- "@eslint-react/core": "2.4.0-beta.12",
52
- "@eslint-react/shared": "2.4.0-beta.12",
53
- "@eslint-react/var": "2.4.0-beta.12"
49
+ "@eslint-react/ast": "2.4.0-beta.14",
50
+ "@eslint-react/core": "2.4.0-beta.14",
51
+ "@eslint-react/eff": "2.4.0-beta.14",
52
+ "@eslint-react/shared": "2.4.0-beta.14",
53
+ "@eslint-react/var": "2.4.0-beta.14"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.7",
57
57
  "@types/react-dom": "^19.2.3",
58
- "tsdown": "^0.18.1",
58
+ "tsdown": "^0.18.2",
59
59
  "@local/configs": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {