{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/7547","repository_url":"https://api.github.com/repos/eslint/eslint","labels_url":"https://api.github.com/repos/eslint/eslint/issues/7547/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/7547/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/7547/events","html_url":"https://github.com/eslint/eslint/pull/7547","id":187544402,"number":7547,"title":"New: `no-return-await` rule. (fixes #7537)","user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"labels":[{"id":131106229,"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc","default":false},{"id":45711352,"url":"https://api.github.com/repos/eslint/eslint/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":253473350,"url":"https://api.github.com/repos/eslint/eslint/labels/feature","name":"feature","color":"bfd4f2","default":false},{"id":45798639,"url":"https://api.github.com/repos/eslint/eslint/labels/rule","name":"rule","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-06T06:00:26Z","updated_at":"2016-11-06T09:39:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/7547","html_url":"https://github.com/eslint/eslint/pull/7547","diff_url":"https://github.com/eslint/eslint/pull/7547.diff","patch_url":"https://github.com/eslint/eslint/pull/7547.patch"},"body":"**What is the purpose of this pull request? (put an \"X\" next to item)**\r\n\r\n[ ] Documentation update\r\n[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/bug-report.md))\r\n[x] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-proposal.md))\r\n[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-change-proposal.md))\r\n[ ] Add autofixing to a rule\r\n[ ] Add a CLI option\r\n[ ] Add something to the core\r\n[ ] Other, please explain:\r\n\r\n**Please describe what the rule should do:**\r\nInside an `async function`, `return await` is useless. Since the return value of an `async function` is always wrapped in `Promise.resolve`, `return await` doesn't actually do anything except add an extra tick before the overarching promise resolves/rejects. This pattern is almost certainly due to programmer ignorance of the return semantics of `async function`s.\r\n\r\n**What category of rule is this? (place an \"X\" next to just one item)**\r\n\r\n[ ] Enforces code style\r\n[ ] Warns about a potential error\r\n[x] Suggests an alternate way of doing something\r\n[ ] Other (please specify:)\r\n\r\n**Provide 2-3 code examples that this rule will warn about:**\r\n\r\n```js\r\nasync function foo() {\r\n  return await bar;\r\n}\r\n```\r\n\r\nin favor of:\r\n```js\r\nasync function foo() {\r\n  return bar;\r\n}\r\n```\r\n\r\n**Why should this rule be included in ESLint (instead of a plugin)?**\r\nPeople are very anxious to use `await`, and will likely overuse it. This rule prevents a common hazard, and also helps educate developers about how `async function` works.\r\n\r\n**What changes did you make? (Give an overview)**\r\nI added a rule file, a test file, and a docs file. The rule checks for return statements whose argument is an await expression.\r\n\r\n**Is there anything you'd like reviewers to focus on?**\r\n¯\\\\\\_(ツ)_/¯"},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/258669925","html_url":"https://github.com/eslint/eslint/pull/7547#issuecomment-258669925","issue_url":"https://api.github.com/repos/eslint/eslint/issues/7547","id":258669925,"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":"2016-11-06T09:39:42Z","updated_at":"2016-11-06T09:39:42Z","body":"LGTM"}}
{"actor":{"display_login":"eslintbot"}}