{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/4692","labels_url":"https://api.github.com/repos/eslint/eslint/issues/4692/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/4692/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/4692/events","html_url":"https://github.com/eslint/eslint/issues/4692","id":121957455,"number":4692,"title":"Feature: Force `else` to go on same line as closing brace","user":{"login":"andy-hanson","id":5387404,"avatar_url":"https://avatars.githubusercontent.com/u/5387404?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-hanson","html_url":"https://github.com/andy-hanson","followers_url":"https://api.github.com/users/andy-hanson/followers","following_url":"https://api.github.com/users/andy-hanson/following{/other_user}","gists_url":"https://api.github.com/users/andy-hanson/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-hanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-hanson/subscriptions","organizations_url":"https://api.github.com/users/andy-hanson/orgs","repos_url":"https://api.github.com/users/andy-hanson/repos","events_url":"https://api.github.com/users/andy-hanson/events{/privacy}","received_events_url":"https://api.github.com/users/andy-hanson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/triage","name":"triage","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-14T01:09:20Z","updated_at":"2015-12-14T01:09:24Z","closed_at":null,"body":"Since I'm using \"1tbs\" for \"brace-style\", I prefer an `else` statement to go on the same line as the closing curly brace of an `if` statement.\r\n\r\nHowever, eslint does not warn for this code:\r\n\r\n\tif (true) {\r\n\t\tconsole.log(1)\r\n\t\tconsole.log(2)\r\n\t}\r\n\telse\r\n\t\tconsole.log(3)\r\n\r\npresumably because the `else` statement here does not have braces.\r\n\r\nIt would be nice if there were a way to detect this anyway. I would like to force code to look like:\r\n\r\n\tif (true) {\r\n\t\tconsole.log(1)\r\n\t\tconsole.log(2)\r\n\t} else\r\n\t\tconsole.log(3)\r\n\r\nSee also #4591."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/164317302","html_url":"https://github.com/eslint/eslint/issues/4692#issuecomment-164317302","issue_url":"https://api.github.com/repos/eslint/eslint/issues/4692","id":164317302,"user":{"login":"eslintbot","id":13383618,"avatar_url":"https://avatars.githubusercontent.com/u/13383618?v=3","gravatar_id":"","url":"https://api.github.com/users/eslintbot","html_url":"https://github.com/eslintbot","followers_url":"https://api.github.com/users/eslintbot/followers","following_url":"https://api.github.com/users/eslintbot/following{/other_user}","gists_url":"https://api.github.com/users/eslintbot/gists{/gist_id}","starred_url":"https://api.github.com/users/eslintbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslintbot/subscriptions","organizations_url":"https://api.github.com/users/eslintbot/orgs","repos_url":"https://api.github.com/users/eslintbot/repos","events_url":"https://api.github.com/users/eslintbot/events{/privacy}","received_events_url":"https://api.github.com/users/eslintbot/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T01:09:23Z","updated_at":"2015-12-14T01:09:23Z","body":"@andy-hanson Thanks for the issue! If you're reporting a bug, please be sure to include:\n\n1. The version of ESLint you are using (run `eslint -v`)\n2. What you did (the source code and ESLint configuration)\n3. The actual ESLint output complete with numbers\n4. What you expected to happen instead\n\nRequesting a new rule? Please see [Proposing a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules) for instructions."}}