{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/3916","labels_url":"https://api.github.com/repos/eslint/eslint/issues/3916/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/3916/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/3916/events","html_url":"https://github.com/eslint/eslint/issues/3916","id":107987223,"number":3916,"title":"no-unused-vars reports exported variables as unused in node environment","user":{"login":"ilyavolodin","id":1380062,"avatar_url":"https://avatars.githubusercontent.com/u/1380062?v=3","gravatar_id":"","url":"https://api.github.com/users/ilyavolodin","html_url":"https://github.com/ilyavolodin","followers_url":"https://api.github.com/users/ilyavolodin/followers","following_url":"https://api.github.com/users/ilyavolodin/following{/other_user}","gists_url":"https://api.github.com/users/ilyavolodin/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyavolodin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyavolodin/subscriptions","organizations_url":"https://api.github.com/users/ilyavolodin/orgs","repos_url":"https://api.github.com/users/ilyavolodin/repos","events_url":"https://api.github.com/users/ilyavolodin/events{/privacy}","received_events_url":"https://api.github.com/users/ilyavolodin/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/documentation","name":"documentation","color":"5319e7"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-23T19:14:45Z","updated_at":"2015-11-17T17:27:20Z","closed_at":null,"body":"ESLint v1.5.0\r\nThe following code:\r\n```js\r\n/*eslint-env node */\r\n/*eslint no-unused-vars: 2*/\r\n\r\nvar foo = 9;\r\n\r\n/* exported foo */\r\n```\r\nreports the following:\r\n```sh\r\n4:5 - \"foo\" is defined but never used (no-unused-vars)\r\n```\r\n\r\nexpected behavior is to not have any errors. This is due to `globalReturn` flag being on for node environment. I assume the same happens for commonjs environment as well.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26904628-no-unused-vars-reports-exported-variables-as-unused-in-node-environment?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/157444295","html_url":"https://github.com/eslint/eslint/issues/3916#issuecomment-157444295","issue_url":"https://api.github.com/repos/eslint/eslint/issues/3916","id":157444295,"user":{"login":"STRML","id":1197375,"avatar_url":"https://avatars.githubusercontent.com/u/1197375?v=3","gravatar_id":"","url":"https://api.github.com/users/STRML","html_url":"https://github.com/STRML","followers_url":"https://api.github.com/users/STRML/followers","following_url":"https://api.github.com/users/STRML/following{/other_user}","gists_url":"https://api.github.com/users/STRML/gists{/gist_id}","starred_url":"https://api.github.com/users/STRML/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/STRML/subscriptions","organizations_url":"https://api.github.com/users/STRML/orgs","repos_url":"https://api.github.com/users/STRML/repos","events_url":"https://api.github.com/users/STRML/events{/privacy}","received_events_url":"https://api.github.com/users/STRML/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T17:27:20Z","updated_at":"2015-11-17T17:27:20Z","body":"I'm finding that this would be useful for a pattern I often use as a form of self-documentation:\r\n\r\n`let FooComponent = module.exports = someConstructor({...`\r\n\r\nUnfortunately, `no-unused-vars` always marks `FooComponent` as unused because it is not referenced elsewhere in the file.\r\n\r\nSetting `/*eslint no-unused-vars:0*/` shuts off var checking for the whole file. For now I've been prepending an underscore (to use `varsIgnorePattern`) but this is pretty annoying. Is there any way to support this syntax?"}}