/** * ESLint lens for JavaScript/TypeScript linting */ import { BaseLens } from '../base/BaseLens.js'; import { LensResult, ExecuteResult } from '../../types/index.js'; /** * ESLint message format */ interface ESLintMessage { ruleId: string | null; severity: 0 | 1 | 2; message: string; line: number; column: number; nodeType?: string; messageId?: string; endLine?: number; endColumn?: number; fix?: { range: [number, number]; text: string; }; suggestions?: Array<{ messageId: string; desc: string; fix: { range: [number, number]; text: string; }; }>; } /** * ESLint file result format */ interface ESLintFileResult { filePath: string; messages: ESLintMessage[]; suppressedMessages: ESLintMessage[]; errorCount: number; fatalErrorCount: number; warningCount: number; fixableErrorCount: number; fixableWarningCount: number; source?: string; usedDeprecatedRules?: Array<{ ruleId: string; replacedBy: string[]; }>; } /** * ESLint output format (array of file results) */ type ESLintOutput = ESLintFileResult[]; /** * Lens for ESLint code quality tool */ export declare class ESLintLens extends BaseLens { readonly name = "eslint"; readonly description = "JavaScript/TypeScript linter"; readonly languages: string[]; readonly supportedTools: string[]; readonly requirements: import("../..").LensRequirements; private pathMapper?; /** * Calculate quality score (0-100) from ESLint results * * Scoring algorithm: * - Start at 100 * - Subtract penalty based on issues per file analyzed * - Errors: 10 points per error per file * - Warnings: 2 points per warning per file * - Info: 0.5 points per info per file * - Floor at 0 * * Examples: * - 0 issues = 100 * - 1 error in 10 files = 99 (0.1 errors/file × 10 = 1 point) * - 5 errors in 10 files = 95 (0.5 errors/file × 10 = 5 points) * - 10 errors in 1 file = 0 (10 errors/file × 10 = 100 points) */ static calculateQualityScore(result: LensResult): number; /** * Parse ESLint JSON output */ parse(output: ExecuteResult): ESLintOutput; /** * Format ESLint results to standard format */ format(parsed: ESLintOutput): LensResult; /** * Map ESLint severity to standard severity */ private mapESLintSeverity; /** * Categorize ESLint rules */ private categorizeRule; /** * Get or create path mapper */ private getPathMapper; /** * Override execute to ensure JSON format */ execute(): Promise; } export {}; //# sourceMappingURL=ESLintLens.d.ts.map