You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, according to TypeScript #4987, it looks like comments are allowed in tsconfig.json files now. Unfortunately, tsconfig-glob throws an error if it has any, though.
I think this would be an easy fix if you're willing to take on an additional dependency like strip-json-comments to take them out first. I see you're already stripping possible BOMs, so this would just be another filter before JSON.parse. I'm happy to put together a pull request using it if you're willing to accept one.
Cheers,
Robert
The text was updated successfully, but these errors were encountered:
I haven't worked with strip-json-comments but it seems fairly straightforward. If you want to create a pull request I will look over/accept it. Otherwise I will get to this when I have some time.
I'm not sure there is a way to overwrite the tsconfig.json and preserve the json comments without coming up with some extravagant parsing method. TypeScript can afford to allow comments since they are only reading the tsconfig.json. Unfortunately we have to write to the file as well, so you would lose your comments.
Oops - you're riight! I was only thinking about the reading part and forgot about the rewriting aspect lol. Since it's more than a simple fix, please don't worry about it on my account. Thanks, anyway!
Hi, according to TypeScript #4987, it looks like comments are allowed in tsconfig.json files now. Unfortunately,
tsconfig-glob
throws an error if it has any, though.I think this would be an easy fix if you're willing to take on an additional dependency like strip-json-comments to take them out first. I see you're already stripping possible BOMs, so this would just be another filter before
JSON.parse
. I'm happy to put together a pull request using it if you're willing to accept one.Cheers,
Robert
The text was updated successfully, but these errors were encountered: