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

48 lines 1.66 kB
import { ValueObject } from "./ValueObject"; interface DependencyViolationProps { readonly fromLayer: string; readonly toLayer: string; readonly importPath: string; readonly filePath: string; readonly line?: number; } /** * Represents a dependency direction violation in the codebase * * Dependency direction violations occur when a layer imports from a layer * that it should not depend on according to Clean Architecture principles: * - Domain → should not import from Application or Infrastructure * - Application → should not import from Infrastructure * - Infrastructure → can import from Application and Domain (allowed) * - Shared → can be imported by all layers (allowed) * * @example * ```typescript * // Bad: Domain importing from Application * const violation = DependencyViolation.create( * 'domain', * 'application', * '../../application/dtos/UserDto', * 'src/domain/entities/User.ts', * 5 * ) * * console.log(violation.getMessage()) * // "Domain layer should not import from Application layer" * ``` */ export declare class DependencyViolation extends ValueObject<DependencyViolationProps> { private constructor(); static create(fromLayer: string, toLayer: string, importPath: string, filePath: string, line?: number): DependencyViolation; get fromLayer(): string; get toLayer(): string; get importPath(): string; get filePath(): string; get line(): number | undefined; getMessage(): string; getSuggestion(): string; getExampleFix(): string; private capitalizeFirst; } export {}; //# sourceMappingURL=DependencyViolation.d.ts.map