-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
jsonc: Should not allow invalid JSON syntax (trailing commas) #43825
Comments
@vscodebot Thanks, but these do not cover my particular issue. |
|
Maybe file a issue against TypeScript to also ignore trailing commas. Wouldn't that be a better solution? |
Not 100% sure, but I think typescript 2.4+ ignores trailing commas in |
The issue wasn't actually with the TypeScript compiler per se, but with Upgrading |
Steps to Reproduce:
Trailing commas are not valid JSON. However, they are valid JavaScript nowadays.
I had a
tsconfig.json
that looked like this:When using the regular JSON mode, the syntax checking correctly errors about the trailing comma. However, when using jsonc mode, it does not which is a bit sad because it made me start debugging other things, stepping through the node extension I was using etc. instead of looking carefully at the file. I assumed the file was good since it "looked good" in vscode.
I believe jsonc should generate errors for files like the above. Only comments should be allowed, but not other "invalid JSON" syntax. Are there particularly good reasons for the current behavior?
The text was updated successfully, but these errors were encountered: