Skip to content

Commit

Permalink
Add support for comments in tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Aug 6, 2023
1 parent 681b446 commit 2f7528d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ for (const {

if (templateFileName === 'tsconfig.json') {
const projectTsconfigJson = JSON.parse(
readFileSync(join(process.cwd(), 'tsconfig.json'), 'utf-8'),
readFileSync(join(process.cwd(), 'tsconfig.json'), 'utf-8')
// Remove comments from tsconfig.json
.replace(/^\s*\/\/.*/gm, ''),
);

if ('plugins' in (projectTsconfigJson.compilerOptions || {})) {
Expand Down

0 comments on commit 2f7528d

Please sign in to comment.