UNPKG

@samiyev/guardian

Version:

Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W

54 lines 1.74 kB
import Parser from "tree-sitter"; /** * AST context checker for analyzing node contexts * * Provides reusable methods to check if a node is in specific contexts * like exports, type declarations, function calls, etc. */ export declare class AstContextChecker { /** * Checks if node is in an exported constant with "as const" */ isInExportedConstant(node: Parser.SyntaxNode): boolean; /** * Helper to check if export statement contains "as const" */ private checkExportedConstant; /** * Checks if node is in a type context (union type, type alias, interface) */ isInTypeContext(node: Parser.SyntaxNode): boolean; /** * Checks if node is in an import statement or import() call */ isInImportStatement(node: Parser.SyntaxNode): boolean; /** * Checks if node is in a test description (test(), describe(), it()) */ isInTestDescription(node: Parser.SyntaxNode): boolean; /** * Checks if node is in a console.log or console.error call */ isInConsoleCall(node: Parser.SyntaxNode): boolean; /** * Checks if node is in a Symbol() call */ isInSymbolCall(node: Parser.SyntaxNode): boolean; /** * Checks if node is in a typeof check */ isInTypeofCheck(node: Parser.SyntaxNode): boolean; /** * Checks if parent is a call expression with specific function names */ isInCallExpression(parent: Parser.SyntaxNode, functionNames: string[]): boolean; /** * Gets context text around a node */ getNodeContext(node: Parser.SyntaxNode): string; /** * Finds a descendant node by type */ private findDescendant; } //# sourceMappingURL=AstContextChecker.d.ts.map