{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/2390","labels_url":"https://api.github.com/repos/eslint/eslint/issues/2390/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/2390/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/2390/events","html_url":"https://github.com/eslint/eslint/issues/2390","id":71158838,"number":2390,"title":"Curly: multi, but with balanced if-else statements","user":{"login":"bathos","id":6257356,"avatar_url":"https://avatars.githubusercontent.com/u/6257356?v=3","gravatar_id":"","url":"https://api.github.com/users/bathos","html_url":"https://github.com/bathos","followers_url":"https://api.github.com/users/bathos/followers","following_url":"https://api.github.com/users/bathos/following{/other_user}","gists_url":"https://api.github.com/users/bathos/gists{/gist_id}","starred_url":"https://api.github.com/users/bathos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bathos/subscriptions","organizations_url":"https://api.github.com/users/bathos/orgs","repos_url":"https://api.github.com/users/bathos/repos","events_url":"https://api.github.com/users/bathos/events{/privacy}","received_events_url":"https://api.github.com/users/bathos/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/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-27T02:41:11Z","updated_at":"2015-10-16T21:27:07Z","closed_at":"2015-10-06T16:27:16Z","body":"I came here because I ran into the problem at #2366, and it's awesome to see it was just fixed yesterday! I had two other concerns related to brace style as well, both of which are feature requests rather than bug reports.\r\n\r\nThe first I discovered was already detailed at #1806.\r\n\r\nThe other I didn't find described yet. I'm curious whether a style option extending 'multi' for curly might be considered, for handling if/else blocks nicely. In my experience those of us who favor multi will nonetheless wish to balance if/else blocks when one or the other is multi-statement. That is, if either 'if' or 'else' is a multi-statement block, the other should use braces as well, or else you end up with rather awkward results.\r\n\r\nSo the legal forms would be, as with multi:\r\n\r\n    if (condition)\r\n        statement();\r\n    else\r\n        statement();\r\n\r\nand of course:\r\n\r\n    if (condition) {\r\n        statement();\r\n        statement();\r\n    }  else {\r\n        statement();\r\n        statement();\r\n    }\r\n\r\nbut also, this, which is considered an error when using 'multi':\r\n\r\n    if (condition) {\r\n        statement();\r\n        statement();\r\n    } else {\r\n        statement();\r\n    }\r\n\r\ninstead of the form which is currently considered valid (and which I've rarely seen used in practice, for reasons that seem apparent):\r\n\r\n    if (condition) {\r\n        statement();\r\n        statement();\r\n    } else\r\n        statement();"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/148840677","html_url":"https://github.com/eslint/eslint/issues/2390#issuecomment-148840677","issue_url":"https://api.github.com/repos/eslint/eslint/issues/2390","id":148840677,"user":{"login":"aparajita","id":22218,"avatar_url":"https://avatars.githubusercontent.com/u/22218?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajita","html_url":"https://github.com/aparajita","followers_url":"https://api.github.com/users/aparajita/followers","following_url":"https://api.github.com/users/aparajita/following{/other_user}","gists_url":"https://api.github.com/users/aparajita/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajita/subscriptions","organizations_url":"https://api.github.com/users/aparajita/orgs","repos_url":"https://api.github.com/users/aparajita/repos","events_url":"https://api.github.com/users/aparajita/events{/privacy}","received_events_url":"https://api.github.com/users/aparajita/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T21:27:07Z","updated_at":"2015-10-16T21:27:07Z","body":"> instead of the form which is currently considered valid (and which I've rarely seen used in practice, for reasons that seem apparent)\r\n\r\nFYI: With non-allman style braces, I agree. However, with allman style braces, inconsistent use of braces looks quite natural (to me and my colleagues at least):\r\n\r\n```js\r\nif (foo)\r\n{\r\n    doSomething();\r\n    doSomethingElse();\r\n}\r\nelse\r\n    doBar();\r\n```\r\n"}}