/** * Documentation Linter * * Comprehensive documentation quality checks including: * - Style and formatting validation * - Link validation * - Code example validation * - API documentation completeness * - Documentation freshness checks */ /** * Simple glob replacement using fs.readdir * Supports basic patterns but not full glob syntax */ export interface CodeExampleValidation { code: string; errors: string[]; language: string; lineEnd: number; lineStart: number; warnings: string[]; } export interface DocumentationRule { message: string; name: string; pattern: RegExp; severity: 'error' | 'info' | 'warning'; suggestion?: string; } export interface DocumentationStats { errors: number; info: number; totalCodeBlocks: number; totalFiles: number; totalLines: number; totalLinks: number; warnings: number; } export interface LintOptions { checkApiCompleteness?: boolean; checkCodeExamples?: boolean; checkFreshness?: boolean; checkLinks?: boolean; customRules?: DocumentationRule[]; excludePatterns?: string[]; includePatterns?: string[]; maxFileSize?: number; } export interface LintResult { column?: number; file: string; line?: number; message: string; rule: string; severity: 'error' | 'info' | 'warning'; suggestion?: string; } /** * Documentation Linter Class * * Provides comprehensive documentation quality validation */ export declare class DocumentationLinter { private customRules; private logger; private options; constructor(options?: LintOptions); /** * Lint all documentation files */ lintAll(): Promise<{ codeValidation: CodeExampleValidation[]; results: LintResult[]; stats: DocumentationStats; }>; /** * Lint a single documentation file */ lintFile(filePath: string): Promise<{ codeBlocks: number; codeValidation: CodeExampleValidation[]; lines: number; links: number; results: LintResult[]; }>; /** * Find all documentation files */ private findDocumentationFiles; /** * Check content against linting rules */ private checkContentRules; /** * Check if link text is empty */ private checkEmptyLinkText; /** * Check if URL is a relative link */ private isRelativeLink; /** * Check for broken relative link */ private checkBrokenRelativeLink; /** * Check links for validity */ private checkLinks; /** * Language validator mapping using object literal lookup */ private readonly languageValidators; /** * Get validation errors for a specific language */ private getLanguageValidationErrors; /** * Get general warnings for code blocks */ private getCodeWarnings; /** * Validate code examples in documentation */ private validateCodeExamples; /** * Check API documentation completeness */ private checkApiCompleteness; /** * Check documentation freshness */ private checkFreshness; /** * Validate TypeScript code examples */ private validateTypeScript; /** * Validate JavaScript code examples */ private validateJavaScript; /** * Validate JSON code examples */ private validateJSON; /** * Validate Bash code examples */ private validateBash; /** * Check if file is API documentation */ private isApiDocumentation; /** * Get linting statistics */ getStats(results: LintResult[]): { filesWithErrors: number; filesWithWarnings: number; totalErrors: number; totalFiles: number; totalInfo: number; totalWarnings: number; }; } /** * Get the global documentation linter instance */ export declare function getDocumentationLinter(options?: LintOptions): DocumentationLinter; /** * Convenience function to lint all documentation */ export declare function lintDocumentation(options?: LintOptions): Promise<{ codeValidation: CodeExampleValidation[]; results: LintResult[]; stats: DocumentationStats; }>; //# sourceMappingURL=docs-linter.d.ts.map