@eslint-react/var 1.23.3-next.4 → 1.23.3-next.6

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 CHANGED
@@ -41,10 +41,10 @@ function getScope(node, scopeManager) {
41
41
  const { type, parent } = node;
42
42
  const inner = type !== types.AST_NODE_TYPES.Program;
43
43
  const scope = scopeManager.acquire(node, inner);
44
- if (scope) {
44
+ if (scope != null) {
45
45
  return scope;
46
46
  }
47
- if (parent) {
47
+ if (parent != null) {
48
48
  return getScope(parent, scopeManager);
49
49
  }
50
50
  return null;
@@ -80,7 +80,7 @@ function getVariableNode(at) {
80
80
  return def.node;
81
81
  case (def.type === scopeManager.DefinitionType.Parameter && AST3__namespace.isFunction(def.node)):
82
82
  return def.node;
83
- case ("init" in def.node && def.node.init && !("declarations" in def.node.init)):
83
+ case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
84
84
  return def.node.init;
85
85
  default:
86
86
  return null;
@@ -104,7 +104,7 @@ function isInitializedFromSource(name, source, initialScope) {
104
104
  return false;
105
105
  }
106
106
  const { node, parent } = latestDef.value;
107
- if (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init) {
107
+ if (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init != null) {
108
108
  const { init } = node;
109
109
  if (init.type === types.AST_NODE_TYPES.MemberExpression && init.object.type === types.AST_NODE_TYPES.Identifier) {
110
110
  return isInitializedFromSource(init.object.name, source, initialScope);
package/dist/index.mjs CHANGED
@@ -18,10 +18,10 @@ function getScope(node, scopeManager) {
18
18
  const { type, parent } = node;
19
19
  const inner = type !== AST_NODE_TYPES.Program;
20
20
  const scope = scopeManager.acquire(node, inner);
21
- if (scope) {
21
+ if (scope != null) {
22
22
  return scope;
23
23
  }
24
- if (parent) {
24
+ if (parent != null) {
25
25
  return getScope(parent, scopeManager);
26
26
  }
27
27
  return null;
@@ -57,7 +57,7 @@ function getVariableNode(at) {
57
57
  return def.node;
58
58
  case (def.type === DefinitionType.Parameter && AST3.isFunction(def.node)):
59
59
  return def.node;
60
- case ("init" in def.node && def.node.init && !("declarations" in def.node.init)):
60
+ case ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)):
61
61
  return def.node.init;
62
62
  default:
63
63
  return null;
@@ -81,7 +81,7 @@ function isInitializedFromSource(name, source, initialScope) {
81
81
  return false;
82
82
  }
83
83
  const { node, parent } = latestDef.value;
84
- if (node.type === AST_NODE_TYPES.VariableDeclarator && node.init) {
84
+ if (node.type === AST_NODE_TYPES.VariableDeclarator && node.init != null) {
85
85
  const { init } = node;
86
86
  if (init.type === AST_NODE_TYPES.MemberExpression && init.object.type === AST_NODE_TYPES.Identifier) {
87
87
  return isInitializedFromSource(init.object.name, source, initialScope);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/var",
3
- "version": "1.23.3-next.4",
3
+ "version": "1.23.3-next.6",
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": {
@@ -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.4",
42
- "@eslint-react/types": "1.23.3-next.4",
43
- "@eslint-react/eff": "1.23.3-next.4"
41
+ "@eslint-react/ast": "1.23.3-next.6",
42
+ "@eslint-react/eff": "1.23.3-next.6",
43
+ "@eslint-react/types": "1.23.3-next.6"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.3.5",