( configFile: string, extendsValue: string, host: ConfigurationHost, fs: FileSystem, parseConfigHost: ts.ParseConfigHost, )
| 270 | } |
| 271 | |
| 272 | function getExtendedConfigPath( |
| 273 | configFile: string, |
| 274 | extendsValue: string, |
| 275 | host: ConfigurationHost, |
| 276 | fs: FileSystem, |
| 277 | parseConfigHost: ts.ParseConfigHost, |
| 278 | ): AbsoluteFsPath | null { |
| 279 | for (const candidate of [extendsValue, `${extendsValue}.json`]) { |
| 280 | if (candidate[0] === '.' || fs.isRooted(candidate)) { |
| 281 | const extendedConfigPath = host.resolve(host.dirname(configFile), candidate); |
| 282 | if (host.exists(extendedConfigPath)) { |
| 283 | return extendedConfigPath; |
| 284 | } |
| 285 | } else { |
| 286 | // Path isn't a rooted or relative path, resolve like a module. |
| 287 | const {resolvedModule} = ts.nodeModuleNameResolver( |
| 288 | candidate, |
| 289 | configFile, |
| 290 | {moduleResolution: ts.ModuleResolutionKind.NodeNext, resolveJsonModule: true}, |
| 291 | parseConfigHost, |
| 292 | ); |
| 293 | if (resolvedModule) { |
| 294 | return absoluteFrom(resolvedModule.resolvedFileName); |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | return null; |
| 300 | } |
| 301 | |
| 302 | export interface PerformCompilationResult { |
| 303 | diagnostics: ReadonlyArray<ts.Diagnostic>; |
no test coverage detected