Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@eslint-react/var

Package Overview
Dependencies
Maintainers
1
Versions
2309
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eslint-react/var - npm Package Compare versions

Comparing version
3.0.0-beta.67
to
3.0.0-beta.68
+8
-19
dist/index.js

@@ -185,19 +185,8 @@ import { DefinitionType } from "@typescript-eslint/scope-manager";

case a.type === AST_NODE_TYPES.Identifier && b.type === AST_NODE_TYPES.Identifier: {
const aDefNode = resolve(context, a);
const bDefNode = resolve(context, b);
const aDefNodeParent = aDefNode?.parent;
const bDefNodeParent = bDefNode?.parent;
const aVar = findVariable(aScope, a);
const bVar = findVariable(bScope, b);
const resolve = (variable) => {
if (variable == null) return null;
const def = variable.defs.at(0);
if (def != null) switch (true) {
case def.type === DefinitionType.FunctionName && def.node.type === AST_NODE_TYPES.FunctionDeclaration: return def.node;
case def.type === DefinitionType.ClassName && def.node.type === AST_NODE_TYPES.ClassDeclaration: return def.node;
case "init" in def.node && def.node.init != null && !("declarations" in def.node.init): return def.node.init;
}
if (def?.type === DefinitionType.Parameter && ast.isFunction(def.node)) return def.node;
return null;
};
const aVarInit = resolve(aVar);
const bVarInit = resolve(bVar);
const aVarInitParent = aVarInit?.parent;
const bVarInitParent = bVarInit?.parent;
const aDef = aVar?.defs.at(0);

@@ -208,6 +197,6 @@ const bDef = bVar?.defs.at(0);

switch (true) {
case aVarInitParent?.type === AST_NODE_TYPES.CallExpression && bVarInitParent?.type === AST_NODE_TYPES.CallExpression && ast.isFunction(aVarInit) && ast.isFunction(bVarInit): {
if (!ast.isNodeEqual(aVarInitParent.callee, bVarInitParent.callee)) return false;
const aParams = aVarInit.params;
const bParams = bVarInit.params;
case aDefNodeParent?.type === AST_NODE_TYPES.CallExpression && bDefNodeParent?.type === AST_NODE_TYPES.CallExpression && ast.isFunction(aDefNode) && ast.isFunction(bDefNode): {
if (!ast.isNodeEqual(aDefNodeParent.callee, bDefNodeParent.callee)) return false;
const aParams = aDefNode.params;
const bParams = bDefNode.params;
const aPos = aParams.findIndex((x) => ast.isNodeEqual(x, a));

@@ -214,0 +203,0 @@ const bPos = bParams.findIndex((x) => ast.isNodeEqual(x, b));

{
"name": "@eslint-react/var",
"version": "3.0.0-beta.67",
"version": "3.0.0-beta.68",
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",

@@ -37,5 +37,5 @@ "homepage": "https://github.com/Rel1cx/eslint-react",

"ts-pattern": "^5.9.0",
"@eslint-react/ast": "3.0.0-beta.67",
"@eslint-react/shared": "3.0.0-beta.67",
"@eslint-react/eff": "3.0.0-beta.67"
"@eslint-react/ast": "3.0.0-beta.68",
"@eslint-react/shared": "3.0.0-beta.68",
"@eslint-react/eff": "3.0.0-beta.68"
},

@@ -42,0 +42,0 @@ "devDependencies": {