eslint-plugin-react-x 5.5.3-next.1 → 5.5.4-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.
Files changed (2) hide show
  1. package/dist/index.js +9 -3
  2. package/package.json +17 -20
package/dist/index.js CHANGED
@@ -142,7 +142,7 @@ const rules$6 = {
142
142
  //#endregion
143
143
  //#region package.json
144
144
  var name$6 = "eslint-plugin-react-x";
145
- var version = "5.5.3-next.1";
145
+ var version = "5.5.4-beta.0";
146
146
 
147
147
  //#endregion
148
148
  //#region src/utils/create-rule.ts
@@ -168,6 +168,12 @@ var error_boundaries_default = createRule({
168
168
  create: create$49,
169
169
  defaultOptions: []
170
170
  });
171
+ function getEnclosingTryBlock(node) {
172
+ const tryStmt = Traverse.findParent(node, is(AST_NODE_TYPES.TryStatement));
173
+ if (tryStmt == null) return null;
174
+ if (Traverse.findParent(node, (n) => n === tryStmt.block) != null) return tryStmt;
175
+ return getEnclosingTryBlock(tryStmt);
176
+ }
171
177
  function create$49(context) {
172
178
  if (!context.sourceCode.text.includes("try")) return {};
173
179
  const hint = JsxDetectionHint.DoNotIncludeJsxWithNullValue | JsxDetectionHint.DoNotIncludeJsxWithNumberValue | JsxDetectionHint.DoNotIncludeJsxWithBigIntValue | JsxDetectionHint.DoNotIncludeJsxWithStringValue | JsxDetectionHint.DoNotIncludeJsxWithBooleanValue | JsxDetectionHint.DoNotIncludeJsxWithUndefinedValue | JsxDetectionHint.DoNotIncludeJsxWithEmptyArrayValue;
@@ -185,7 +191,7 @@ function create$49(context) {
185
191
  const hooks = hc.api.getAllHooks(node);
186
192
  const funcs = [...comps, ...hooks];
187
193
  for (const call of useCalls) {
188
- const stmt = Traverse.findParent(call, is(AST_NODE_TYPES.TryStatement));
194
+ const stmt = getEnclosingTryBlock(call);
189
195
  const func = Traverse.findParent(stmt, (n) => funcs.some((f) => f.node === n));
190
196
  if (stmt != null && func != null && !reported.has(stmt)) {
191
197
  context.report({
@@ -198,7 +204,7 @@ function create$49(context) {
198
204
  for (const { rets } of funcs) for (const ret of rets) {
199
205
  if (ret == null) continue;
200
206
  if (!isJsxLike(context, ret, hint)) continue;
201
- const stmt = Traverse.findParent(ret, is(AST_NODE_TYPES.TryStatement));
207
+ const stmt = getEnclosingTryBlock(ret);
202
208
  if (stmt != null && !reported.has(stmt)) {
203
209
  context.report({
204
210
  messageId: "tryCatchWithJsx",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "5.5.3-next.1",
3
+ "version": "5.5.4-beta.0",
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",
@@ -33,25 +33,24 @@
33
33
  "module": "./dist/index.js",
34
34
  "types": "./dist/index.d.ts",
35
35
  "files": [
36
- "dist",
37
- "./package.json"
36
+ "dist"
38
37
  ],
39
38
  "dependencies": {
40
- "@typescript-eslint/scope-manager": "^8.59.0",
41
- "@typescript-eslint/type-utils": "^8.59.0",
42
- "@typescript-eslint/types": "^8.59.0",
43
- "@typescript-eslint/typescript-estree": "^8.59.0",
44
- "@typescript-eslint/utils": "^8.59.0",
39
+ "@typescript-eslint/scope-manager": "^8.59.1",
40
+ "@typescript-eslint/type-utils": "^8.59.1",
41
+ "@typescript-eslint/types": "^8.59.1",
42
+ "@typescript-eslint/typescript-estree": "^8.59.1",
43
+ "@typescript-eslint/utils": "^8.59.1",
45
44
  "compare-versions": "^6.1.1",
46
45
  "string-ts": "^2.3.1",
47
46
  "ts-api-utils": "^2.5.0",
48
47
  "ts-pattern": "^5.9.0",
49
- "@eslint-react/ast": "5.5.3-next.1",
50
- "@eslint-react/core": "5.5.3-next.1",
51
- "@eslint-react/eslint": "5.5.3-next.1",
52
- "@eslint-react/jsx": "5.5.3-next.1",
53
- "@eslint-react/shared": "5.5.3-next.1",
54
- "@eslint-react/var": "5.5.3-next.1"
48
+ "@eslint-react/ast": "5.5.4-beta.0",
49
+ "@eslint-react/core": "5.5.4-beta.0",
50
+ "@eslint-react/eslint": "5.5.4-beta.0",
51
+ "@eslint-react/jsx": "5.5.4-beta.0",
52
+ "@eslint-react/var": "5.5.4-beta.0",
53
+ "@eslint-react/shared": "5.5.4-beta.0"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@types/react": "^19.2.14",
@@ -62,9 +61,10 @@
62
61
  "react-dom": "^19.2.5",
63
62
  "tsdown": "^0.21.10",
64
63
  "tsl": "^1.0.30",
65
- "tsl-dx": "^0.12.0",
66
- "@local/eff": "3.0.0-beta.72",
67
- "@local/configs": "0.0.0"
64
+ "tsl-dx": "^0.12.1",
65
+ "typescript": "^6.0.3",
66
+ "@local/configs": "0.0.0",
67
+ "@local/eff": "3.0.0-beta.72"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "eslint": "^10.2.1",
@@ -73,9 +73,6 @@
73
73
  "engines": {
74
74
  "node": ">=22.0.0"
75
75
  },
76
- "publishConfig": {
77
- "access": "public"
78
- },
79
76
  "inlinedDependencies": {
80
77
  "@local/eff": "workspace:*"
81
78
  },