(tsOutput: string, filesToShow: string[])
| 150 | |
| 151 | // Parse TypeScript errors and filter by file paths |
| 152 | function parseAndFilterTSErrors(tsOutput: string, filesToShow: string[]): { filteredErrors: string[], totalErrors: number, filteredCount: number } { |
| 153 | if (!tsOutput.trim()) { |
| 154 | return { filteredErrors: [], totalErrors: 0, filteredCount: 0 }; |
| 155 | } |
| 156 | |
| 157 | const lines = tsOutput.split('\n'); |
| 158 | const errors: string[] = []; |
| 159 | const filteredErrors: string[] = []; |
| 160 | |
| 161 | for (const line of lines) { |
| 162 | if (line.includes(': error TS')) { |
| 163 | errors.push(line); |
| 164 | |
| 165 | // Check if this error is in one of the files we care about |
| 166 | const matchesFile = filesToShow.some(file => line.includes(file)); |
| 167 | if (matchesFile) { |
| 168 | filteredErrors.push(line); |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | return { |
| 174 | filteredErrors, |
| 175 | totalErrors: errors.length, |
| 176 | filteredCount: filteredErrors.length |
| 177 | }; |
| 178 | } |
| 179 | |
| 180 | // Run a command and capture output |
| 181 | async function runCommand(cmd: string[], description: string) { |
no outgoing calls
no test coverage detected
searching dependent graphs…