eslint-plugin-react-x 3.0.0-next.53 → 3.0.0-next.54

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 +8 -2
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { ESLintUtils } from "@typescript-eslint/utils";
5
5
  import { P, isMatching, match } from "ts-pattern";
6
6
  import ts from "typescript";
7
7
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
8
- import { findEnclosingAssignmentTarget, findVariable, getChildScopes, getObjectType, getVariableInitializer, isAssignmentTargetEqual } from "@eslint-react/var";
8
+ import { findEnclosingAssignmentTarget, findVariable, getObjectType, getVariableInitializer, isAssignmentTargetEqual } from "@eslint-react/var";
9
9
  import { DefinitionType } from "@typescript-eslint/scope-manager";
10
10
  import { constFalse, constTrue, constVoid, flow, getOrElseUpdate, identity, not, unit } from "@eslint-react/eff";
11
11
  import { compare } from "compare-versions";
@@ -68,7 +68,7 @@ const rules$7 = {
68
68
  //#endregion
69
69
  //#region package.json
70
70
  var name$6 = "eslint-plugin-react-x";
71
- var version = "3.0.0-next.53";
71
+ var version = "3.0.0-next.54";
72
72
 
73
73
  //#endregion
74
74
  //#region src/utils/create-rule.ts
@@ -3173,6 +3173,9 @@ function create$21(context) {
3173
3173
  return initNode;
3174
3174
  }).otherwise(() => null);
3175
3175
  if (arg0Node == null) return;
3176
+ function getChildScopes(scope) {
3177
+ return scope.childScopes.reduce((acc, child) => [...acc, ...getChildScopes(child)], [scope]);
3178
+ }
3176
3179
  if (!getChildScopes(context.sourceCode.getScope(arg0Node)).flatMap((x) => x.references).some((x) => x.resolved?.scope.block === component)) {
3177
3180
  context.report({
3178
3181
  messageId: "default",
@@ -3254,6 +3257,9 @@ function create$20(context) {
3254
3257
  return variableNode;
3255
3258
  }).otherwise(() => null);
3256
3259
  if (arg0Node == null) return;
3260
+ function getChildScopes(scope) {
3261
+ return scope.childScopes.reduce((acc, child) => [...acc, ...getChildScopes(child)], [scope]);
3262
+ }
3257
3263
  if (!getChildScopes(context.sourceCode.getScope(arg0Node)).flatMap((x) => x.references).some((x) => x.resolved?.scope.block === component)) {
3258
3264
  context.report({
3259
3265
  messageId: "default",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "3.0.0-next.53",
3
+ "version": "3.0.0-next.54",
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,17 +45,17 @@
45
45
  "string-ts": "^2.3.1",
46
46
  "ts-api-utils": "^2.4.0",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/ast": "3.0.0-next.53",
49
- "@eslint-react/core": "3.0.0-next.53",
50
- "@eslint-react/eff": "3.0.0-next.53",
51
- "@eslint-react/shared": "3.0.0-next.53",
52
- "@eslint-react/var": "3.0.0-next.53"
48
+ "@eslint-react/ast": "3.0.0-next.54",
49
+ "@eslint-react/core": "3.0.0-next.54",
50
+ "@eslint-react/eff": "3.0.0-next.54",
51
+ "@eslint-react/shared": "3.0.0-next.54",
52
+ "@eslint-react/var": "3.0.0-next.54"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/react": "^19.2.14",
56
56
  "@types/react-dom": "^19.2.3",
57
- "tsdown": "^0.20.3",
58
- "tsl-dx": "^0.7.2",
57
+ "tsdown": "^0.21.0-beta.1",
58
+ "tsl-dx": "^0.8.0",
59
59
  "@local/configs": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {