{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/espree/issues/194","labels_url":"https://api.github.com/repos/eslint/espree/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/eslint/espree/issues/194/comments","events_url":"https://api.github.com/repos/eslint/espree/issues/194/events","html_url":"https://github.com/eslint/espree/issues/194","id":105039755,"number":194,"title":"`...rest` in ArrayPattern should be RestElement.","user":{"login":"mysticatea","id":1937871,"avatar_url":"https://avatars.githubusercontent.com/u/1937871?v=3","gravatar_id":"","url":"https://api.github.com/users/mysticatea","html_url":"https://github.com/mysticatea","followers_url":"https://api.github.com/users/mysticatea/followers","following_url":"https://api.github.com/users/mysticatea/following{/other_user}","gists_url":"https://api.github.com/users/mysticatea/gists{/gist_id}","starred_url":"https://api.github.com/users/mysticatea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysticatea/subscriptions","organizations_url":"https://api.github.com/users/mysticatea/orgs","repos_url":"https://api.github.com/users/mysticatea/repos","events_url":"https://api.github.com/users/mysticatea/events{/privacy}","received_events_url":"https://api.github.com/users/mysticatea/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/espree/labels/accepted","name":"accepted","color":"207de5"},{"url":"https://api.github.com/repos/eslint/espree/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-05T17:44:50Z","updated_at":"2015-09-15T20:49:22Z","closed_at":null,"body":"Currently, espree is making `SpreadElement` inside of `ArrayPattern`.\r\nBut `RestElement` should be made.\r\n\r\n```js\r\nvar [a, ...rest] = foo;\r\n```\r\n\r\n```json\r\n{\r\n  \"type\": \"Program\",\r\n  \"body\": [\r\n    {\r\n      \"type\": \"VariableDeclaration\",\r\n      \"declarations\": [\r\n        {\r\n          \"type\": \"VariableDeclarator\",\r\n          \"id\": {\r\n            \"type\": \"ArrayPattern\",\r\n            \"elements\": [\r\n              {\r\n                \"type\": \"Identifier\",\r\n                \"name\": \"a\"\r\n              },\r\n              {\r\n                \"type\": \"SpreadElement\",\r\n                \"argument\": {\r\n                  \"type\": \"Identifier\",\r\n                  \"name\": \"rest\"\r\n                }\r\n              }\r\n            ]\r\n          },\r\n          \"init\": {\r\n            \"type\": \"Identifier\",\r\n            \"name\": \"foo\"\r\n          }\r\n        }\r\n      ],\r\n      \"kind\": \"var\"\r\n    }\r\n  ],\r\n  \"sourceType\": \"module\",\r\n  \"errors\": []\r\n}\r\n```\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26474259-rest-in-arraypattern-should-be-restelement?utm_campaign=plugin&utm_content=tracker%2F9348450&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F9348450&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/espree/issues/comments/140534738","html_url":"https://github.com/eslint/espree/issues/194#issuecomment-140534738","issue_url":"https://api.github.com/repos/eslint/espree/issues/194","id":140534738,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T20:49:22Z","updated_at":"2015-09-15T20:49:22Z","body":"Working on this."}}