@eslint-react/var
Advanced tools
Comparing version 1.28.1-next.5 to 1.28.1-next.6
@@ -16,4 +16,2 @@ import { _ } from '@eslint-react/eff'; | ||
declare function getVariableId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.Identifier | TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.BinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.TemplateLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpression | TSESTree.UpdateExpression | TSESTree.YieldExpression | TSESTree.PrivateIdentifier | undefined; | ||
declare function getVariableNode(variable: Variable | _, at: number): _ | TSESTree.ClassDeclaration | TSESTree.ClassDeclarationWithName | TSESTree.ClassDeclarationWithOptionalName | TSESTree.Expression | TSESTree.FunctionDeclaration | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName; | ||
@@ -40,7 +38,2 @@ | ||
declare function isVariableIdEqual(a: TSESTree.Node, b: TSESTree.Node, initialScopes: [ | ||
aScope: Scope, | ||
bScope: Scope | ||
]): boolean; | ||
type LazyValue = { | ||
@@ -113,2 +106,2 @@ kind: "lazy"; | ||
export { type LazyValue, type ValueConstruction, ValueConstructionHint, findPropertyInProperties, findVariable, getChidScopes, getValueConstruction, getVariableDeclaratorId, getVariableId, getVariableNode, getVariables, isNodeValueEqual, isVariableIdEqual, toStaticValue }; | ||
export { type LazyValue, type ValueConstruction, ValueConstructionHint, findPropertyInProperties, findVariable, getChidScopes, getValueConstruction, getVariableDeclaratorId, getVariableNode, getVariables, isNodeValueEqual, toStaticValue }; |
@@ -113,16 +113,2 @@ 'use strict'; | ||
} | ||
function getVariableId(node, prev) { | ||
switch (true) { | ||
case (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init === prev): | ||
return node.id; | ||
case (node.type === types.AST_NODE_TYPES.AssignmentExpression && node.right === prev): | ||
return node.left; | ||
case (node.type === types.AST_NODE_TYPES.PropertyDefinition && node.value === prev): | ||
return node.key; | ||
case (node.type === types.AST_NODE_TYPES.BlockStatement || node.type === types.AST_NODE_TYPES.Program || node.parent === node): | ||
return eff._; | ||
default: | ||
return getVariableId(node.parent, node); | ||
} | ||
} | ||
function getVariables(initialScope) { | ||
@@ -220,5 +206,2 @@ let scope = initialScope; | ||
} | ||
function isVariableIdEqual(a, b, initialScopes) { | ||
return AST2__namespace.isNodeEqual(a, b) || isNodeValueEqual(a, b, initialScopes); | ||
} | ||
var ValueConstructionHint = { | ||
@@ -305,7 +288,5 @@ None: 0n, | ||
exports.getVariableDeclaratorId = getVariableDeclaratorId; | ||
exports.getVariableId = getVariableId; | ||
exports.getVariableNode = getVariableNode; | ||
exports.getVariables = getVariables; | ||
exports.isNodeValueEqual = isNodeValueEqual; | ||
exports.isVariableIdEqual = isVariableIdEqual; | ||
exports.toStaticValue = toStaticValue; |
{ | ||
"name": "@eslint-react/var", | ||
"version": "1.28.1-next.5", | ||
"version": "1.28.1-next.6", | ||
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.", | ||
@@ -43,4 +43,4 @@ "homepage": "https://github.com/Rel1cx/eslint-react", | ||
"ts-pattern": "^5.6.2", | ||
"@eslint-react/ast": "1.28.1-next.5", | ||
"@eslint-react/eff": "1.28.1-next.5" | ||
"@eslint-react/ast": "1.28.1-next.6", | ||
"@eslint-react/eff": "1.28.1-next.6" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31303
629
+ Added@eslint-react/ast@1.28.1-next.6(transitive)
+ Added@eslint-react/eff@1.28.1-next.6(transitive)
- Removed@eslint-react/ast@1.28.1-next.5(transitive)
- Removed@eslint-react/eff@1.28.1-next.5(transitive)