@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
47 lines • 2.17 kB
TypeScript
import { AnalyzeProjectRequest, AnalyzeProjectResponse } from "./application/use-cases/AnalyzeProject";
/**
* Analyzes a TypeScript/JavaScript project for code quality issues
*
* Detects hardcoded values (magic numbers and strings) and validates
* Clean Architecture layer dependencies.
*
* @param options - Configuration for the analysis
* @param options.rootDir - Root directory to analyze
* @param options.include - File patterns to include (optional)
* @param options.exclude - Directories to exclude (optional, defaults to node_modules, dist, build)
*
* @returns Analysis results including violations, metrics, and dependency graph
*
* @throws {Error} If analysis fails or project cannot be scanned
*
* @example
* ```typescript
* import { analyzeProject } from '@puaros/guardian'
*
* const result = await analyzeProject({
* rootDir: './src',
* exclude: ['node_modules', 'dist', 'test']
* })
*
* console.log(`Found ${result.hardcodeViolations.length} hardcoded values`)
* console.log(`Found ${result.violations.length} architecture violations`)
* console.log(`Analyzed ${result.metrics.totalFiles} files`)
* ```
*
* @example
* ```typescript
* // Check for hardcoded values only
* const result = await analyzeProject({ rootDir: './src' })
*
* result.hardcodeViolations.forEach(violation => {
* console.log(`${violation.file}:${violation.line}`)
* console.log(` Type: ${violation.type}`)
* console.log(` Value: ${violation.value}`)
* console.log(` Suggestion: ${violation.suggestion.constantName}`)
* console.log(` Location: ${violation.suggestion.location}`)
* })
* ```
*/
export declare function analyzeProject(options: AnalyzeProjectRequest): Promise<AnalyzeProjectResponse>;
export type { AnalyzeProjectRequest, AnalyzeProjectResponse, ArchitectureViolation, HardcodeViolation, CircularDependencyViolation, NamingConventionViolation, FrameworkLeakViolation, EntityExposureViolation, DependencyDirectionViolation, RepositoryPatternViolation, AggregateBoundaryViolation, AnemicModelViolation, ProjectMetrics, } from "./application/use-cases/AnalyzeProject";
//# sourceMappingURL=api.d.ts.map