{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/7297","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/7297/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/7297/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/7297/events","html_url":"https://github.com/eslint/eslint/issues/7297","id":180791234,"number":7297,"title":"Change proposal: forbid trailing comma after rest property","user":{"login":"daltones","id":5603632,"avatar_url":"https://avatars.githubusercontent.com/u/5603632?v=3","gravatar_id":"","url":"https://api.github.com/users/daltones","html_url":"https://github.com/daltones","followers_url":"https://api.github.com/users/daltones/followers","following_url":"https://api.github.com/users/daltones/following{/other_user}","gists_url":"https://api.github.com/users/daltones/gists{/gist_id}","starred_url":"https://api.github.com/users/daltones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daltones/subscriptions","organizations_url":"https://api.github.com/users/daltones/orgs","repos_url":"https://api.github.com/users/daltones/repos","events_url":"https://api.github.com/users/daltones/events{/privacy}","received_events_url":"https://api.github.com/users/daltones/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc"},{"url":"https://api.github.com/repos/eslint/eslint/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-04T02:18:56Z","updated_at":"2016-10-04T02:43:16Z","closed_at":null,"body":"**What rule do you want to change?**\r\ncomma-dangle\r\n\r\n**Does this change cause the rule to produce more or fewer warnings?**\r\nI guess it depends. But probably more warnings.\r\n\r\n**How will the change be implemented? (New option, new default behavior, etc.)?**\r\nNew option, something like `{forbidAfterRest: true}`\r\n\r\n**Please provide some example code that this change will affect:**\r\n```js\r\nconst {\r\n  x,\r\n  y,\r\n  ...z\r\n} = foo;\r\n```\r\n\r\n**What does the rule currently do for this code?**\r\nWhen using this rule with string option `\"always-multiline\"`, it will warn about missing trailing comma after `...z`.\r\n\r\n**What will the rule do after it's changed?**\r\nNo trailing comma after `...z` will be correct, and a trailing comma will be incorrect.\r\n\r\n\r\n**Motivation:**\r\nSeems like the [spec](http://sebmarkbage.github.io/ecmascript-rest-spread/) doesn't even allow that kind of trailing comma.\r\n\r\n[Babel's Babylon v6.11.3](https://github.com/babel/babylon/releases/tag/v6.11.3) went so far as to consider that as syntax error.\r\n> The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.\r\n\r\n[Babylon v6.11.4](https://github.com/babel/babylon/releases/tag/v6.11.4) temporary rolled back that behavior.\r\n\r\nSo for now I guess is up to the user to choose if that trailing comma is incorrect or not with the new `forbidAfterRest` option."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/251281733","html_url":"https://github.com/eslint/eslint/issues/7297#issuecomment-251281733","issue_url":"https://api.github.com/repos/eslint/eslint/issues/7297","id":251281733,"user":{"login":"daltones","id":5603632,"avatar_url":"https://avatars.githubusercontent.com/u/5603632?v=3","gravatar_id":"","url":"https://api.github.com/users/daltones","html_url":"https://github.com/daltones","followers_url":"https://api.github.com/users/daltones/followers","following_url":"https://api.github.com/users/daltones/following{/other_user}","gists_url":"https://api.github.com/users/daltones/gists{/gist_id}","starred_url":"https://api.github.com/users/daltones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daltones/subscriptions","organizations_url":"https://api.github.com/users/daltones/orgs","repos_url":"https://api.github.com/users/daltones/repos","events_url":"https://api.github.com/users/daltones/events{/privacy}","received_events_url":"https://api.github.com/users/daltones/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T02:43:16Z","updated_at":"2016-10-04T02:43:16Z","body":"@not-an-aardvark yes, this rule change proposal could be rethought as a bug report to Espree. But I was considering the Babylon case, which rolled back that SyntaxError because reported compatibility problems, making the trailing comma optional."}}
{"actor":{"display_login":"daltones"}}