{"action":"created","issue":{"url":"https://api.github.com/repos/prettier/prettier/issues/5708","repository_url":"https://api.github.com/repos/prettier/prettier","labels_url":"https://api.github.com/repos/prettier/prettier/issues/5708/labels{/name}","comments_url":"https://api.github.com/repos/prettier/prettier/issues/5708/comments","events_url":"https://api.github.com/repos/prettier/prettier/issues/5708/events","html_url":"https://github.com/prettier/prettier/issues/5708","id":395426770,"node_id":"MDU6SXNzdWUzOTU0MjY3NzA=","number":5708,"title":"Allow JSON with trailing commas","user":{"login":"szhu","id":1570168,"node_id":"MDQ6VXNlcjE1NzAxNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/1570168?v=4","gravatar_id":"","url":"https://api.github.com/users/szhu","html_url":"https://github.com/szhu","followers_url":"https://api.github.com/users/szhu/followers","following_url":"https://api.github.com/users/szhu/following{/other_user}","gists_url":"https://api.github.com/users/szhu/gists{/gist_id}","starred_url":"https://api.github.com/users/szhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szhu/subscriptions","organizations_url":"https://api.github.com/users/szhu/orgs","repos_url":"https://api.github.com/users/szhu/repos","events_url":"https://api.github.com/users/szhu/events{/privacy}","received_events_url":"https://api.github.com/users/szhu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-03T00:46:41Z","updated_at":"2019-01-03T12:04:45Z","closed_at":null,"author_association":"NONE","body":"I'm looking for a way to support the following style:\r\n- JSON-based\r\n- Always quote keys\r\n- Always include trailing commas\r\n\r\nThis would typically be not a problem -- I should be able to set `parser: json` and `trailingComma: all`. However, #2308\\* disables this specific combination and I can't get around it.\r\n\r\nHere's my use case: I want Prettier to format my VSCode settings files, which I keep in a git repo.\r\n- VSCode requires keys to be quoted, so I can't use the json5 parser.\r\n- I would like trailing commas to make diffs more readable.\r\n\r\nNote: I originally filed this bug in another repo https://github.com/prettier/prettier-vscode/issues/589\r\n\r\n\\* I am aware that #2308 was created because trailing commas _broke_ VSCode. However, times have changed and VSCode settings files now support trailing commas.\r\n\r\nThanks!\r\n\r\n**Prettier 1.15.3**\r\n[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEwA6UAEmD0OPZogCGRSmAjADQGZEBGZmATDVAL4hUgQAOMAS2gBnZKGIAnCRADuABUkJRKYgDcIAgCZcQ9CcTABrODADKvAwKgBzZDAkBXONwAWMALYAbAOouB8YQswOFMlfwFVfwBPZHBhUW4rYTgJGDl9a3diZAAzYk9k7gArYQAPACF9IxNTYnc4ABkrOFz8wpAS0tMra084AEUHCHhWgucQCwlkiViS6B1eCSsYby0YF2QADgAGbkWIZO99XljFuGnVFu4JOABHBwEb9OJM7KQ8se5k9wE7R3HhD0+oNhi13m1xjBiPRVpp1shWCB7MQBJ4egBhCDuLKxfKeHQOZIAFWhyg+yXY7CAA)\r\n```sh\r\n--parser json\r\n--trailing-comma all\r\n```\r\n\r\n**Input:**\r\n```jsonc\r\n{\r\n  //\r\n  \"a\": 1,\r\n  \"b\": 2,\r\n}\r\n```\r\n\r\n**Output:**\r\n```jsonc\r\n{\r\n  //\r\n  \"a\": 1,\r\n  \"b\": 2\r\n}\r\n\r\n```\r\n\r\n**Expected behavior:**\r\nI'd like a set of input options that doesn't make changes to the input; i.e., I want the output to also be\r\n```jsonc\r\n{\r\n  //\r\n  \"a\": 1,\r\n  \"b\": 2,\r\n}\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/prettier/prettier/issues/comments/451125071","html_url":"https://github.com/prettier/prettier/issues/5708#issuecomment-451125071","issue_url":"https://api.github.com/repos/prettier/prettier/issues/5708","id":451125071,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTEyNTA3MQ==","user":{"login":"lydell","id":2142817,"node_id":"MDQ6VXNlcjIxNDI4MTc=","avatar_url":"https://avatars3.githubusercontent.com/u/2142817?v=4","gravatar_id":"","url":"https://api.github.com/users/lydell","html_url":"https://github.com/lydell","followers_url":"https://api.github.com/users/lydell/followers","following_url":"https://api.github.com/users/lydell/following{/other_user}","gists_url":"https://api.github.com/users/lydell/gists{/gist_id}","starred_url":"https://api.github.com/users/lydell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydell/subscriptions","organizations_url":"https://api.github.com/users/lydell/orgs","repos_url":"https://api.github.com/users/lydell/repos","events_url":"https://api.github.com/users/lydell/events{/privacy}","received_events_url":"https://api.github.com/users/lydell/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T12:04:45Z","updated_at":"2019-01-03T12:04:45Z","author_association":"COLLABORATOR","body":"`--parser json-vscode` :shudder:"}}
{"actor":{"display_login":"lydell"}}