{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/1963","labels_url":"https://api.github.com/repos/eslint/eslint/issues/1963/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1963/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/1963/events","html_url":"https://github.com/eslint/eslint/issues/1963","id":60225521,"number":1963,"title":"escope throws error when import is used","user":{"login":"fczuardi","id":7760,"avatar_url":"https://avatars.githubusercontent.com/u/7760?v=3","gravatar_id":"","url":"https://api.github.com/users/fczuardi","html_url":"https://github.com/fczuardi","followers_url":"https://api.github.com/users/fczuardi/followers","following_url":"https://api.github.com/users/fczuardi/following{/other_user}","gists_url":"https://api.github.com/users/fczuardi/gists{/gist_id}","starred_url":"https://api.github.com/users/fczuardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fczuardi/subscriptions","organizations_url":"https://api.github.com/users/fczuardi/orgs","repos_url":"https://api.github.com/users/fczuardi/repos","events_url":"https://api.github.com/users/fczuardi/events{/privacy}","received_events_url":"https://api.github.com/users/fczuardi/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/core","name":"core","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-07T21:32:21Z","updated_at":"2015-03-07T21:55:14Z","closed_at":null,"body":"Maybe this is a duplicate of https://github.com/eslint/espree/issues/10 if that is the case, please feel free to close this issue :)\r\n\r\nHere is a simple js file:\r\n\r\n```es6\r\nimport foo from 'foo';\r\n```\r\n\r\nWhen I run eslint (0.16.0 or master) with the default parser and this .eslintrc config:\r\n\r\n```\r\n{\r\n    \"rules\": {\r\n        \"quotes\": [1, \"single\"],\r\n        \"no-unused-vars\": 1\r\n    },\r\n    \"ecmaFeatures\": {\r\n        \"modules\": true,\r\n    },\r\n}\r\n```\r\n\r\nI get the following error:\r\n\r\n```\r\n \r\n/home/fabricio/bug/node_modules/eslint/node_modules/escope/escope.js:73\r\n            throw new Error(text);\r\n                  ^\r\nError\r\n    at assert (/home/fabricio/bug/node_modules/eslint/node_modules/escope/escope.js:73:19)\r\n    at Referencer.extend.ImportDeclaration (/home/fabricio/bug/node_modules/eslint/node_modules/escope/escope.js:1383:13)\r\n    at Referencer.Visitor.visit (/home/fabricio/bug/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:109:34)\r\n    at Referencer.Visitor.visitChildren (/home/fabricio/bug/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:88:38)\r\n    at Referencer.extend.Program (/home/fabricio/bug/node_modules/eslint/node_modules/escope/escope.js:1236:18)\r\n    at Referencer.Visitor.visit (/home/fabricio/bug/node_modules/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js:109:34)\r\n    at Object.analyze (/home/fabricio/bug/node_modules/eslint/node_modules/escope/escope.js:1430:20)\r\n    at EventEmitter.module.exports.api.verify (/home/fabricio/bug/node_modules/eslint/lib/eslint.js:651:35)\r\n    at processFile (/home/fabricio/bug/node_modules/eslint/lib/cli-engine.js:193:27)\r\n    at /home/fabricio/bug/node_modules/eslint/lib/cli-engine.js:293:26\r\n\r\n```\r\n\r\nThe same happens if the .eslintrc is:\r\n\r\n```\r\n{\r\n    \"rules\": {\r\n        \"quotes\": [1, \"single\"],\r\n        \"no-unused-vars\": 1\r\n    },\r\n    \"env\":{\r\n        \"es6\": true\r\n    },\r\n    \"ecmaFeatures\": {\r\n        \"modules\": true\r\n    }\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/9306547-escope-throws-error-when-import-is-used?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282608&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/77712588","html_url":"https://github.com/eslint/eslint/issues/1963#issuecomment-77712588","issue_url":"https://api.github.com/repos/eslint/eslint/issues/1963","id":77712588,"user":{"login":"fczuardi","id":7760,"avatar_url":"https://avatars.githubusercontent.com/u/7760?v=3","gravatar_id":"","url":"https://api.github.com/users/fczuardi","html_url":"https://github.com/fczuardi","followers_url":"https://api.github.com/users/fczuardi/followers","following_url":"https://api.github.com/users/fczuardi/following{/other_user}","gists_url":"https://api.github.com/users/fczuardi/gists{/gist_id}","starred_url":"https://api.github.com/users/fczuardi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fczuardi/subscriptions","organizations_url":"https://api.github.com/users/fczuardi/orgs","repos_url":"https://api.github.com/users/fczuardi/repos","events_url":"https://api.github.com/users/fczuardi/events{/privacy}","received_events_url":"https://api.github.com/users/fczuardi/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T21:55:14Z","updated_at":"2015-03-07T21:55:14Z","body":"No luck, tried 2 variations:\r\n\r\n```\r\n{\r\n    \"rules\": {\r\n        \"quotes\": [1, \"single\"],\r\n        \"no-unused-vars\": 1\r\n    },\r\n    \"ecmaFeatures\": {\r\n        \"modules\": true,\r\n        \"blockBindings\": true\r\n    }\r\n}\r\n```\r\n\r\nand\r\n\r\n```\r\n{\r\n    \"rules\": {\r\n        \"quotes\": [1, \"single\"],\r\n        \"no-unused-vars\": 1\r\n    },\r\n    \"env\":{\r\n        \"es6\": true\r\n    },\r\n    \"ecmaFeatures\": {\r\n        \"modules\": true,\r\n        \"blockBindings\": true\r\n    }\r\n}\r\n```"}}