@eslint-react/var 1.23.3-next.8 → 1.24.0-next.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.
package/dist/index.d.mts CHANGED
@@ -1,27 +1,17 @@
1
- import { O } from '@eslint-react/eff';
2
- import * as _typescript_eslint_scope_manager from '@typescript-eslint/scope-manager';
3
- import { Scope, Variable, ScopeManager } from '@typescript-eslint/scope-manager';
1
+ import { _ } from '@eslint-react/eff';
2
+ import { Scope, Variable } from '@typescript-eslint/scope-manager';
4
3
  import { TSESTree } from '@typescript-eslint/types';
5
4
 
6
5
  declare const findVariable: {
7
- (initialScope: Scope): (nameOrNode: string | TSESTree.Identifier) => O.Option<Variable>;
8
- (nameOrNode: string | TSESTree.Identifier, initialScope: Scope): O.Option<Variable>;
6
+ (initialScope: Scope): (nameOrNode: string | TSESTree.Identifier | _) => Variable | _;
7
+ (nameOrNode: string | TSESTree.Identifier | _, initialScope: Scope): Variable | _;
9
8
  };
10
9
 
11
- declare function getChidScopes(scope: Scope, prev?: readonly Scope[]): readonly Scope[];
10
+ declare function getChidScopes(scope: Scope): readonly Scope[];
12
11
 
13
- declare function getScope(node: TSESTree.Node, scopeManager: ScopeManager): _typescript_eslint_scope_manager.Scope | null;
12
+ declare function getVariableDeclaratorId(node: TSESTree.Node | _, prev?: TSESTree.Node): TSESTree.BindingName | TSESTree.Expression | _;
14
13
 
15
- declare function getStaticValue(node: TSESTree.Node, initialScope: Scope): O.Option<unknown>;
16
-
17
- declare function getVariableDeclaratorID(node: TSESTree.Node, prev?: TSESTree.Node): O.Option<TSESTree.BindingName | TSESTree.Expression>;
18
-
19
- /**
20
- * Get the init node of the nth definition of a variable
21
- * @param at The index number of def in defs
22
- * @returns A function that takes a variable and returns the init node of the nth definition of that variable
23
- */
24
- declare function getVariableNode(at: number): (variable: Variable) => O.Option<TSESTree.ClassDeclaration | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.Expression | TSESTree.FunctionDeclaration | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName>;
14
+ declare function getVariableNode(variable: Variable | _, at: number): _ | TSESTree.ClassDeclaration | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.Expression | TSESTree.FunctionDeclaration | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName;
25
15
 
26
16
  /**
27
17
  * Get all variables from the given scope up to the global scope
@@ -51,10 +41,33 @@ declare function isNodeValueEqual(a: TSESTree.Node, b: TSESTree.Node, initialSco
51
41
  bScope: Scope
52
42
  ]): boolean;
53
43
 
54
- type ValueConstruction = {
55
- kind: "None";
44
+ type StaticValue = {
45
+ kind: "lazy";
46
+ node: TSESTree.Node;
47
+ initialScope: Scope | _;
48
+ } | {
49
+ kind: "none";
56
50
  node: TSESTree.Node;
51
+ initialScope: Scope | _;
57
52
  } | {
53
+ kind: "some";
54
+ node: TSESTree.Node;
55
+ value: unknown;
56
+ initialScope: Scope | _;
57
+ };
58
+ declare function toResolved(sv: StaticValue): {
59
+ readonly kind: "none";
60
+ readonly node: TSESTree.Node;
61
+ readonly initialScope: Scope | undefined;
62
+ readonly value?: never;
63
+ } | {
64
+ readonly kind: "some";
65
+ readonly node: TSESTree.Node;
66
+ readonly initialScope: Scope | undefined;
67
+ readonly value: unknown;
68
+ };
69
+
70
+ type ValueConstruction = {
58
71
  kind: "ArrayExpression";
59
72
  node: TSESTree.ArrayExpression;
60
73
  } | {
@@ -93,6 +106,6 @@ declare const ValueConstructionHint: {
93
106
  * @param hint The hint to use when detecting the construction
94
107
  * @returns A function that detects the construction of a given node
95
108
  */
96
- declare function getValueConstruction(node: TSESTree.Node, initialScope: Scope, hint?: bigint): ValueConstruction;
109
+ declare function getValueConstruction(node: TSESTree.Node | _, initialScope: Scope, hint?: bigint): ValueConstruction | _;
97
110
 
98
- export { type ValueConstruction, ValueConstructionHint, findVariable, getChidScopes, getScope, getStaticValue, getValueConstruction, getVariableDeclaratorID, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual };
111
+ export { type StaticValue, type ValueConstruction, ValueConstructionHint, findVariable, getChidScopes, getValueConstruction, getVariableDeclaratorId, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual, toResolved };
package/dist/index.d.ts CHANGED
@@ -1,27 +1,17 @@
1
- import { O } from '@eslint-react/eff';
2
- import * as _typescript_eslint_scope_manager from '@typescript-eslint/scope-manager';
3
- import { Scope, Variable, ScopeManager } from '@typescript-eslint/scope-manager';
1
+ import { _ } from '@eslint-react/eff';
2
+ import { Scope, Variable } from '@typescript-eslint/scope-manager';
4
3
  import { TSESTree } from '@typescript-eslint/types';
5
4
 
6
5
  declare const findVariable: {
7
- (initialScope: Scope): (nameOrNode: string | TSESTree.Identifier) => O.Option<Variable>;
8
- (nameOrNode: string | TSESTree.Identifier, initialScope: Scope): O.Option<Variable>;
6
+ (initialScope: Scope): (nameOrNode: string | TSESTree.Identifier | _) => Variable | _;
7
+ (nameOrNode: string | TSESTree.Identifier | _, initialScope: Scope): Variable | _;
9
8
  };
10
9
 
11
- declare function getChidScopes(scope: Scope, prev?: readonly Scope[]): readonly Scope[];
10
+ declare function getChidScopes(scope: Scope): readonly Scope[];
12
11
 
13
- declare function getScope(node: TSESTree.Node, scopeManager: ScopeManager): _typescript_eslint_scope_manager.Scope | null;
12
+ declare function getVariableDeclaratorId(node: TSESTree.Node | _, prev?: TSESTree.Node): TSESTree.BindingName | TSESTree.Expression | _;
14
13
 
