{"action":"created","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1813","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1813/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1813/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1813/events","html_url":"https://github.com/jscs-dev/node-jscs/issues/1813","id":108604607,"number":1813,"title":"\"Illegal space before opening round brace\" for async anonymous functions","user":{"login":"donaldpipowitch","id":1152805,"avatar_url":"https://avatars.githubusercontent.com/u/1152805?v=3","gravatar_id":"","url":"https://api.github.com/users/donaldpipowitch","html_url":"https://github.com/donaldpipowitch","followers_url":"https://api.github.com/users/donaldpipowitch/followers","following_url":"https://api.github.com/users/donaldpipowitch/following{/other_user}","gists_url":"https://api.github.com/users/donaldpipowitch/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldpipowitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldpipowitch/subscriptions","organizations_url":"https://api.github.com/users/donaldpipowitch/orgs","repos_url":"https://api.github.com/users/donaldpipowitch/repos","events_url":"https://api.github.com/users/donaldpipowitch/events{/privacy}","received_events_url":"https://api.github.com/users/donaldpipowitch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-28T07:49:41Z","updated_at":"2015-09-28T07:52:18Z","closed_at":null,"body":"Using `2.1.1` and `\"esnext\": true,` this example doesn't work, but is compiled by Babel:\r\n\r\n````\r\n// Illegal space before opening round brace\r\nbeforeEach(async function() {\r\n  await doFoo();\r\n});\r\n````\r\n\r\nHowever these alternatives work:\r\n````\r\nbeforeEach(function() {\r\n  doFooSync();\r\n});\r\n````\r\n````\r\nbeforeEach(async function beforeEach() {\r\n  await doFoo();\r\n});\r\n````\r\n````\r\nbeforeEach(async () => {\r\n  await doFoo();\r\n});\r\n````\r\n\r\nWhen `beforeEach(function() {` works, I'd expect `beforeEach(async function() {` to work, too.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26995126-illegal-space-before-opening-round-brace-for-async-anonymous-functions?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/comments/143663300","html_url":"https://github.com/jscs-dev/node-jscs/issues/1813#issuecomment-143663300","issue_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1813","id":143663300,"user":{"login":"donaldpipowitch","id":1152805,"avatar_url":"https://avatars.githubusercontent.com/u/1152805?v=3","gravatar_id":"","url":"https://api.github.com/users/donaldpipowitch","html_url":"https://github.com/donaldpipowitch","followers_url":"https://api.github.com/users/donaldpipowitch/followers","following_url":"https://api.github.com/users/donaldpipowitch/following{/other_user}","gists_url":"https://api.github.com/users/donaldpipowitch/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldpipowitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldpipowitch/subscriptions","organizations_url":"https://api.github.com/users/donaldpipowitch/orgs","repos_url":"https://api.github.com/users/donaldpipowitch/repos","events_url":"https://api.github.com/users/donaldpipowitch/events{/privacy}","received_events_url":"https://api.github.com/users/donaldpipowitch/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T07:52:18Z","updated_at":"2015-09-28T07:52:18Z","body":"Could be related to https://github.com/jscs-dev/node-jscs/issues/1637, because auto-fixing results in `beforeEach(asyncfunction() {`. I'll try it."}}