Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false result for: return new Promise(async (resolve) => { #1006

Closed
liesislukas opened this issue Oct 26, 2017 · 3 comments

Comments

@liesislukas
Copy link

commented Oct 26, 2017

Doesn't work with this sample:

module.exports = function userLogin({email, password}) {
  return new Promise(async (resolve) => {
    ...
  });
};

It says

Expected parentheses around arrow function argument arrow-parens
for line with return new Promise...

@ematipico

This comment has been minimized.

Copy link
Contributor

commented Oct 27, 2017

I've never seen the statement async before an arrow function, especially inside a Promise. Do you have the same issue if you transform the arrow function in a normal function?

@liesislukas

This comment has been minimized.

Copy link
Author

commented Oct 30, 2017

No, without arrow function it works fine e.g.:

  return new Promise(async function foo(resolve) {

But I often use arrows and async together. This one is for demo only while function is actually synced but it doesn't work either:

const a = async () => {
  return 'foo bar baz';
};
@feross

This comment has been minimized.

Copy link
Member

commented May 3, 2018

Just tested and this is not an issue anymore. I believe it was fixed in standard version 11.

@feross feross closed this May 3, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.