()
| 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 | } |
no test coverage detected