@eslint-react/var 3.0.0-next.61 → 3.0.0-next.62
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.js +9 -9
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -85,15 +85,6 @@ function getObjectType(node, initialScope) {
|
|
|
85
85
|
};
|
|
86
86
|
return unit;
|
|
87
87
|
case AST_NODE_TYPES.Identifier: {
|
|
88
|
-
function resolve(v) {
|
|
89
|
-
if (v == null) return unit;
|
|
90
|
-
const def = v.defs.at(-1);
|
|
91
|
-
if (def == null) return unit;
|
|
92
|
-
if (def.type === DefinitionType.Variable) return def.node.init;
|
|
93
|
-
if (def.type === DefinitionType.Parameter) return unit;
|
|
94
|
-
if (def.type === DefinitionType.ImportBinding) return unit;
|
|
95
|
-
return def.node;
|
|
96
|
-
}
|
|
97
88
|
const initNode = resolve(initialScope.set.get(node.name));
|
|
98
89
|
if (initNode == null) return unit;
|
|
99
90
|
return getObjectType(initNode, initialScope);
|
|
@@ -120,6 +111,15 @@ function getObjectType(node, initialScope) {
|
|
|
120
111
|
return getObjectType(node.expression, initialScope);
|
|
121
112
|
}
|
|
122
113
|
}
|
|
114
|
+
function resolve(v) {
|
|
115
|
+
if (v == null) return unit;
|
|
116
|
+
const def = v.defs.at(-1);
|
|
117
|
+
if (def == null) return unit;
|
|
118
|
+
if (def.type === DefinitionType.Variable) return def.node.init;
|
|
119
|
+
if (def.type === DefinitionType.Parameter) return unit;
|
|
120
|
+
if (def.type === DefinitionType.ImportBinding) return unit;
|
|
121
|
+
return def.node;
|
|
122
|
+
}
|
|
123
123
|
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region src/is-value-equal.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/var",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.62",
|
|
4
4
|
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"@typescript-eslint/types": "canary",
|
|
35
35
|
"@typescript-eslint/utils": "canary",
|
|
36
36
|
"ts-pattern": "^5.9.0",
|
|
37
|
-
"@eslint-react/
|
|
38
|
-
"@eslint-react/eff": "3.0.0-next.
|
|
39
|
-
"@eslint-react/
|
|
37
|
+
"@eslint-react/ast": "3.0.0-next.62",
|
|
38
|
+
"@eslint-react/eff": "3.0.0-next.62",
|
|
39
|
+
"@eslint-react/shared": "3.0.0-next.62"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"tsdown": "^0.21.0-beta.2",
|