-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Automatically added comments in JSON files cause errors in other tooling down the line. #10525
Comments
Only reason I didn't offer a pull request is that I have no idea what would be a good way to preserve the info in the comments in an accessible form for this project. |
Typescript along with a few other tools don't completely follow the JSON spec and allow comments in their configuration files. Even their default tsconfig on init is filled with comments so the onus is on the tooling to support those. FWIW those comments you point to are in the template so you can just remove them in your repo without needing any change here. |
I agree with @gtm-nayan on this one. TypeScript and other big tools have already basically decided that their JSON files are actually JSON+comments, regardless of how polite of a thing that was to do. At this point, it's the responsibility tools like |
I see in rossyman/svelte-add-jest#29 that that project has declared parsing JSON-C a won't-fix, and they explicitly mention it in their readme. |
|
I'll close this for now 🙏 |
Describe the bug
The JSON spec does not include comments, and some other tooling breaks because of these comments.
Reproduction
Here's a tool that breaks parsing the default
jsconfig.json
:Logs
System Info
Severity
annoyance
Additional Information
Marked as annoyance, but it could be fairly opaque to someone who doesn't already know about JSON comments and what files are involved in the offense.
The text was updated successfully, but these errors were encountered: