MCPcopy Create free account
hub / github.com/scopecraft/command / parseAndFilterTSErrors

Function parseAndFilterTSErrors

scripts/code-check.ts:152–178  ·  view source on GitHub ↗
(tsOutput: string, filesToShow: string[])

Source from the content-addressed store, hash-verified

150
151// Parse TypeScript errors and filter by file paths
152function 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
181async function runCommand(cmd: string[], description: string) {

Callers 1

runChecksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…