diff --git a/src/configuration.ts b/src/configuration.ts index 266f2d920..4ab0a7ccf 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 { + configFilePath = ts.findConfigFile(projectSearchDir, fileExists); + } if (configFilePath) { let pathToNextConfigInChain = configFilePath;