{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/3271","labels_url":"https://api.github.com/repos/eslint/eslint/issues/3271/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/3271/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/3271/events","html_url":"https://github.com/eslint/eslint/issues/3271","id":98989589,"number":3271,"title":"F","user":{"login":"robcolburn","id":245860,"avatar_url":"https://avatars.githubusercontent.com/u/245860?v=3","gravatar_id":"","url":"https://api.github.com/users/robcolburn","html_url":"https://github.com/robcolburn","followers_url":"https://api.github.com/users/robcolburn/followers","following_url":"https://api.github.com/users/robcolburn/following{/other_user}","gists_url":"https://api.github.com/users/robcolburn/gists{/gist_id}","starred_url":"https://api.github.com/users/robcolburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robcolburn/subscriptions","organizations_url":"https://api.github.com/users/robcolburn/orgs","repos_url":"https://api.github.com/users/robcolburn/repos","events_url":"https://api.github.com/users/robcolburn/events{/privacy}","received_events_url":"https://api.github.com/users/robcolburn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-04T14:53:19Z","updated_at":"2015-08-04T14:53:20Z","closed_at":null,"body":"Object Rest Spreads aren't quite right in the esilnt though.  You can enable them with `experimentalObjectRestSpread`, however ESLint still considers the resulting variables as not defined.\r\n\r\n```js\r\nfunction stealTheBacon(stuff) {\r\n  var {bacon, ...others} = stuff;\r\n  console.log('The bacon is mine', bacon);\r\n  return others;\r\n}\r\n\r\nstealTheBacon({\r\n  bacon: \"tasty\",\r\n  lettuce: \"nutricious\",\r\n  tomatoe: \"juicy\"\r\n});\r\n```\r\n\r\n```json\r\n{\r\n  \"env\": {\r\n    \"es6\": true\r\n  },\r\n  \"ecmaFeatures\": {\r\n    \"experimentalObjectRestSpread\": true\r\n  },\r\n  \"rules\": {\r\n    \"no-console\": 0,\r\n    \"no-undef\": 2\r\n  },\r\n  \"globals\": {\r\n    \"console\": true\r\n  }\r\n}\r\n```\r\n\r\n```sh\r\n4:10  error  \"others\" is not defined  no-undef\r\n```\r\n\r\nThis is troublesome for React JSX since the feature is recommended by the docs.\r\nhttps://facebook.github.io/react/docs/transferring-props.html#transferring-with-...-in-jsx\r\n\r\nYou can somewhat work around this by declaring ahead of time\r\n```js\r\nfunction stealTheBacon(stuff) {\r\n  var others;\r\n  var {bacon, ...others} = stuff;\r\n  console.log('The bacon is mine', bacon);\r\n  return others;\r\n}\r\n```\r\n\r\nYou're re-declaring though, so now the linter should be complaining at you. "},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/127640388","html_url":"https://github.com/eslint/eslint/issues/3271#issuecomment-127640388","issue_url":"https://api.github.com/repos/eslint/eslint/issues/3271","id":127640388,"user":{"login":"eslintbot","id":13383618,"avatar_url":"https://avatars.githubusercontent.com/u/13383618?v=3","gravatar_id":"","url":"https://api.github.com/users/eslintbot","html_url":"https://github.com/eslintbot","followers_url":"https://api.github.com/users/eslintbot/followers","following_url":"https://api.github.com/users/eslintbot/following{/other_user}","gists_url":"https://api.github.com/users/eslintbot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslintbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslintbot/subscriptions","organizations_url":"https://api.github.com/users/eslintbot/orgs","repos_url":"https://api.github.com/users/eslintbot/repos","events_url":"https://api.github.com/users/eslintbot/events{/privacy}","received_events_url":"https://api.github.com/users/eslintbot/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T14:53:20Z","updated_at":"2015-08-04T14:53:20Z","body":"Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you.\n\nReporting a bug? Please be sure to include:\n\n1. The version of ESLint you are using (run `eslint -v`)\n1. The source code that caused the problem\n1. The configuration you're using (for the rule or your entire config file)\n1. The actual ESLint output complete with line numbers\n\nRequesting a new rule? Please be sure to include:\n\n1. The use case for the rule - what is it trying to prevent or flag?\n1. Whether the rule is trying to prevent an error or is purely stylistic\n1. Why you believe this rule is generic enough to be included\n\nRequesting a feature? Please be sure to include:\n\n1. The problem you want to solve (don't mention the solution)\n1. Your take on the correct solution to problem\n\nIncluding this information in your issue helps us to triage it and get you a response as quickly as possible.\n\nThanks!"}}