15
- declare function getStaticValue(node: TSESTree.Node, initialScope: Scope): O.Option<unknown>;
16
-
17
- declare function getVariableDeclaratorID(node: TSESTree.Node, prev?: TSESTree.Node): O.Option<TSESTree.BindingName | TSESTree.Expression>;
18
-
19
- /**
20
- * Get the init node of the nth definition of a variable
21
- * @param at The index number of def in defs
22
- * @returns A function that takes a variable and returns the init node of the nth definition of that variable
23
- */
24
- declare function getVariableNode(at: number): (variable: Variable) => O.Option<TSESTree.ClassDeclaration | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.Expression | TSESTree.FunctionDeclaration | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName>;
14
+ declare function getVariableNode(variable: Variable | _, at: number): _ | TSESTree.ClassDeclaration | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.Expression | TSESTree.FunctionDeclaration | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName;
25
15
 
26
16
  /**
27
17
  * Get all variables from the given scope up to the global scope
@@ -51,10 +41,33 @@ declare function isNodeValueEqual(a: TSESTree.Node, b: TSESTree.Node, initialSco
51
41
  bScope: Scope
52
42
  ]): boolean;
53
43
 
54
- type ValueConstruction = {
55
- kind: "None";
44
+ type StaticValue = {
45
+ kind: "lazy";
46
+ node: TSESTree.Node;
47
+ initialScope: Scope | _;
48
+ } | {
49
+ kind: "none";
56
50
  node: TSESTree.Node;
51
+ initialScope: Scope | _;
57
52
  } | {
53
+ kind: "some";
54
+ node: TSESTree.Node;
55
+ value: unknown;
56
+ initialScope: Scope | _;
57
+ };
58
+ declare function toResolved(sv: StaticValue): {
59
+ readonly kind: "none";
60
+ readonly node: TSESTree.Node;
61
+ readonly initialScope: Scope | undefined;
62
+ readonly value?: never;
63
+ } | {
64
+ readonly kind: "some";
65
+ readonly node: TSESTree.Node;
66
+ readonly initialScope: Scope | undefined;
67
+ readonly value: unknown;
68
+ };
69
+
70
+ type ValueConstruction = {
58
71
  kind: "ArrayExpression";
59
72
  node: TSESTree.ArrayExpression;
60
73
  } | {
@@ -93,6 +106,6 @@ declare const ValueConstructionHint: {
93
106
  * @param hint The hint to use when detecting the construction
94
107
  * @returns A function that detects the construction of a given node
95
108
  */
96
- declare function getValueConstruction(node: TSESTree.Node, initialScope: Scope, hint?: bigint): ValueConstruction;
109
+ declare function getValueConstruction(node: TSESTree.Node | _, initialScope: Scope, hint?: bigint): ValueConstruction | _;
97
110
 
98
- export { type ValueConstruction, ValueConstructionHint, findVariable, getChidScopes, getScope, getStaticValue, getValueConstruction, getVariableDeclaratorID, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual };
111
+ export { type StaticValue, type ValueConstruction, ValueConstructionHint, findVariable, getChidScopes, getValueConstruction, getVariableDeclaratorId, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual, toResolved };
package/dist/index.js CHANGED
@@ -28,65 +28,48 @@ var ASTUtils__namespace = /*#__PURE__*/_interopNamespace(ASTUtils);
28
28
  var AST3__namespace = /*#__PURE__*/_interopNamespace(AST3);
29
29
 
30
30
  // src/find-variable.ts
