Skip to content

Commit 13efde2

Browse files
fix: load tsconfig with a lib that supports extends (#32)
1 parent 91d7bf5 commit 13efde2

File tree

4 files changed

+33
-297
lines changed

4 files changed

+33
-297
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"glob": "^7.1.3",
7272
"json-stable-stringify": "^1.0.1",
7373
"minimatch": "^3.0.4",
74-
"tsconfig": "^7.0.0",
74+
"tsconfig-loader": "^1.1.0",
7575
"typescript-json-schema": "^0.38.3",
7676
"yargs": "^13.2.4"
7777
}

src/Example.validator.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/loadTsConfig.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import {loadSync} from 'tsconfig';
1+
import loadTsconfig from 'tsconfig-loader';
22

3-
export default function loadTsConfig(cwd: string = process.cwd()): any {
4-
const result = loadSync(cwd);
5-
const compilerOptions =
6-
(result.config && result.config.compilerOptions) || {};
3+
export default function loadTsConfig(cwd: string = process.cwd()) {
4+
const result = loadTsconfig({cwd});
5+
const compilerOptions = result?.tsConfig.compilerOptions || {};
76
if (
87
compilerOptions.experimentalDecorators === false &&
98
compilerOptions.emitDecoratorMetadata === undefined

0 commit comments

Comments
 (0)