-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parse error for trailing comma in tsconfig.json #30
Comments
Makes sense, related to #28. Happy to accept a PR here, but would likely mean trying to implement a custom JSON parser. I'd recommend using typescript directly where possible. |
I see 2 possible implementations
an optional peerdependency on typescript and using its native functions before resorting to a custom implementation would be better. In my case i ran into this in vite, which uses esbuild so there is no typescript by default. |
Have you thought about using the jsonc-parser package to read the config files ? |
According to this issue on typescript repo, trailing commas in tsconfig are legal (like comments)
microsoft/TypeScript#20384 (comment)
Example:
Comments are stripped here, but the comma is not, resulting in an error.
tsconfig/src/tsconfig.ts
Line 187 in 3d0586d
The text was updated successfully, but these errors were encountered: