/** * Prettier lens for code formatting */ import { BaseLens } from '../base/BaseLens.js'; import { LensResult, ExecuteResult } from '../../types/index.js'; /** * Prettier check output format * Prettier --check outputs file paths that need formatting to stdout * and a summary message */ interface PrettierParsedOutput { filesNeedingFormatting: string[]; filesChecked: number; /** All file paths that Prettier analyzed (from debug output) */ analyzedFilePaths: string[]; } /** * Lens for Prettier code formatter */ export declare class PrettierLens extends BaseLens { readonly name = "prettier"; readonly description = "Code formatter"; readonly languages: string[]; readonly supportedTools: string[]; readonly requirements: import("../..").LensRequirements; private pathMapper?; /** * Calculate quality score (0-100) from Prettier results * * Scoring algorithm: * - Start at 100 * - Subtract penalty based on percentage of files needing formatting * - Formula: 100 - (filesNeedingFormatting / filesChecked * 100) * - Floor at 0 * * Examples: * - 0 files need formatting = 100 * - 1 out of 10 files = 90 * - 5 out of 10 files = 50 * - All files need formatting = 0 */ static calculateQualityScore(result: LensResult): number; /** * Parse Prettier check output * * Prettier --check outputs: * - Files that need formatting to stdout (one per line) * - Exit code 1 if formatting needed, 0 if all files formatted * - May output "Checking formatting..." or "All matched files..." messages * * With --log-level debug, Prettier outputs: * - "[debug] resolve config from " for every file it checks * - This allows us to count total files checked, not just failing ones */ parse(output: ExecuteResult): PrettierParsedOutput; /** * Format Prettier results to standard format */ format(parsed: PrettierParsedOutput): LensResult; /** * Get or create path mapper */ private getPathMapper; /** * Prepare command for execution by adding required flags * Adds both --log-level (Prettier 3.x) and --loglevel (Prettier 2.x) for compatibility */ prepareCommand(command: string): string; /** * Override execute to ensure check mode and debug output for file counting */ execute(): Promise; } export {}; //# sourceMappingURL=PrettierLens.d.ts.map