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

50 lines 1.51 kB
import { AggregatePathAnalyzer } from "./AggregatePathAnalyzer"; import { FolderRegistry } from "./FolderRegistry"; /** * Validates imports for aggregate boundary violations * * Checks if imports cross aggregate boundaries inappropriately * and ensures proper encapsulation in DDD architecture. */ export declare class ImportValidator { private readonly folderRegistry; private readonly pathAnalyzer; constructor(folderRegistry: FolderRegistry, pathAnalyzer: AggregatePathAnalyzer); /** * Checks if an import violates aggregate boundaries */ isViolation(importPath: string, currentAggregate: string): boolean; /** * Extracts all import paths from a line of code */ extractImports(line: string): string[]; /** * Normalizes an import path for consistent processing */ private normalizeImportPath; /** * Checks if import path is valid for analysis */ private isValidImportPath; /** * Checks if import is internal to the same bounded context */ private isInternalBoundedContextImport; /** * Checks if import is from an allowed folder */ private isAllowedImport; /** * Checks if import seems to be an entity */ private seemsLikeEntityImport; /** * Extracts ES6 imports from a line */ private extractEsImports; /** * Extracts CommonJS requires from a line */ private extractRequireImports; } //# sourceMappingURL=ImportValidator.d.ts.map