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/ast

Package Overview
Dependencies
Maintainers
1
Versions
2358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eslint-react/ast - npm Package Compare versions

Comparing version
3.0.0-next.63
to
3.0.0-next.64
+18
-19
dist/index.d.ts

@@ -1,2 +0,1 @@

import { unit } from "@eslint-react/eff";
import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";

@@ -76,5 +75,5 @@ import { TSESTree as TSESTree$1 } from "@typescript-eslint/utils";

* @param node The class node to get the identifier from
* @returns The class identifier or unit if not found
* @returns The class identifier or null if not found
*/
declare function getClassId(node: TSESTreeClass): TSESTree.BindingName | unit;
declare function getClassId(node: TSESTreeClass): TSESTree.BindingName | null;
//#endregion

@@ -195,3 +194,3 @@ //#region src/directive-is.d.ts

*/
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | undefined;
declare function getFunctionId(node: TSESTree.Expression | TSESTreeFunction): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.PrivateInExpression | TSESTree.SymmetricBinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpressionBitwiseNot | TSESTree.UnaryExpressionDelete | TSESTree.UnaryExpressionMinus | TSESTree.UnaryExpressionNot | TSESTree.UnaryExpressionPlus | TSESTree.UnaryExpressionTypeof | TSESTree.UnaryExpressionVoid | TSESTree.UpdateExpression | TSESTree.YieldExpression | null;
/**

@@ -213,5 +212,5 @@ * Type representing the return type of getFunctionId

* @param node The function node to analyze
* @returns The function initialization path or unit if not identifiable
* @returns The function initialization path or null if not identifiable
*/
declare function getFunctionInitPath(node: TSESTreeFunction): unit | FunctionInitPath;
declare function getFunctionInitPath(node: TSESTreeFunction): null | FunctionInitPath;
/**

@@ -248,3 +247,3 @@ * Check if a specific function call exists in the function initialization path.

*/
declare function isIdentifier(node: TSESTree.Node | null | unit, name?: string): node is TSESTree.Identifier;
declare function isIdentifier(node: TSESTree.Node | null, name?: string): node is TSESTree.Identifier;
//#endregion

@@ -451,7 +450,7 @@ //#region src/identifier-name.d.ts

* @param test The test function
* @returns The parent node that satisfies the test function or `_` if not found
* @returns The parent node that satisfies the test function or `null` if not found
*/
declare function findParentNode<A extends TSESTree.Node>(node: TSESTree.Node | unit, test: (n: TSESTree.Node) => n is A): A | unit;
declare function findParentNode<A extends TSESTree.Node>(node: TSESTree.Node | null, test: (n: TSESTree.Node) => n is A): A | null;
/**
* Find the parent node that satisfies the test function or `_` if not found
* Find the parent node that satisfies the test function or `null` if not found
* @param node The AST node

@@ -461,3 +460,3 @@ * @param test The test function

*/
declare function findParentNode(node: TSESTree.Node | unit, test: (node: TSESTree.Node) => boolean): TSESTree.Node | unit;
declare function findParentNode(node: TSESTree.Node | null, test: (node: TSESTree.Node) => boolean): TSESTree.Node | null;
//#endregion

@@ -479,3 +478,3 @@ //#region src/node-unwrap.d.ts

*/
declare function isProcessEnvNodeEnv(node: TSESTree.Node | null | unit): node is TSESTree.MemberExpression;
declare function isProcessEnvNodeEnv(node: TSESTree.Node | null): node is TSESTree.MemberExpression;
/**

@@ -488,3 +487,3 @@ * Check if the given node is a binary expression that compares `process.env.NODE_ENV` with a string literal.

*/
declare function isProcessEnvNodeEnvCompare(node: TSESTree.Node | null | unit, operator: "===" | "!==", value: "development" | "production"): node is TSESTree.BinaryExpression;
declare function isProcessEnvNodeEnvCompare(node: TSESTree.Node | null, operator: "===" | "!==", value: "development" | "production"): node is TSESTree.BinaryExpression;
//#endregion

@@ -498,3 +497,3 @@ //#region src/pattern-vitest-mock.d.ts

*/
declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.MemberExpression;
declare function isViMock(node: TSESTree.Node | null): node is TSESTree.MemberExpression;
/**

@@ -506,3 +505,3 @@ * Check if the given node is a `vi.mock` callback.

*/
declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
declare function isViMockCallback(node: TSESTree.Node | null): boolean;
//#endregion

@@ -514,5 +513,5 @@ //#region src/property-name.d.ts

* @param node The node to get the property name from
* @returns The property name or unit if not determinable
* @returns The property name or null if not determinable
*/
declare function getPropertyName(node: TSESTree.Node): string | unit;
declare function getPropertyName(node: TSESTree.Node): string | null;
//#endregion

