{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/2967","labels_url":"https://api.github.com/repos/eslint/eslint/issues/2967/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/2967/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/2967/events","html_url":"https://github.com/eslint/eslint/issues/2967","id":94381495,"number":2967,"title":"ecmaFeatures.modules conflicts with block-scoped-var","user":{"login":"gmathieu","id":7855,"avatar_url":"https://avatars.githubusercontent.com/u/7855?v=3","gravatar_id":"","url":"https://api.github.com/users/gmathieu","html_url":"https://github.com/gmathieu","followers_url":"https://api.github.com/users/gmathieu/followers","following_url":"https://api.github.com/users/gmathieu/following{/other_user}","gists_url":"https://api.github.com/users/gmathieu/gists{/gist_id}","starred_url":"https://api.github.com/users/gmathieu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmathieu/subscriptions","organizations_url":"https://api.github.com/users/gmathieu/orgs","repos_url":"https://api.github.com/users/gmathieu/repos","events_url":"https://api.github.com/users/gmathieu/events{/privacy}","received_events_url":"https://api.github.com/users/gmathieu/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,"milestone":null,"comments":5,"created_at":"2015-07-10T20:03:57Z","updated_at":"2015-07-27T17:32:58Z","closed_at":null,"body":"When `ecmaFeatures.module=true`, functions calls before declaration throws a `block-scoped-var` error. This test is using the default parser `v0.24.1` but I believe I've seen something similar using `babel-eslint`.\r\n\r\n```javascript\r\n(function () {\r\n    fnDeclaredBelow(); // error: fnDeclaredBelow used outside of binding context\r\n})();\r\n\r\nfunction fnDeclaredBelow () {\r\n    return true;\r\n}\r\n```\r\n\r\nHere's the associated `.eslintrc`. If you switch module to `false` the above code validates properly.\r\n\r\n```json\r\n{\r\n  \"env\": {\r\n    \"es6\": true,\r\n  },\r\n  \"rules\": {\r\n    \"block-scoped-var\": 2,\r\n    \"no-use-before-define\": [2, \"nofunc\"],\r\n    \"strict\": [2, \"never\"],\r\n  },\r\n  \"ecmaFeatures\": {\r\n    \"modules\": true,\r\n  },\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/125281720","html_url":"https://github.com/eslint/eslint/issues/2967#issuecomment-125281720","issue_url":"https://api.github.com/repos/eslint/eslint/issues/2967","id":125281720,"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},"created_at":"2015-07-27T17:32:58Z","updated_at":"2015-07-27T17:32:58Z","body":"@nzakas Sure."}}