{"action":"opened","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/5568","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/5568/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/5568/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/5568/events","html_url":"https://github.com/eslint/eslint/issues/5568","id":140651658,"number":5568,"title":"`prefer-const` not working consistently","user":{"login":"karolyi","id":987055,"avatar_url":"https://avatars.githubusercontent.com/u/987055?v=3","gravatar_id":"","url":"https://api.github.com/users/karolyi","html_url":"https://github.com/karolyi","followers_url":"https://api.github.com/users/karolyi/followers","following_url":"https://api.github.com/users/karolyi/following{/other_user}","gists_url":"https://api.github.com/users/karolyi/gists{/gist_id}","starred_url":"https://api.github.com/users/karolyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karolyi/subscriptions","organizations_url":"https://api.github.com/users/karolyi/orgs","repos_url":"https://api.github.com/users/karolyi/repos","events_url":"https://api.github.com/users/karolyi/events{/privacy}","received_events_url":"https://api.github.com/users/karolyi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-14T11:47:02Z","updated_at":"2016-03-14T11:47:02Z","closed_at":null,"body":"**What version of ESLint are you using?**\r\n2.4.0\r\n\r\n**What parser (default, Babel-ESLint, etc.) are you using?**\r\nbabel-eslint\r\n\r\n**Please show your full configuration:**\r\n```\r\n{\r\n  \"ecmaFeatures\": {\r\n    \"modules\": true\r\n  },\r\n  \"env\": {\r\n    \"browser\": true,\r\n    \"node\": true\r\n  },\r\n  \"parser\": \"babel-eslint\",\r\n  \"rules\": {\r\n    \"semi\": [2, \"never\"],\r\n    \"quotes\": [2, \"single\"],\r\n    \"strict\": [2, \"never\"],\r\n    \"max-len\": [2, {\"code\": 80, \"tabWidth\": 4, \"ignoreUrls\": true}]\r\n  },\r\n  \"globals\": {\r\n    \"riot\": true\r\n  },\r\n  \"plugins\": [\r\n    \"riot\"\r\n  ],\r\n  \"extends\": [\"eslint:recommended\", \"airbnb/base\"]\r\n}\r\n```\r\n\r\n**What did you do? Please include the actual source code causing the issue.**\r\nI might be missing something, but I think this rule is still not working right.\r\n\r\nsince `const` has a different behavior in browsers and nodejs, I get different results with using for cycles.\r\n\r\nbrowser (latest chrome):\r\n![image](https://cloud.githubusercontent.com/assets/987055/13743353/8d3d2b16-e9e1-11e5-92d0-8f86a1c398ac.png)\r\n\r\nnodejs (v5.7.1):\r\n![image](https://cloud.githubusercontent.com/assets/987055/13743375/aa471384-e9e1-11e5-9385-f41cb31a04de.png)\r\n\r\nyet eslint with `prefer-const` still wants to enforce the usage of const in the for cycle declaration with `error: 'key' is never reassigned, use 'const' instead`\r\n\r\nsetting the eslint directive `/* eslint-env node */` directive doesn't help.\r\n\r\ncan we get this fixed please?\r\n\r\n**What did you expect to happen?**\r\n`prefer-const` not getting enforced either when sensing a for cycle or node environment\r\n\r\n**What actually happened? Please include the actual, raw output from ESLint.**\r\nsee above."}}