From 8645fc8c2ff9f0b32154a588e4734abcd3ce57b3 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 9 Jul 2022 23:10:09 -0400 Subject: [PATCH 1/3] fix #1829 --- src/configuration.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/configuration.ts b/src/configuration.ts index 266f2d920..9933cc31d 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,4 +1,4 @@ -import { resolve, dirname } from 'path'; +import { resolve, dirname, join } from 'path'; import type * as _ts from 'typescript'; import { CreateOptions, @@ -167,9 +167,13 @@ export function readConfig( // Read project configuration when available. if (!skipProject) { - configFilePath = project - ? resolve(cwd, project) - : ts.findConfigFile(projectSearchDir, fileExists); + if(project) { + const resolved = resolve(cwd, project); + const nested = join(resolved, 'tsconfig.json'); + configFilePath = fileExists(nested) ? nested : resolved; + } else { + ts.findConfigFile(projectSearchDir, fileExists); + } if (configFilePath) { let pathToNextConfigInChain = configFilePath; From a6fff2cd200fe867d702315c806d8fa3c81e4b30 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 9 Jul 2022 23:17:10 -0400 Subject: [PATCH 2/3] fix --- src/configuration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.ts b/src/configuration.ts index 9933cc31d..0ea02f3ec 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -167,7 +167,7 @@ export function readConfig( // Read project configuration when available. if (!skipProject) { - if(project) { + if (project) { const resolved = resolve(cwd, project); const nested = join(resolved, 'tsconfig.json'); configFilePath = fileExists(nested) ? nested : resolved; From 97acaba74c439781041b556c6446fd8127b6c8a0 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 9 Jul 2022 23:32:24 -0400 Subject: [PATCH 3/3] fix --- src/configuration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configuration.ts b/src/configuration.ts index 0ea02f3ec..4ab0a7ccf 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -172,7 +172,7 @@ export function readConfig( const nested = join(resolved, 'tsconfig.json'); configFilePath = fileExists(nested) ? nested : resolved; } else { - ts.findConfigFile(projectSearchDir, fileExists); + configFilePath = ts.findConfigFile(projectSearchDir, fileExists); } if (configFilePath) {