Skip to content

Commit

Permalink
Make --project accept path to directory containing tsconfig, not just…
Browse files Browse the repository at this point in the history
… path to tsconfig (#1830)

* fix #1829

* fix

* fix
  • Loading branch information
cspotcode authored Jul 10, 2022
1 parent ad01f49 commit aa5ec36
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve, dirname } from 'path';
import { resolve, dirname, join } from 'path';
import type * as _ts from 'typescript';
import {
CreateOptions,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aa5ec36

Please sign in to comment.