@eslint-react/var 5.2.3-next.1 → 5.2.3-next.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.
- package/dist/index.js +8 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -127,23 +127,23 @@ function computeObjectType(context, node) {
|
|
|
127
127
|
return computeObjectType(context, node.expressions[node.expressions.length - 1] ?? null);
|
|
128
128
|
case AST_NODE_TYPES.CallExpression:
|
|
129
129
|
switch (true) {
|
|
130
|
-
case Check.
|
|
131
|
-
case Check.
|
|
132
|
-
case Check.
|
|
133
|
-
case Check.
|
|
130
|
+
case Check.isIdentifier("Boolean")(node.callee): return null;
|
|
131
|
+
case Check.isIdentifier("String")(node.callee): return null;
|
|
132
|
+
case Check.isIdentifier("Number")(node.callee): return null;
|
|
133
|
+
case Check.isIdentifier("Object")(node.callee): return {
|
|
134
134
|
kind: "plain",
|
|
135
135
|
node
|
|
136
136
|
};
|
|
137
|
-
case Check.
|
|
137
|
+
case Check.isIdentifier("Array")(node.callee): return {
|
|
138
138
|
kind: "array",
|
|
139
139
|
node
|
|
140
140
|
};
|
|
141
|
-
case Check.
|
|
141
|
+
case Check.isIdentifier("RegExp")(node.callee): return {
|
|
142
142
|
kind: "regexp",
|
|
143
143
|
node
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
if (node.callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
146
|
+
if (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.object.type === AST_NODE_TYPES.Identifier && node.callee.property.type === AST_NODE_TYPES.Identifier) {
|
|
147
147
|
const objName = node.callee.object.name;
|
|
148
148
|
const methodName = node.callee.property.name;
|
|
149
149
|
switch (objName) {
|
|
@@ -436,7 +436,7 @@ function resolveImportSource(name, initialScope, visited = /* @__PURE__ */ new S
|
|
|
436
436
|
if (init.type === AST_NODE_TYPES.MemberExpression && init.object.type === AST_NODE_TYPES.Identifier) return resolveImportSource(init.object.name, initialScope, visited);
|
|
437
437
|
if (init.type === AST_NODE_TYPES.Identifier) return resolveImportSource(init.name, initialScope, visited);
|
|
438
438
|
const arg0 = getRequireExpressionArguments(init)?.[0];
|
|
439
|
-
if (arg0 == null || !Check.
|
|
439
|
+
if (arg0 == null || !Check.isLiteral("string")(arg0)) return null;
|
|
440
440
|
return arg0.value;
|
|
441
441
|
}
|
|
442
442
|
if (parent?.type === AST_NODE_TYPES.ImportDeclaration) return parent.source.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/var",
|
|
3
|
-
"version": "5.2.3-next.
|
|
3
|
+
"version": "5.2.3-next.2",
|
|
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": "^8.58.2",
|
|
35
35
|
"@typescript-eslint/utils": "^8.58.2",
|
|
36
36
|
"ts-pattern": "^5.9.0",
|
|
37
|
-
"@eslint-react/
|
|
38
|
-
"@eslint-react/
|
|
39
|
-
"@eslint-react/
|
|
37
|
+
"@eslint-react/shared": "5.2.3-next.2",
|
|
38
|
+
"@eslint-react/ast": "5.2.3-next.2",
|
|
39
|
+
"@eslint-react/eslint": "5.2.3-next.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@typescript-eslint/typescript-estree": "^8.58.2",
|