The TypeScript tsc compiler (and other tools) use jsonc format, that includes comments, but Sucrase uses the built in JSON parser, which has problems:
- JSON.parse does not support comments.
- JSON.parse will fail on trailing commas
This means that the default output of tsc --init immediately breaks this tool.
I recommend using jsonc-parser which is the same package that VSCode uses for reading its json configuration files. This would ensure sucrase supports the same features as TypeScript.
The TypeScript tsc compiler (and other tools) use
jsoncformat, that includes comments, but Sucrase uses the built in JSON parser, which has problems:This means that the default output of
tsc --initimmediately breaks this tool.I recommend using jsonc-parser which is the same package that VSCode uses for reading its json configuration files. This would ensure sucrase supports the same features as TypeScript.