Skip to content

Commit

Permalink
fix: support comments at the start of a tsconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgeiler committed Oct 22, 2023
1 parent 797c38a commit e5a6f63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const tsconfigPath = argsProjectValue || resolveFromRoot('tsconfig.json');
const tsconfigContent = fs.readFileSync(tsconfigPath).toString();

// Evaluate the content as JS to support comments in the config file
const tsconfig = new Function(`return ${tsconfigContent}`)();
const tsconfig = new Function(`return (\n${tsconfigContent}\n);`)();

// Get a temporary tsconfig file path
let temporaryTsconfigPath = resolveFromRoot(
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// TypeScript configuration
// See: https://www.typescriptlang.org/tsconfig

{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

/* Projects */
"incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
Expand Down

0 comments on commit e5a6f63

Please sign in to comment.