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

Disallow async functions which have no await expression (require-await) #738

Closed
feross opened this issue Jan 7, 2017 · 5 comments

Comments

@feross
Copy link
Member

commented Jan 7, 2017

Async functions which have no await expression may be the unintentional result of refactoring. This rule warns async functions which have no await expression.

http://eslint.org/docs/rules/require-await

@feross feross added the enhancement label Jan 7, 2017

@feross feross added this to the standard v9 milestone Jan 7, 2017

@not-an-aardvark

This comment has been minimized.

Copy link

commented Jan 11, 2017

It might be worth reviewing this discussion before adding this rule to Standard.

@feross

This comment has been minimized.

Copy link
Member Author

commented Jan 11, 2017

@not-an-aardvark Good point. We actually didn't add require-yield to standard because, despite what that eslint issue thread says, there apparently are use cases for generators without yield, namely when interacting with third-party libraries that expect a generator. See #192 (comment)

For that reason, maybe we should also refrain from this rule, since it's very similar in spirit.

Those who upvoted, do you have any new thoughts? (@timoxley, @ifraixedes, @LinusU, @dougwilson)

@LinusU

This comment has been minimized.

Copy link
Member

commented Jan 11, 2017

Hmm, that was actually very good points. I think I'm leaning towards not enabling this rule now :)

@junosuarez

This comment has been minimized.

Copy link

commented Jan 12, 2017

I would be against adding this to standard. I use async to mean "this function is gonna return a promise no matter what," not "I intend to use await in the body of this function."

@feross

This comment has been minimized.

Copy link
Member Author

commented Jan 13, 2017

Thanks for the feedback @LinusU and @jsdnxx. Closing this for now.

@feross feross closed this Jan 13, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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