{"action":"closed","issue":{"url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/issues/43","repository_url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle","labels_url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/issues/43/comments","events_url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/issues/43/events","html_url":"https://github.com/ajafff/tslint-consistent-codestyle/issues/43","id":280326573,"number":43,"title":"Bug: `no-else-after-return` does not allow `else if`'s by default like ESLint's `no-else-return` does","user":{"login":"tbrisbane","id":12590804,"avatar_url":"https://avatars2.githubusercontent.com/u/12590804?v=4","gravatar_id":"","url":"https://api.github.com/users/tbrisbane","html_url":"https://github.com/tbrisbane","followers_url":"https://api.github.com/users/tbrisbane/followers","following_url":"https://api.github.com/users/tbrisbane/following{/other_user}","gists_url":"https://api.github.com/users/tbrisbane/gists{/gist_id}","starred_url":"https://api.github.com/users/tbrisbane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbrisbane/subscriptions","organizations_url":"https://api.github.com/users/tbrisbane/orgs","repos_url":"https://api.github.com/users/tbrisbane/repos","events_url":"https://api.github.com/users/tbrisbane/events{/privacy}","received_events_url":"https://api.github.com/users/tbrisbane/received_events","type":"User","site_admin":false},"labels":[{"id":488212322,"url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/labels/bug","name":"bug","color":"ee0701","default":true},{"id":764578064,"url":"https://api.github.com/repos/ajafff/tslint-consistent-codestyle/labels/feature%20request","name":"feature request","color":"6aa1d1","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-12-08T00:20:30Z","updated_at":"2018-03-28T09:16:14Z","closed_at":"2018-03-28T09:16:14Z","author_association":"NONE","body":"### Issue type\r\nBug\r\n### Version\r\n`v1.10.0`\r\n### Overview\r\nThe `no-else-after-return` rule seems to, by default, be issuing warnings when `else if`'s are used after `return` statements.\r\n\r\nThe [documentation for `no-else-after-return`](https://github.com/ajafff/tslint-consistent-codestyle/blob/master/docs/no-else-after-return.md) states that it \"Works like [no-else-return from eslint](http://eslint.org/docs/rules/no-else-return)\", and (at least for the current version of ESLint) the default behaviour of `no-else-return` allows `return` statements after `else if`'s.\r\n### Current behaviour\r\nWhen `no-else-after-return: true` is specified, the following code causes an `unnecessary else after return` warning to appear for me:\r\n```js\r\nconst val = Math.random();\r\n\r\nif (val > 0.5) {\r\n  return 1;\r\n} else if (val < 0.5) {\r\n  return -1;\r\n}\r\n\r\nreturn 0;\r\n```\r\n### Expected behaviour\r\nWhen `no-else-after-return: true` is specified, the above code should *not* issue a warning.\r\n\r\nIf `no-else-after-return: [true, { \"allowElseIf\": false }]` was specified, then the above code *should* issue a warning.\r\n### Additional context\r\nI use this rule as part of [tslint-config-airbnb](https://github.com/progre/tslint-config-airbnb/), which added `no-else-after-return` to their ruleset in `v5.4.1`."}}
{"actor":{"display_login":"ajafff"}}