MCPcopy Create free account
hub / github.com/Snapchat/Valdi / resolveCompilerOptions

Method resolveCompilerOptions

compiler/companion/src/project/Project.ts:158–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156 }
157
158 private resolveCompilerOptions(): ts.CompilerOptions {
159 const tsConfigPath = this.fileManager.resolvePath('tsconfig.json');
160 const tsConfigJsonFile = this.fileManager.getFile(tsConfigPath);
161 const parseResult = ts.parseConfigFileTextToJson(tsConfigPath.absolutePath, tsConfigJsonFile.content);
162 if (parseResult.error) {
163 throw new Error(this.formatDiagnostic(parseResult.error));
164 }
165
166 const parsedCommandLine = ts.parseJsonConfigFileContent(
167 parseResult.config!,
168 new ParseConfigHost(this.fileManager),
169 this.fileManager.getRootPath(),
170 undefined,
171 tsConfigPath.absolutePath,
172 );
173
174 if (parsedCommandLine.errors?.length) {
175 // Ignore ts config errors for now
176 // throw new Error(this.formatDiagnostics(parsedCommandLine.errors));
177 }
178
179 return parsedCommandLine.options;
180 }
181}

Callers 1

compilerOptionsMethod · 0.95

Calls 4

formatDiagnosticMethod · 0.95
resolvePathMethod · 0.45
getFileMethod · 0.45
getRootPathMethod · 0.45

Tested by

no test coverage detected