Skip to content

Commit

Permalink
fix: tsconfig.json extends without .json
Browse files Browse the repository at this point in the history
  • Loading branch information
plantain-00 committed Nov 22, 2020
1 parent 5a9dc48 commit 92330f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/utils/src/tsconfig.json
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"outDir": "../dist",
"module": "commonjs",
"target": "ES2018",
"declaration": true
},
"files": [
Expand Down
9 changes: 9 additions & 0 deletions packages/utils/src/tsconfig.ts
Expand Up @@ -40,6 +40,15 @@ function getTsConfigFilePath(project: string, fallbackProject?: string[]) {
throw error
}
}
if (!projectStats) {
try {
projectStats = fs.statSync(project + '.json')
} catch {
if (projectStats) {

This comment has been minimized.

Copy link
@JounQin

JounQin Nov 22, 2020

Contributor

How projectStats could be truthy here?

Maybe it should be outside catch.

project = project + '.json'
}
}
}
if (projectStats && projectStats.isDirectory()) {
configFilePath = path.resolve(project, 'tsconfig.json')
dirname = project
Expand Down

0 comments on commit 92330f1

Please sign in to comment.