@@ -524,6 +523,6 @@ //#region src/property-traverse.d.ts

* @param name The name of the property to find
* @returns The matching property node, or undefined if not found
* @returns The matching property node, or null if not found
*/
declare function findProperty(properties: TSESTree.ObjectLiteralElement[], name: string): TSESTree.Property | unit;
declare function findProperty(properties: TSESTree.ObjectLiteralElement[], name: string): TSESTree.Property | null;
//#endregion
export { DirectiveKind, DisplayNameAssignmentExpression, FunctionID, FunctionInitPath, ImplicitReturnArrowFunctionExpression, ObjectDestructuringVariableDeclarator, SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, TSESTreeArrayTupleType, TSESTreeClass, TSESTreeDestructuringPattern, TSESTreeDirective, TSESTreeDirectiveLike, TSESTreeFunction, TSESTreeFunctionType, TSESTreeJSX, TSESTreeJSXAttributeLike, TSESTreeLoop, TSESTreeMethodOrProperty, TSESTreeProperty, TSESTreeTypeAssertionExpression, TSESTreeTypeDeclaration, TSESTreeTypeExpression, findParentNode, findProperty, getClassId, getFileDirectives, getFullyQualifiedName, getFunctionDirectives, getFunctionId, getFunctionInitPath, getHumanReadableKind, getNestedCallExpressions, getNestedExpressionsOfType, getNestedIdentifiers, getNestedNewExpressions, getNestedReturnStatements, getPropertyName, getRootIdentifier, getUnderlyingExpression, hasCallInFunctionInitPath, is, isClass, isConditional, isControlFlow, isDirective, isDirectiveInFile, isDirectiveInFunction, isDirectiveKind, isDirectiveLike, isDirectiveName, isFunction, isFunctionEmpty, isFunctionImmediatelyInvoked, isFunctionType, isIdentifier, isIdentifierName, isJSX, isJSXElement, isJSXFragment, isJSXTagNameExpression, isLineBreak, isLiteral, isLoop, isMethodOrProperty, isMultiLine, isNodeEqual, isOneOf, isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isProperty, isThisExpressionLoose, isTypeAssertionExpression, isTypeExpression, isViMock, isViMockCallback };

@@ -1,3 +0,3 @@

import { dual, or, unit } from "@eslint-react/eff";
import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/types";
import { dual, or } from "@eslint-react/eff";
import { ASTUtils } from "@typescript-eslint/utils";

@@ -11,3 +11,3 @@ import { simpleTraverse } from "@typescript-eslint/typescript-estree";

* @param node The class node to get the identifier from
* @returns The class identifier or unit if not found
* @returns The class identifier or null if not found
*/

@@ -17,3 +17,3 @@ function getClassId(node) {

if (node.parent.type === AST_NODE_TYPES.VariableDeclarator) return node.parent.id;
return unit;
return null;
}

@@ -260,3 +260,3 @@

function findParentNode(node, test) {
if (node == null) return unit;
if (node == null) return null;
let parent = node.parent;

@@ -267,3 +267,3 @@ while (parent != null && parent.type !== AST_NODE_TYPES.Program) {

}
return unit;
return null;
}

@@ -525,3 +525,3 @@

}
return unit;
return null;
}

@@ -536,3 +536,3 @@

* @param node The function node to analyze
* @returns The function initialization path or unit if not identifiable
* @returns The function initialization path or null if not identifiable
*/

@@ -581,3 +581,3 @@ function getFunctionInitPath(node) {

}
return unit;
return null;
}

@@ -816,3 +816,3 @@ /**

* @param node The node to get the property name from
* @returns The property name or unit if not determinable
* @returns The property name or null if not determinable
*/

@@ -823,4 +823,4 @@ function getPropertyName(node) {

if (node.type === AST_NODE_TYPES.Literal) return String(node.value);
if (node.type === AST_NODE_TYPES.TemplateLiteral && node.expressions.length === 0) return node.quasis[0]?.value.raw;
return unit;
if (node.type === AST_NODE_TYPES.TemplateLiteral && node.expressions.length === 0) return node.quasis[0]?.value.raw ?? null;
return null;
}

@@ -834,3 +834,3 @@

* @param name The name of the property to find
* @returns The matching property node, or undefined if not found
* @returns The matching property node, or null if not found
*/

@@ -845,3 +845,3 @@ function findProperty(properties, name) {

}
return unit;
return null;
}

@@ -848,0 +848,0 @@

{
"name": "@eslint-react/ast",
"version": "3.0.0-next.63",
"version": "3.0.0-next.64",
"description": "ESLint React's TSESTree AST utility module.",

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

"string-ts": "^2.3.1",
"@eslint-react/eff": "3.0.0-next.63"
"@eslint-react/eff": "3.0.0-next.64"
},

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