@eslint-react/var 5.2.3-beta.0 → 5.2.3-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +8 -8
  2. package/package.json +5 -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.identifier(node.callee, "Boolean"): return null;
131
- case Check.identifier(node.callee, "String"): return null;
132
- case Check.identifier(node.callee, "Number"): return null;
133
- case Check.identifier(node.callee, "Object"): return {
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.identifier(node.callee, "Array"): return {
137
+ case Check.isIdentifier("Array")(node.callee): return {
138
138
  kind: "array",
139
139
  node
140
140
  };
141
- case Check.identifier(node.callee, "RegExp"): return {
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 && Check.identifier(node.callee.object) && Check.identifier(node.callee.property)) {
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.literal(arg0, "string")) return null;
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-beta.0",
3
+ "version": "5.2.3-beta.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/ast": "5.2.3-beta.0",
38
- "@eslint-react/eslint": "5.2.3-beta.0",
39
- "@eslint-react/shared": "5.2.3-beta.0"
37
+ "@eslint-react/ast": "5.2.3-beta.2",
38
+ "@eslint-react/eslint": "5.2.3-beta.2",
39
+ "@eslint-react/shared": "5.2.3-beta.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@typescript-eslint/typescript-estree": "^8.58.2",
@@ -56,6 +56,7 @@
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown --dts-resolve",
59
+ "build:docs": "typedoc",
59
60
  "lint:publish": "publint",
60
61
  "lint:ts": "tsl"
61
62
  }