31
- var findVariable2 = eff.F.dual(2, (nameOrNode, initialScope) => {
32
- return eff.O.fromNullable(ASTUtils__namespace.findVariable(initialScope, nameOrNode));
31
+ var findVariable2 = eff.dual(2, (nameOrNode, initialScope) => {
32
+ if (nameOrNode === eff._) return eff._;
33
+ return ASTUtils__namespace.findVariable(initialScope, nameOrNode) ?? eff._;
33
34
  });
34
35
 
35
36
  // src/get-child-scopes.ts
36
- function getChidScopes(scope, prev = []) {
37
- return [scope, ...scope.childScopes.reduce((acc, prev2) => getChidScopes(prev2, [...acc, prev2]), prev)];
38
- }
39
- function getScope(node, scopeManager) {
40
- const { type, parent } = node;
41
- const inner = type !== types.AST_NODE_TYPES.Program;
42
- const scope = scopeManager.acquire(node, inner);
43
- if (scope != null) {
44
- return scope;
45
- }
46
- if (parent != null) {
47
- return getScope(parent, scopeManager);
37
+ function getChidScopes(scope) {
38
+ const scopes = [scope];
39
+ for (const childScope of scope.childScopes) {
40
+ scopes.push(...getChidScopes(childScope));
48
41
  }
49
- return null;
50
- }
51
- function getStaticValue2(node, initialScope) {
52
- return eff.F.pipe(
53
- eff.O.fromNullable(ASTUtils__namespace.getStaticValue(node, initialScope)),
54
- eff.O.map((v) => v.value)
55
- );
42
+ return scopes;
56
43
  }
57
- function getVariableDeclaratorID(node, prev) {
44
+ function getVariableDeclaratorId(node, prev) {
45
+ if (node === eff._) return eff._;
58
46
  switch (true) {
59
47
  case (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init === prev):
60
- return eff.O.some(node.id);
48
+ return node.id;
61
49
  case (node.type === types.AST_NODE_TYPES.AssignmentExpression && node.right === prev):
62
- return eff.O.some(node.left);
50
+ return node.left;
63
51
  case (node.type === types.AST_NODE_TYPES.BlockStatement || node.type === types.AST_NODE_TYPES.Program || node.parent === node):
64
- return eff.O.none();
52
+ return eff._;
65
53
  default:
66
- return getVariableDeclaratorID(node.parent, node);
54
+ return getVariableDeclaratorId(node.parent, node);
67
55
  }
68
56
  }
69
- function getVariableNode(at) {
70
- return (variable) => {
71
- return eff.F.pipe(
72
- eff.O.some(variable),
73
- eff.O.flatMapNullable((v) => v.defs.at(at)),
74
- eff.O.flatMapNullable((def) => {
75
- switch (true) {
76
- case (def.type === scopeManager.DefinitionType.FunctionName && def.node.type === types.AST_NODE_TYPES.FunctionDeclaration):
77
- return def.node;
78
- case (def.type === scopeManager.DefinitionType.ClassName && def.node.type === types.AST_NODE_TYPES.ClassDeclaration):
79
- return def.node;
80
- case (def.type === scopeManager.DefinitionType.Parameter && AST3__namespace.isFunction(def.node)):
81
- return def.node;
82
- case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
83
- return def.node.init;
84
- default:
85
- return null;
86
- }
87
- })
88
- );
89
- };
57
+ function getVariableNode(variable, at) {
58
+ if (variable === eff._) return eff._;
59
+ const def = variable.defs.at(at);
60
+ if (def === eff._) return eff._;
61
+ switch (true) {
62
+ case (def.type === scopeManager.DefinitionType.FunctionName && def.node.type === types.AST_NODE_TYPES.FunctionDeclaration):
63
+ return def.node;
64
+ case (def.type === scopeManager.DefinitionType.ClassName && def.node.type === types.AST_NODE_TYPES.ClassDeclaration):
65
+ return def.node;
66
+ case (def.type === scopeManager.DefinitionType.Parameter && AST3__namespace.isFunction(def.node)):
67
+ return def.node;
68
+ case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
69
+ return def.node.init;
70
+ default:
71
+ return eff._;
72
+ }
90
73
  }
91
74
  function getVariables(initialScope) {
92
75
  let scope = initialScope;
@@ -98,11 +81,9 @@ function getVariables(initialScope) {
98
81
  return variables.reverse();
99
82
  }
100
83
  function isInitializedFromSource(name, source, initialScope) {
101
- const latestDef = eff.O.flatMapNullable(findVariable2(name, initialScope), (v) => v.defs.at(-1));
102
- if (eff.O.isNone(latestDef)) {
103
- return false;
104
- }
105
- const { node, parent } = latestDef.value;
84
+ const latestDef = findVariable2(name, initialScope)?.defs.at(-1);
85
+ if (latestDef === eff._) return false;
86
+ const { node, parent } = latestDef;
106
87
  if (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init != null) {
107
88
  const { init } = node;
108
89
  if (init.type === types.AST_NODE_TYPES.MemberExpression && init.object.type === types.AST_NODE_TYPES.Identifier) {
@@ -111,13 +92,12 @@ function isInitializedFromSource(name, source, initialScope) {
111
92
  if (init.type === types.AST_NODE_TYPES.Identifier) {
112
93
  return isInitializedFromSource(init.name, source, initialScope);
113
94
  }
114
- return eff.F.pipe(
115
- getRequireExpressionArguments(init),
116
- eff.O.flatMapNullable((args) => args[0]),
117
- eff.O.filter(AST3__namespace.isStringLiteral),
118
- // check for: `require('source')` or `require('source/...')`
119
- eff.O.exists((arg) => arg.value === source || arg.value.startsWith(`${source}/`))
120
- );
95
+ const args = getRequireExpressionArguments(init);
96
+ const arg0 = args?.[0];
97
+ if (arg0 == null || !AST3__namespace.isStringLiteral(arg0)) {
98
+ return false;
99
+ }
100
+ return arg0.value === source || arg0.value.startsWith(`${source}/`);
121
101
  }
122
102
  return parent?.type === types.AST_NODE_TYPES.ImportDeclaration && parent.source.value === source;
123
103
  }
@@ -125,15 +105,25 @@ function getRequireExpressionArguments(node) {
125
105
  switch (true) {
126
106
  // require('source')
127
107
  case (node.type === types.AST_NODE_TYPES.CallExpression && node.callee.type === types.AST_NODE_TYPES.Identifier && node.callee.name === "require"): {
128
- return eff.O.some(node.arguments);
108
+ return node.arguments;
129
109
  }
130
110
  // require('source').variable
131
111
  case node.type === types.AST_NODE_TYPES.MemberExpression: {
132
112
  return getRequireExpressionArguments(node.object);
133
113
  }
134
114
  }
135
- return eff.O.none();
115
+ return eff._;
136
116
  }
117
+ function toResolved(sv) {
118
+ const { kind, node, initialScope } = sv;
119
+ if (kind !== "lazy") {
120
+ return sv;
121
+ }
122
+ const resolvedValue = initialScope === eff._ ? ASTUtils.getStaticValue(node) : ASTUtils.getStaticValue(node, initialScope);
123
+ return resolvedValue == null ? { kind: "none", node, initialScope } : { kind: "some", node, initialScope, value: resolvedValue.value };
124
+ }
125
+
126
+ // src/is-node-value-equal.ts
137
127
  var thisBlockTypes = [
138
128
  types.AST_NODE_TYPES.FunctionDeclaration,
139
129
  types.AST_NODE_TYPES.FunctionExpression,
@@ -155,48 +145,37 @@ function isNodeValueEqual(a, b, initialScopes) {
155
145
  case (a.type === types.AST_NODE_TYPES.Identifier && b.type === types.AST_NODE_TYPES.Identifier): {
156
146
  const aVar = findVariable2(a, aScope);
157
147
  const bVar = findVariable2(b, bScope);
158
- const aVarNode = eff.O.flatMap(aVar, getVariableNode(0));
159
- const bVarNode = eff.O.flatMap(bVar, getVariableNode(0));
160
- const aVarNodeParent = eff.O.flatMapNullable(aVarNode, (n) => n.parent);
161
- const bVarNodeParent = eff.O.flatMapNullable(bVarNode, (n) => n.parent);
162
- const aDef = eff.O.flatMapNullable(aVar, (v) => v.defs.at(0));
163
- const bDef = eff.O.flatMapNullable(bVar, (v) => v.defs.at(0));
164
- const aDefParentParent = eff.O.flatMapNullable(aDef, (d) => d.parent?.parent);
165
- const bDefParentParent = eff.O.flatMapNullable(bDef, (d) => d.parent?.parent);
148
+ const aVarNode = getVariableNode(aVar, 0);
149
+ const bVarNode = getVariableNode(bVar, 0);
150
+ const aVarNodeParent = aVarNode?.parent;
151
+ const bVarNodeParent = bVarNode?.parent;
152
+ const aDef = aVar?.defs.at(0);
153
+ const bDef = bVar?.defs.at(0);
154
+ const aDefParentParent = aDef?.parent?.parent;
155
+ const bDefParentParent = bDef?.parent?.parent;
166
156
  switch (true) {
167
- case (eff.O.exists(aVarNodeParent, AST3__namespace.is(types.AST_NODE_TYPES.CallExpression)) && eff.O.exists(bVarNodeParent, AST3__namespace.is(types.AST_NODE_TYPES.CallExpression)) && eff.O.exists(aVarNode, AST3__namespace.isFunction) && eff.O.exists(bVarNode, AST3__namespace.isFunction)): {
168
- const hasSameCallee = eff.F.pipe(
169
- eff.O.Do,
170
- eff.O.bind("aCallee", () => eff.O.map(aVarNodeParent, (n) => n.callee)),
171
- eff.O.bind("bCallee", () => eff.O.map(bVarNodeParent, (n) => n.callee)),
172
- eff.O.exists(({ aCallee, bCallee }) => AST3__namespace.isNodeEqual(aCallee, bCallee))
173
- );
174
- if (!hasSameCallee) {
157
+ case (aVarNodeParent?.type === types.AST_NODE_TYPES.CallExpression && bVarNodeParent?.type === types.AST_NODE_TYPES.CallExpression && AST3__namespace.isFunction(aVarNode) && AST3__namespace.isFunction(bVarNode)): {
158
+ if (!AST3__namespace.isNodeEqual(aVarNodeParent.callee, bVarNodeParent.callee)) {
175
159
  return false;
176
160
  }
177
- return eff.F.pipe(
178
- eff.O.Do,
179
- eff.O.bind("aParams", () => eff.O.map(aVarNode, (n) => n.params)),
180
- eff.O.bind("bParams", () => eff.O.map(bVarNode, (n) => n.params)),
181
- eff.O.let("aPos", ({ aParams }) => aParams.findIndex(AST3__namespace.isNodeEqual(a))),
182
- eff.O.let("bPos", ({ bParams }) => bParams.findIndex(AST3__namespace.isNodeEqual(b))),
183
- eff.O.filter(({ aPos, bPos }) => aPos !== -1 && bPos !== -1),
184
- eff.O.exists(({ aPos, bPos }) => aPos === bPos)
185
- );
161
+ const aParams = aVarNode.params;
162
+ const bParams = bVarNode.params;
163
+ const aPos = aParams.findIndex((x) => AST3__namespace.isNodeEqual(x, a));
164
+ const bPos = bParams.findIndex((x) => AST3__namespace.isNodeEqual(x, b));
165
+ return aPos !== -1 && bPos !== -1 && aPos === bPos;
186
166
  }
187
- case (eff.O.exists(aDefParentParent, AST3__namespace.is(types.AST_NODE_TYPES.ForOfStatement)) && eff.O.exists(bDefParentParent, AST3__namespace.is(types.AST_NODE_TYPES.ForOfStatement))): {
188
- return eff.F.pipe(
189
- eff.O.Do,
190
- eff.O.bind("aLeft", () => eff.O.map(aDefParentParent, (d) => d.left)),
191
- eff.O.bind("bLeft", () => eff.O.map(bDefParentParent, (d) => d.left)),
192
- eff.O.filter(({ aLeft, bLeft }) => aLeft.type === bLeft.type),
193
- eff.O.bind("aRight", () => eff.O.map(aDefParentParent, (d) => d.right)),
194
- eff.O.bind("bRight", () => eff.O.map(bDefParentParent, (d) => d.right)),
195
- eff.O.exists(({ aRight, bRight }) => AST3__namespace.isNodeEqual(aRight, bRight))
196
- );
167
+ case (aDefParentParent?.type === types.AST_NODE_TYPES.ForOfStatement && bDefParentParent?.type === types.AST_NODE_TYPES.ForOfStatement): {
168
+ const aLeft = aDefParentParent.left;
169
+ const bLeft = bDefParentParent.left;
170
+ if (aLeft.type !== bLeft.type) {
171
+ return false;
172
+ }
173
+ const aRight = aDefParentParent.right;
174
+ const bRight = bDefParentParent.right;
175
+ return AST3__namespace.isNodeEqual(aRight, bRight);
197
176
  }
198
177
  default: {
199
- return eff.O.isSome(aVar) && eff.O.isSome(bVar) && aVar.value === bVar.value;
178
+ return aVar !== eff._ && bVar !== eff._ && aVar === bVar;
200
179
  }
201
180
  }
202
181
  }
@@ -207,20 +186,14 @@ function isNodeValueEqual(a, b, initialScopes) {
207
186
  if (aScope.block === bScope.block) {
208
187
  return true;
209
188
  }
210
- return eff.F.pipe(
211
- eff.O.Do,
212
- eff.O.bind("aFunction", () => AST3__namespace.findParentNode(a, AST3__namespace.isOneOf(thisBlockTypes))),
213
- eff.O.bind("bFunction", () => AST3__namespace.findParentNode(b, AST3__namespace.isOneOf(thisBlockTypes))),
214
- eff.O.exists(({ aFunction, bFunction }) => aFunction === bFunction)
215
- );
189
+ const aFunction = AST3__namespace.findParentNode(a, AST3__namespace.isOneOf(thisBlockTypes));
190
+ const bFunction = AST3__namespace.findParentNode(b, AST3__namespace.isOneOf(thisBlockTypes));
191
+ return aFunction === bFunction;
216
192
  }
217
193
  default: {
218
- return eff.F.pipe(
219
- eff.O.Do,
220
- eff.O.bind("aStatic", () => getStaticValue2(a, aScope)),
221
- eff.O.bind("bStatic", () => getStaticValue2(b, bScope)),
222
- eff.O.exists(({ aStatic, bStatic }) => aStatic === bStatic)
223
- );
194
+ const aStatic = toResolved({ kind: "lazy", node: a, initialScope: aScope });
195
+ const bStatic = toResolved({ kind: "lazy", node: b, initialScope: bScope });
196
+ return aStatic.kind !== "none" && bStatic.kind !== "none" && aStatic.value === bStatic.value;
224
197
  }
225
198
  }
226
199
  }
@@ -229,6 +202,7 @@ var ValueConstructionHint = {
229
202
  StrictCallExpression: 1n << 0n
230
203
  };
231
204
  function getValueConstruction(node, initialScope, hint = ValueConstructionHint.None) {
205
+ if (node === eff._) return eff._;
232
206
  switch (node.type) {
233
207
  case types.AST_NODE_TYPES.JSXElement:
234
208
  case types.AST_NODE_TYPES.JSXFragment: {
@@ -254,61 +228,44 @@ function getValueConstruction(node, initialScope, hint = ValueConstructionHint.N
254
228
  if (hint & ValueConstructionHint.StrictCallExpression) {
255
229
  return { kind: "CallExpression", node };
256
230
  }
257
- return { kind: "None", node };
231
+ return eff._;
258
232
  }
259
233
  case types.AST_NODE_TYPES.MemberExpression: {
260
- if (!("object" in node)) {
261
- return { kind: "None", node };
262
- }
234
+ if (!("object" in node)) return eff._;
263
235
  return getValueConstruction(node.object, initialScope, hint);
264
236
  }
265
237
  case types.AST_NODE_TYPES.AssignmentExpression:
266
238
  case types.AST_NODE_TYPES.AssignmentPattern: {
267
- if (!("right" in node)) {
268
- return { kind: "None", node };
269
- }
239
+ if (!("right" in node)) return eff._;
270
240
  return getValueConstruction(node.right, initialScope, hint);
271
241
  }
272
242
  case types.AST_NODE_TYPES.LogicalExpression: {
273
243
  const lvc = getValueConstruction(node.left, initialScope, hint);
274
- if (lvc.kind !== "None") {
275
- return lvc;
276
- }
244
+ if (lvc === eff._) return eff._;
277
245
  return getValueConstruction(node.right, initialScope, hint);
278
246
  }
279
247
  case types.AST_NODE_TYPES.ConditionalExpression: {
280
248
  const cvc = getValueConstruction(node.consequent, initialScope, hint);
281
- if (cvc.kind !== "None") {
282
- return cvc;
283
- }
249
+ if (cvc === eff._) return eff._;
284
250
  return getValueConstruction(node.alternate, initialScope, hint);
285
251
  }
286
252
  case types.AST_NODE_TYPES.Identifier: {
287
- if (!("name" in node && eff.isString(node.name))) {
288
- return { kind: "None", node };
289
- }
290
- const construction = eff.F.pipe(
291
- eff.O.fromNullable(initialScope.set.get(node.name)),
292
- eff.O.flatMap(getVariableNode(-1)),
293
- eff.O.map((node2) => getValueConstruction(node2, initialScope, hint)),
294
- eff.O.filter((vc) => vc.kind !== "None")
295
- );
296
- if (eff.O.isNone(construction)) {
297
- return { kind: "None", node };
253
+ if (!("name" in node && typeof node.name === "string")) {
254
+ return eff._;
298
255
  }
299
- return {
300
- ...construction.value
301
- };
256
+ const variable = initialScope.set.get(node.name);
257
+ const variableNode = getVariableNode(variable, -1);
258
+ return getValueConstruction(variableNode, initialScope, hint);
302
259
  }
303
260
  case types.AST_NODE_TYPES.Literal: {
304
261
  if ("regex" in node) {
305
262
  return { kind: "RegExpLiteral", node };
306
263
  }
307
- return { kind: "None", node };
264
+ return eff._;
308
265
  }
309
266
  default: {
310
- if (!("expression" in node && eff.isObject(node.expression))) {
311
- return { kind: "None", node };
267
+ if (!("expression" in node && typeof node.expression === "object")) {
268
+ return eff._;
312
269
  }
313
270
  return getValueConstruction(node.expression, initialScope, hint);
314
271
  }
@@ -318,11 +275,10 @@ function getValueConstruction(node, initialScope, hint = ValueConstructionHint.N
318
275
  exports.ValueConstructionHint = ValueConstructionHint;
319
276
  exports.findVariable = findVariable2;
320
277
  exports.getChidScopes = getChidScopes;
321
- exports.getScope = getScope;
322
- exports.getStaticValue = getStaticValue2;
323
278
  exports.getValueConstruction = getValueConstruction;
324
- exports.getVariableDeclaratorID = getVariableDeclaratorID;
279
+ exports.getVariableDeclaratorId = getVariableDeclaratorId;
325
280
  exports.getVariableNode = getVariableNode;
326
281
  exports.getVariables = getVariables;
327
282
  exports.isInitializedFromSource = isInitializedFromSource;
328
283
  exports.isNodeValueEqual = isNodeValueEqual;
284
+ exports.toResolved = toResolved;
package/dist/index.mjs CHANGED
@@ -1,69 +1,53 @@
1
- import { F, O, isObject, isString } from '@eslint-react/eff';
1
+ import { dual, _ } from '@eslint-react/eff';
2
2
  import * as ASTUtils from '@typescript-eslint/utils/ast-utils';
3
+ import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
3
4
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
4
5
  import * as AST3 from '@eslint-react/ast';
5
6
  import { DefinitionType, ScopeType } from '@typescript-eslint/scope-manager';
6
7
 
7
8
  // src/find-variable.ts
8
- var findVariable2 = F.dual(2, (nameOrNode, initialScope) => {
9
- return O.fromNullable(ASTUtils.findVariable(initialScope, nameOrNode));
9
+ var findVariable2 = dual(2, (nameOrNode, initialScope) => {
10
+ if (nameOrNode === _) return _;
11
+ return ASTUtils.findVariable(initialScope, nameOrNode) ?? _;
10
12
  });
11
13
 
12
14
  // src/get-child-scopes.ts
13
- function getChidScopes(scope, prev = []) {
14
- return [scope, ...scope.childScopes.reduce((acc, prev2) => getChidScopes(prev2, [...acc, prev2]), prev)];
15
- }
16
- function getScope(node, scopeManager) {
17
- const { type, parent } = node;
18
- const inner = type !== AST_NODE_TYPES.Program;
19
- const scope = scopeManager.acquire(node, inner);
20
- if (scope != null) {
21
- return scope;
22
- }
23
- if (parent != null) {
24
- return getScope(parent, scopeManager);
15
+ function getChidScopes(scope) {
16
+ const scopes = [scope];
17
+ for (const childScope of scope.childScopes) {
18
+ scopes.push(...getChidScopes(childScope));
25
19
  }
26
- return null;
27
- }
28
- function getStaticValue2(node, initialScope) {
29
- return F.pipe(
30
- O.fromNullable(ASTUtils.getStaticValue(node, initialScope)),
31
- O.map((v) => v.value)
32
- );
20
+ return scopes;
33
21
  }
34
- function getVariableDeclaratorID(node, prev) {
22
+ function getVariableDeclaratorId(node, prev) {
23
+ if (node === _) return _;
35
24
  switch (true) {
36
25
  case (node.type === AST_NODE_TYPES.VariableDeclarator && node.init === prev):
37
- return O.some(node.id);
26
+ return node.id;
38
27
  case (node.type === AST_NODE_TYPES.AssignmentExpression && node.right === prev):
39
- return O.some(node.left);
28
+ return node.left;
40
29
  case (node.type === AST_NODE_TYPES.BlockStatement || node.type === AST_NODE_TYPES.Program || node.parent === node):
41
- return O.none();
30
+ return _;
42
31
  default:
43
- return getVariableDeclaratorID(node.parent, node);
32
+ return getVariableDeclaratorId(node.parent, node);
44
33
  }
45
34
  }
46
- function getVariableNode(at) {
47
- return (variable) => {
48
- return F.pipe(
49
- O.some(variable),
50
- O.flatMapNullable((v) => v.defs.at(at)),
51
- O.flatMapNullable((def) => {
52
- switch (true) {
53
- case (def.type === DefinitionType.FunctionName && def.node.type === AST_NODE_TYPES.FunctionDeclaration):
54
- return def.node;
55
- case (def.type === DefinitionType.ClassName && def.node.type === AST_NODE_TYPES.ClassDeclaration):
56
- return def.node;
57
- case (def.type === DefinitionType.Parameter && AST3.isFunction(def.node)):
58
- return def.node;
59
- case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
60
- return def.node.init;
61
- default:
62
- return null;
63
- }
64
- })
65
- );
66
- };
35
+ function getVariableNode(variable, at) {
36
+ if (variable === _) return _;
37
+ const def = variable.defs.at(at);
38
+ if (def === _) return _;
39
+ switch (true) {
40
+ case (def.type === DefinitionType.FunctionName && def.node.type === AST_NODE_TYPES.FunctionDeclaration):
41
+ return def.node;
42
+ case (def.type === DefinitionType.ClassName && def.node.type === AST_NODE_TYPES.ClassDeclaration):
43
+ return def.node;
44
+ case (def.type === DefinitionType.Parameter && AST3.isFunction(def.node)):
45
+ return def.node;
46
+ case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
47
+ return def.node.init;
48
+ default:
49
+ return _;
50
+ }
67
51
  }
68
52
  function getVariables(initialScope) {
69
53
  let scope = initialScope;
@@ -75,11 +59,9 @@ function getVariables(initialScope) {
75
59
  return variables.reverse();
76
60
  }
77
61
  function isInitializedFromSource(name, source, initialScope) {
78
- const latestDef = O.flatMapNullable(findVariable2(name, initialScope), (v) => v.defs.at(-1));
79
- if (O.isNone(latestDef)) {
80
- return false;
81
- }
82
- const { node, parent } = latestDef.value;
62
+ const latestDef = findVariable2(name, initialScope)?.defs.at(-1);
63
+ if (latestDef === _) return false;
64
+ const { node, parent } = latestDef;
83
65
  if (node.type === AST_NODE_TYPES.VariableDeclarator && node.init != null) {
84
66
  const { init } = node;
85
67
  if (init.type === AST_NODE_TYPES.MemberExpression && init.object.type === AST_NODE_TYPES.Identifier) {
@@ -88,13 +70,12 @@ function isInitializedFromSource(name, source, initialScope) {
88
70
  if (init.type === AST_NODE_TYPES.Identifier) {
89
71
  return isInitializedFromSource(init.name, source, initialScope);
90
72
  }
91
- return F.pipe(
92
- getRequireExpressionArguments(init),
93
- O.flatMapNullable((args) => args[0]),
94
- O.filter(AST3.isStringLiteral),
95
- // check for: `require('source')` or `require('source/...')`
96
- O.exists((arg) => arg.value === source || arg.value.startsWith(`${source}/`))
97
- );
73
+ const args = getRequireExpressionArguments(init);
74
+ const arg0 = args?.[0];
75
+ if (arg0 == null || !AST3.isStringLiteral(arg0)) {
76
+ return false;
77
+ }
78
+ return arg0.value === source || arg0.value.startsWith(`${source}/`);
98
79
  }
99
80
  return parent?.type === AST_NODE_TYPES.ImportDeclaration && parent.source.value === source;
100
81
  }
@@ -102,15 +83,25 @@ function getRequireExpressionArguments(node) {
102
83
  switch (true) {
103
84
  // require('source')
104
85
  case (node.type === AST_NODE_TYPES.CallExpression && node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === "require"): {
105
- return O.some(node.arguments);
86
+ return node.arguments;
106
87
  }
107
88
  // require('source').variable
108
89
  case node.type === AST_NODE_TYPES.MemberExpression: {
109
90
  return getRequireExpressionArguments(node.object);
110
91
  }
111
92
  }
112
- return O.none();
93
+ return _;
113
94
  }
95
+ function toResolved(sv) {
96
+ const { kind, node, initialScope } = sv;
97
+ if (kind !== "lazy") {
98
+ return sv;
99
+ }
100
+ const resolvedValue = initialScope === _ ? getStaticValue(node) : getStaticValue(node, initialScope);
101
+ return resolvedValue == null ? { kind: "none", node, initialScope } : { kind: "some", node, initialScope, value: resolvedValue.value };
102
+ }
103
+
104
+ // src/is-node-value-equal.ts
114
105
  var thisBlockTypes = [
115
106
  AST_NODE_TYPES.FunctionDeclaration,
116
107
  AST_NODE_TYPES.FunctionExpression,
@@ -132,48 +123,37 @@ function isNodeValueEqual(a, b, initialScopes) {
132
123
  case (a.type === AST_NODE_TYPES.Identifier && b.type === AST_NODE_TYPES.Identifier): {
133
124
  const aVar = findVariable2(a, aScope);
134
125
  const bVar = findVariable2(b, bScope);
135
- const aVarNode = O.flatMap(aVar, getVariableNode(0));
136
- const bVarNode = O.flatMap(bVar, getVariableNode(0));
137
- const aVarNodeParent = O.flatMapNullable(aVarNode, (n) => n.parent);
138
- const bVarNodeParent = O.flatMapNullable(bVarNode, (n) => n.parent);
139
- const aDef = O.flatMapNullable(aVar, (v) => v.defs.at(0));
140
- const bDef = O.flatMapNullable(bVar, (v) => v.defs.at(0));
141
- const aDefParentParent = O.flatMapNullable(aDef, (d) => d.parent?.parent);
142
- const bDefParentParent = O.flatMapNullable(bDef, (d) => d.parent?.parent);
126
+ const aVarNode = getVariableNode(aVar, 0);
127
+ const bVarNode = getVariableNode(bVar, 0);
128
+ const aVarNodeParent = aVarNode?.parent;
129
+ const bVarNodeParent = bVarNode?.parent;
130
+ const aDef = aVar?.defs.at(0);
131
+ const bDef = bVar?.defs.at(0);
132
+ const aDefParentParent = aDef?.parent?.parent;
133
+ const bDefParentParent = bDef?.parent?.parent;
143
134
  switch (true) {
144
- case (O.exists(aVarNodeParent, AST3.is(AST_NODE_TYPES.CallExpression)) && O.exists(bVarNodeParent, AST3.is(AST_NODE_TYPES.CallExpression)) && O.exists(aVarNode, AST3.isFunction) && O.exists(bVarNode, AST3.isFunction)): {
145
- const hasSameCallee = F.pipe(
146
- O.Do,
147
- O.bind("aCallee", () => O.map(aVarNodeParent, (n) => n.callee)),
148
- O.bind("bCallee", () => O.map(bVarNodeParent, (n) => n.callee)),
149
- O.exists(({ aCallee, bCallee }) => AST3.isNodeEqual(aCallee, bCallee))
150
- );
151
- if (!hasSameCallee) {
135
+ case (aVarNodeParent?.type === AST_NODE_TYPES.CallExpression && bVarNodeParent?.type === AST_NODE_TYPES.CallExpression && AST3.isFunction(aVarNode) && AST3.isFunction(bVarNode)): {
136
+ if (!AST3.isNodeEqual(aVarNodeParent.callee, bVarNodeParent.callee)) {
152
137
  return false;
153
138
  }
154
- return F.pipe(
155
- O.Do,
156
- O.bind("aParams", () => O.map(aVarNode, (n) => n.params)),
157
- O.bind("bParams", () => O.map(bVarNode, (n) => n.params)),
158
- O.let("aPos", ({ aParams }) => aParams.findIndex(AST3.isNodeEqual(a))),
159
- O.let("bPos", ({ bParams }) => bParams.findIndex(AST3.isNodeEqual(b))),
160
- O.filter(({ aPos, bPos }) => aPos !== -1 && bPos !== -1),
161
- O.exists(({ aPos, bPos }) => aPos === bPos)
162
- );
139
+ const aParams = aVarNode.params;
140
+ const bParams = bVarNode.params;
141
+ const aPos = aParams.findIndex((x) => AST3.isNodeEqual(x, a));
142
+ const bPos = bParams.findIndex((x) => AST3.isNodeEqual(x, b));
143
+ return aPos !== -1 && bPos !== -1 && aPos === bPos;
163
144
  }
164
- case (O.exists(aDefParentParent, AST3.is(AST_NODE_TYPES.ForOfStatement)) && O.exists(bDefParentParent, AST3.is(AST_NODE_TYPES.ForOfStatement))): {
165
- return F.pipe(
166
- O.Do,
167
- O.bind("aLeft", () => O.map(aDefParentParent, (d) => d.left)),
168
- O.bind("bLeft", () => O.map(bDefParentParent, (d) => d.left)),
169
- O.filter(({ aLeft, bLeft }) => aLeft.type === bLeft.type),
170
- O.bind("aRight", () => O.map(aDefParentParent, (d) => d.right)),
171
- O.bind("bRight", () => O.map(bDefParentParent, (d) => d.right)),
172
- O.exists(({ aRight, bRight }) => AST3.isNodeEqual(aRight, bRight))
173
- );
145
+ case (aDefParentParent?.type === AST_NODE_TYPES.ForOfStatement && bDefParentParent?.type === AST_NODE_TYPES.ForOfStatement): {
146
+ const aLeft = aDefParentParent.left;
147
+ const bLeft = bDefParentParent.left;
148
+ if (aLeft.type !== bLeft.type) {
149
+ return false;
150
+ }
151
+ const aRight = aDefParentParent.right;
152
+ const bRight = bDefParentParent.right;
153
+ return AST3.isNodeEqual(aRight, bRight);
174
154
  }
175
155
  default: {
176
- return O.isSome(aVar) && O.isSome(bVar) && aVar.value === bVar.value;
156
+ return aVar !== _ && bVar !== _ && aVar === bVar;
177
157
  }
178
158
  }
179
159
  }
@@ -184,20 +164,14 @@ function isNodeValueEqual(a, b, initialScopes) {
184
164
  if (aScope.block === bScope.block) {
185
165
  return true;
186
166
  }
187
- return F.pipe(
188
- O.Do,
189
- O.bind("aFunction", () => AST3.findParentNode(a, AST3.isOneOf(thisBlockTypes))),
190
- O.bind("bFunction", () => AST3.findParentNode(b, AST3.isOneOf(thisBlockTypes))),
191
- O.exists(({ aFunction, bFunction }) => aFunction === bFunction)
192
- );
167
+ const aFunction = AST3.findParentNode(a, AST3.isOneOf(thisBlockTypes));
168
+ const bFunction = AST3.findParentNode(b, AST3.isOneOf(thisBlockTypes));
169
+ return aFunction === bFunction;
193
170
  }
194
171
  default: {
195
- return F.pipe(
196
- O.Do,
197
- O.bind("aStatic", () => getStaticValue2(a, aScope)),
198
- O.bind("bStatic", () => getStaticValue2(b, bScope)),
199
- O.exists(({ aStatic, bStatic }) => aStatic === bStatic)
200
- );
172
+ const aStatic = toResolved({ kind: "lazy", node: a, initialScope: aScope });
173
+ const bStatic = toResolved({ kind: "lazy", node: b, initialScope: bScope });
174
+ return aStatic.kind !== "none" && bStatic.kind !== "none" && aStatic.value === bStatic.value;
201
175
  }
202
176
  }
203
177
  }
@@ -206,6 +180,7 @@ var ValueConstructionHint = {
206
180
  StrictCallExpression: 1n << 0n
207
181
  };
208
182
  function getValueConstruction(node, initialScope, hint = ValueConstructionHint.None) {
183
+ if (node === _) return _;
209
184
  switch (node.type) {
210
185
  case AST_NODE_TYPES.JSXElement:
211
186
  case AST_NODE_TYPES.JSXFragment: {
@@ -231,65 +206,48 @@ function getValueConstruction(node, initialScope, hint = ValueConstructionHint.N
231
206
  if (hint & ValueConstructionHint.StrictCallExpression) {
232
207
  return { kind: "CallExpression", node };
233
208
  }
234
- return { kind: "None", node };
209
+ return _;
235
210
  }
236
211
  case AST_NODE_TYPES.MemberExpression: {
237
- if (!("object" in node)) {
238
- return { kind: "None", node };
239
- }
212
+ if (!("object" in node)) return _;
240
213
  return getValueConstruction(node.object, initialScope, hint);
241
214
  }
242
215
  case AST_NODE_TYPES.AssignmentExpression:
243
216
  case AST_NODE_TYPES.AssignmentPattern: {
244
- if (!("right" in node)) {
245
- return { kind: "None", node };
246
- }
217
+ if (!("right" in node)) return _;
247
218
  return getValueConstruction(node.right, initialScope, hint);
248
219
  }
249
220
  case AST_NODE_TYPES.LogicalExpression: {
250
221
  const lvc = getValueConstruction(node.left, initialScope, hint);
251
- if (lvc.kind !== "None") {
252
- return lvc;
253
- }
222
+ if (lvc === _) return _;
254
223
  return getValueConstruction(node.right, initialScope, hint);
255
224
  }
256
225
  case AST_NODE_TYPES.ConditionalExpression: {
257
226
  const cvc = getValueConstruction(node.consequent, initialScope, hint);
258
- if (cvc.kind !== "None") {
259
- return cvc;
260
- }
227
+ if (cvc === _) return _;
261
228
  return getValueConstruction(node.alternate, initialScope, hint);
262
229
  }
263
230
  case AST_NODE_TYPES.Identifier: {
264
- if (!("name" in node && isString(node.name))) {
265
- return { kind: "None", node };
266
- }
267
- const construction = F.pipe(
268
- O.fromNullable(initialScope.set.get(node.name)),
269
- O.flatMap(getVariableNode(-1)),
270
- O.map((node2) => getValueConstruction(node2, initialScope, hint)),
271
- O.filter((vc) => vc.kind !== "None")
272
- );
273
- if (O.isNone(construction)) {
274
- return { kind: "None", node };
231
+ if (!("name" in node && typeof node.name === "string")) {
232
+ return _;
275
233
  }
276
- return {
277
- ...construction.value
278
- };
234
+ const variable = initialScope.set.get(node.name);
235
+ const variableNode = getVariableNode(variable, -1);
236
+ return getValueConstruction(variableNode, initialScope, hint);
279
237
  }
280
238
  case AST_NODE_TYPES.Literal: {
281
239
  if ("regex" in node) {
282
240
  return { kind: "RegExpLiteral", node };
283
241
  }
284
- return { kind: "None", node };
242
+ return _;
285
243
  }
286
244
  default: {
287
- if (!("expression" in node && isObject(node.expression))) {
288
- return { kind: "None", node };
245
+ if (!("expression" in node && typeof node.expression === "object")) {
246
+ return _;
289
247
  }
290
248
  return getValueConstruction(node.expression, initialScope, hint);
291
249
  }
292
250
  }
293
251
  }
294
252
 
295
- export { ValueConstructionHint, findVariable2 as findVariable, getChidScopes, getScope, getStaticValue2 as getStaticValue, getValueConstruction, getVariableDeclaratorID, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual };
253
+ export { ValueConstructionHint, findVariable2 as findVariable, getChidScopes, getValueConstruction, getVariableDeclaratorId, getVariableNode, getVariables, isInitializedFromSource, isNodeValueEqual, toResolved };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@eslint-react/var",
3
- "version": "1.23.3-next.8",
3
+ "version": "1.24.0-next.0",
4
4
  "description": "ESLint React's TSESTree AST utility module for static analysis of variables",
5
- "homepage": "https://github.com/rEl1cx/eslint-react",
5
+ "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
7
- "url": "https://github.com/rEl1cx/eslint-react/issues"
7
+ "url": "https://github.com/Rel1cx/eslint-react/issues"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/rEl1cx/eslint-react.git",
11
+ "url": "git+https://github.com/Rel1cx/eslint-react.git",
12
12
  "directory": "packages/utilities/var"
13
13
  },
14
14
  "license": "MIT",
@@ -38,9 +38,9 @@
38
38
  "@typescript-eslint/utils": "^8.19.1",
39
39
  "string-ts": "^2.2.0",
40
40
  "ts-pattern": "^5.6.0",
41
- "@eslint-react/ast": "1.23.3-next.8",
42
- "@eslint-react/eff": "1.23.3-next.8",
43
- "@eslint-react/types": "1.23.3-next.8"
41
+ "@eslint-react/ast": "1.24.0-next.0",
42
+ "@eslint-react/types": "1.24.0-next.0",
43
+ "@eslint-react/eff": "1.24.0-next.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.3.5",