@invisiblecities/sidequest-cqo
Version:
Configuration-agnostic TypeScript and ESLint orchestrator with real-time watch mode, SQLite persistence, and intelligent terminal detection
54 lines • 1.97 kB
TypeScript
/**
* @fileoverview Zod Detection Engine
*
* Detects Zod usage patterns and anti-patterns:
* - Unused schemas (defined but never parsed)
* - Over-validation (validating internal type-safe data)
* - Missing validation (external APIs without schemas)
*/
import { BaseAuditEngine } from "./base-engine.js";
import type { Violation, EngineConfig } from "../utils/violation-types.js";
export declare class ZodDetectionEngine extends BaseAuditEngine {
constructor(config?: Partial<EngineConfig>);
/**
* Filter out non-Zod .parse() calls (JSON.parse, parseInt, etc.)
*/
private isNonZodParse;
analyze(targetPath: string, _options?: Record<string, unknown>): Promise<Violation[]>;
private hasZodDependency;
private analyzeZodUsage;
private findUnusedSchemas;
private findOverValidations;
private findMissingValidations;
/**
* Calculate runtime validation coverage metrics
*/
private calculateValidationCoverage;
/**
* Type guard to check if coverage object has the expected structure
*/
private isValidCoverage;
/**
* Generate coverage-based suggestions and violations
*/
private generateCoverageSuggestions;
/**
* Assess risk level based on coverage and usage patterns
*/
private assessRiskLevel;
/**
* Get baseline recommendation based on project characteristics
*/
private getBaselineRecommendation;
/**
* Check if baseDir contains files matching a pattern
*/
private hasPattern;
protected categorizeViolation(_message: string, _category?: string, _rule?: string, code?: string): string | undefined;
protected generateFixSuggestion(_message: string, _category?: string, _rule?: string, code?: string): string | undefined;
/**
* Check if this appears to be validating external/untrusted data
*/
private isLikelyExternalDataValidation;
}
//# sourceMappingURL=zod-detection-engine.d.ts.map