diff --git a/src/main/ts/util.ts b/src/main/ts/util.ts index bec07a4..7acf811 100644 --- a/src/main/ts/util.ts +++ b/src/main/ts/util.ts @@ -24,7 +24,14 @@ export const remove = fse.unlinkSync export const unixify = (path: string): string => path.replace(/\\/g, '/') export const resolveTsConfig = (file: string): TSConfig => populateSync(file, { - compilerOptions: 'merge' + parse({contents, ext}) { + if (ext === '.json') + return json5.parse(contents) + throw new Error(`Unsupported format: ${ext}`) + }, + rules: { + compilerOptions: 'merge' + } }) export const omitUndefinedKeys = >(obj: T): T => diff --git a/src/test/fixtures/ts-project/tsconfig.es6.json b/src/test/fixtures/ts-project/tsconfig.es6.json index b8b8976..a4eeecd 100644 --- a/src/test/fixtures/ts-project/tsconfig.es6.json +++ b/src/test/fixtures/ts-project/tsconfig.es6.json @@ -5,5 +5,6 @@ "module": "esnext", "outDir": "target/es6" }, + // json5 comment "include": ["src/main/**/*.ts"] }