@felixgeelhaar/cclint
Version:
A comprehensive linter for CLAUDE.md files with multi-language code block validation
70 lines • 2.28 kB
TypeScript
import { ContextFile } from '../domain/ContextFile.js';
import { CodeBlock } from '../domain/CodeBlock.js';
/**
* Extracts code blocks from markdown files
*/
export declare class CodeBlockExtractor {
/**
* Extract all code blocks from a ContextFile
* @param file The file to extract code blocks from
* @returns Array of CodeBlock instances
*/
extractCodeBlocks(file: ContextFile): CodeBlock[];
/**
* Parse the start of a code block
* @param line The line to parse
* @returns Language and indent information if this is a code block start
*/
private parseCodeBlockStart;
/**
* Check if a line ends a code block
* @param line The line to check
* @param expectedIndent The expected indentation level
* @returns True if this ends a code block
*/
private isCodeBlockEnd;
/**
* Get context for a code block from surrounding text
* @param lines All lines in the file
* @param codeBlockIndex Index where the code block starts
* @returns Context string
*/
private getContext;
/**
* Extract a description from context
* @param context The context string
* @returns A clean description
*/
private extractDescription;
/**
* Extract code blocks of a specific language
* @param file The file to extract from
* @param language The language to filter by
* @returns Array of CodeBlock instances for the specified language
*/
extractCodeBlocksByLanguage(file: ContextFile, language: string): CodeBlock[];
/**
* Normalize language identifier
* @param language The language string to normalize
* @returns Normalized language identifier
*/
private normalizeLanguage;
/**
* Get statistics about code blocks in a file
* @param file The file to analyze
* @returns Statistics object
*/
getCodeBlockStats(file: ContextFile): CodeBlockStats;
}
/**
* Statistics about code blocks in a file
*/
export interface CodeBlockStats {
totalBlocks: number;
totalLines: number;
completeBlocks: number;
blocksWithImports: number;
languageCounts: Record<string, number>;
averageLinesPerBlock: number;
}
//# sourceMappingURL=CodeBlockExtractor.d.ts.map