UNPKG

@regele/devtools

Version:

A collection of developer utilities for code processing and text analysis

52 lines (51 loc) 1.3 kB
import { CodeAnalysisResult, CodeAnalysisOptions } from './types'; /** * Code analyzer class */ export declare class CodeAnalyzer { private options; private rules; /** * Create a new CodeAnalyzer instance * * @param options - Analysis options */ constructor(options?: CodeAnalysisOptions); /** * Analyze a single file * * @param filePath - Path to the file * @returns Analysis result */ analyzeFile(filePath: string): Promise<CodeAnalysisResult>; /** * Analyze multiple files * * @param patterns - Glob patterns to match files * @returns Analysis results */ analyzeFiles(patterns: string | string[]): Promise<CodeAnalysisResult[]>; /** * Find files matching the patterns * * @param patterns - Glob patterns * @returns Array of file paths */ private findFiles; /** * Parse code into an AST * * @param content - Code content * @param fileType - File type * @returns AST or null if parsing fails */ private parseCode; /** * Compare severity levels * * @param a - First severity level * @param b - Second severity level * @returns Comparison result (-1, 0, 1) */ private compareSeverity; }