MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseTsConfig

Function parseTsConfig

packages/tools/jsdocs/src/Jsdocs.ts:1562–1575  ·  view source on GitHub ↗
(tsconfigPath: string)

Source from the content-addressed store, hash-verified

1560}
1561
1562function 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
1577function collectTsConfigFiles(tsconfigPath: string, seen: Set<string>, fileNames: Set<string>): ParsedConfigResult {
1578 if (seen.has(tsconfigPath)) return {}

Callers 1

collectTsConfigFilesFunction · 0.85

Calls 3

formatDiagnosticFunction · 0.85
joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected