eslint-plugin-react-x 5.10.1 → 5.10.2

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 +9 -20
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -144,7 +144,7 @@ const rules$6 = {
144
144
  //#endregion
145
145
  //#region package.json
146
146
  var name$6 = "eslint-plugin-react-x";
147
- var version = "5.10.1";
147
+ var version = "5.10.2";
148
148
 
149
149
  //#endregion
150
150
  //#region src/utils/create-rule.ts
@@ -7339,12 +7339,14 @@ function create$3(context) {
7339
7339
  //#endregion
7340
7340
  //#region src/rules/unsupported-syntax/lib.ts
7341
7341
  function isEvalCall(node) {
7342
- return Check.isIdentifier("eval")(Extract.unwrap(node.callee));
7343
- }
7344
- function isIifeCall(node) {
7345
- let parent = node.parent;
7346
- while (Check.isTypeExpression(parent) || parent.type === AST_NODE_TYPES.ChainExpression) parent = parent.parent;
7347
- return parent.type === AST_NODE_TYPES.CallExpression && Extract.unwrap(parent.callee) === node;
7342
+ const callee = Extract.unwrap(node.callee);
7343
+ switch (callee.type) {
7344
+ case AST_NODE_TYPES.Identifier: return callee.name === "eval";
7345
+ case AST_NODE_TYPES.MemberExpression:
7346
+ if (!Check.isIdentifier("globalThis")(Extract.unwrap(callee.object))) return false;
7347
+ return Extract.getPropertyName(callee.property, (n) => callee.computed ? null : n.name) === "eval";
7348
+ default: return false;
7349
+ }
7348
7350
  }
7349
7351
 
7350
7352
  //#endregion
@@ -7356,7 +7358,6 @@ var unsupported_syntax_default = createRule({
7356
7358
  docs: { description: "Validates against syntax that React Compiler does not support." },
7357
7359
  messages: {
7358
7360
  eval: "Do not use 'eval' inside components or hooks. 'eval' cannot be statically analyzed and is not supported by React Compiler.",
7359
- iife: "Do not use immediately-invoked function expressions in JSX. IIFEs will not be optimized by React Compiler.",
7360
7361
  with: "Do not use 'with' statements inside components or hooks. 'with' changes scope dynamically and is not supported by React Compiler."
7361
7362
  },
7362
7363
  schema: []
@@ -7380,18 +7381,6 @@ function create$2(context) {
7380
7381
  node
7381
7382
  });
7382
7383
  },
7383
- "JSXElement :function"(node) {
7384
- if (isIifeCall(node)) context.report({
7385
- messageId: "iife",
7386
- node: node.parent
7387
- });
7388
- },
7389
- "JSXFragment :function"(node) {
7390
- if (isIifeCall(node)) context.report({
7391
- messageId: "iife",
7392
- node: node.parent
7393
- });
7394
- },
7395
7384
  "Program:exit"(node) {
7396
7385
  const components = fc.api.getAllComponents(node);
7397
7386
  const hooks = hc.api.getAllHooks(node);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "5.10.1",
3
+ "version": "5.10.2",
4
4
  "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -45,12 +45,12 @@
45
45
  "string-ts": "^2.3.1",
46
46
  "ts-api-utils": "^2.5.0",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/ast": "5.10.1",
49
- "@eslint-react/core": "5.10.1",
50
- "@eslint-react/eslint": "5.10.1",
51
- "@eslint-react/jsx": "5.10.1",
52
- "@eslint-react/shared": "5.10.1",
53
- "@eslint-react/var": "5.10.1"
48
+ "@eslint-react/ast": "5.10.2",
49
+ "@eslint-react/core": "5.10.2",
50
+ "@eslint-react/var": "5.10.2",
51
+ "@eslint-react/jsx": "5.10.2",
52
+ "@eslint-react/shared": "5.10.2",
53
+ "@eslint-react/eslint": "5.10.2"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/react": "^19.2.17",