MCPcopy Create free account
hub / github.com/arktypeio/arktype / parseConfig

Function parseConfig

ark/aot/declare.ts:734–752  ·  view source on GitHub ↗
(
	ts: TypeScript,
	cwd: string,
	tsconfig: string | undefined,
	diagnostics: ts.Diagnostic[]
)

Source from the content-addressed store, hash-verified

732}
733
734export const parseConfig = (
735 ts: TypeScript,
736 cwd: string,
737 tsconfig: string | undefined,
738 diagnostics: ts.Diagnostic[]
739): ts.ParsedCommandLine => {
740 const configPath =
741 tsconfig ?
742 resolve(cwd, tsconfig)
743 : (ts.findConfigFile(cwd, ts.sys.fileExists) ??
744 throwError(writeNoTsconfigMessage(cwd)))
745 const config = ts.getParsedCommandLineOfConfigFile(configPath, undefined, {
746 ...ts.sys,
747 onUnRecoverableConfigFileDiagnostic: d => diagnostics.push(d)
748 })
749 if (!config) return throwError(formatDiagnostics(ts, diagnostics, cwd))
750 diagnostics.push(...config.errors)
751 return config
752}
753
754export const formatDiagnostics = (
755 ts: TypeScript,

Callers 3

emitPrecompiledFunction · 0.90
emitDeclarationsJsFunction · 0.70
visitFunction · 0.70

Calls 5

throwErrorFunction · 0.90
writeNoTsconfigMessageFunction · 0.85
formatDiagnosticsFunction · 0.85
resolveFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected