(tsconfigPath: string)
| 1560 | } |
| 1561 | |
| 1562 | function parseTsConfig(tsconfigPath: string): ParsedConfigResult { |
| 1563 | const config = ts.readConfigFile(tsconfigPath, ts.sys.readFile) |
| 1564 | if (config.error !== undefined) { |
| 1565 | return { error: `Unable to read TypeScript config ${tsconfigPath}: ${formatDiagnostic(config.error)}` } |
| 1566 | } |
| 1567 | |
| 1568 | const parsed = ts.parseJsonConfigFileContent(config.config, ts.sys, path.dirname(tsconfigPath)) |
| 1569 | if (parsed.errors.length > 0) { |
| 1570 | return { |
| 1571 | error: `Unable to parse TypeScript config ${tsconfigPath}: ${parsed.errors.map(formatDiagnostic).join("; ")}` |
| 1572 | } |
| 1573 | } |
| 1574 | return { parsed } |
| 1575 | } |
| 1576 | |
| 1577 | function collectTsConfigFiles(tsconfigPath: string, seen: Set<string>, fileNames: Set<string>): ParsedConfigResult { |
| 1578 | if (seen.has(tsconfigPath)) return {} |
no test coverage detected