-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow JSON with trailing commas #5708
Copy link
Copy link
Labels
lang:jsonIssues affecting JSONIssues affecting JSONlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Metadata
Metadata
Assignees
Labels
lang:jsonIssues affecting JSONIssues affecting JSONlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
I'm looking for a way to support the following style:
This would typically be not a problem -- I should be able to set
parser: jsonandtrailingComma: all. However, #2308* disables this specific combination and I can't get around it.Here's my use case: I want Prettier to format my VSCode settings files, which I keep in a git repo.
Note: I originally filed this bug in another repo prettier/prettier-vscode#589
* I am aware that #2308 was created because trailing commas broke VSCode. However, times have changed and VSCode settings files now support trailing commas.
Thanks!
Prettier 1.15.3
Playground link
Input:
{ // "a": 1, "b": 2, }Output:
{ // "a": 1, "b": 2 }Expected behavior:
I'd like a set of input options that doesn't make changes to the input; i.e., I want the output to also be
{ // "a": 1, "b": 2, }