davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
330 stars 11 forks source link

CLI code to update `tsconfig.json` paths will remove any comments #40

Open davestewart opened 2 years ago

davestewart commented 2 years ago

Background

Because tsconfig.json supports // comments simply loading and then saving JSON to the file will replace the file's contents and so remove any comments:

https://github.com/davestewart/alias-hq/blob/master/cli/utils/file.js#L20

Proposal

Replace only the paths part of the file.

Ideas: