{"action":"closed","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/1918","labels_url":"https://api.github.com/repos/eslint/eslint/issues/1918/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1918/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/1918/events","html_url":"https://github.com/eslint/eslint/issues/1918","id":59518058,"number":1918,"title":"Bug in no-unused-vars when using extra parens to avoid no-cond-assign","user":{"login":"bedney","id":13412,"avatar_url":"https://avatars.githubusercontent.com/u/13412?v=3","gravatar_id":"","url":"https://api.github.com/users/bedney","html_url":"https://github.com/bedney","followers_url":"https://api.github.com/users/bedney/followers","following_url":"https://api.github.com/users/bedney/following{/other_user}","gists_url":"https://api.github.com/users/bedney/gists{/gist_id}","starred_url":"https://api.github.com/users/bedney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bedney/subscriptions","organizations_url":"https://api.github.com/users/bedney/orgs","repos_url":"https://api.github.com/users/bedney/repos","events_url":"https://api.github.com/users/bedney/events{/privacy}","received_events_url":"https://api.github.com/users/bedney/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-02T18:03:15Z","updated_at":"2015-03-02T18:29:24Z","closed_at":"2015-03-02T18:29:24Z","body":"Sorry if this has been logged before. There are a quite a few logged against `no-unused-vars`, but I didn't see this one.\r\n\r\nI use additional parens to avoid `no-cond-assign`:\r\n\r\n```js\r\nfunction foo(aThing) {\r\n\r\n    var something;\r\n\r\n    if ((something = aThing)) {\r\n        console.log('got something');\r\n    }\r\n}\r\n\r\nfoo('a thing');\r\n```\r\n\r\nIn this case, `something` is reported as an unused var, even though it is obviously being used.\r\n\r\nChanging the code to this causes the lint error to go away:\r\n\r\n```js\r\nfunction foo(aThing) {\r\n\r\n    var something;\r\n\r\n    something = aThing;\r\n    if (something) {\r\n        console.log('got something');\r\n    }\r\n}\r\n\r\nfoo('a thing');\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/9117476-bug-in-no-unused-vars-when-using-extra-parens-to-avoid-no-cond-assign?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>"}}