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

generator function #568

Closed
perguth opened this issue Jul 15, 2016 · 6 comments

Comments

@perguth
Copy link

commented Jul 15, 2016

function* lonelyGenerator () {
  yield "Standard doesn't like me... ꒰•̥̥̥̥̥̥̥ ﹏ •̥̥̥̥̥̥̥̥๑꒱"
}
var gen = lonelyGenerator()
console.log(gen.next().value)
standard: Use JavaScript Standard Style (http://standardjs.com)
  /Users/user/Desktop/test.js:1:9: Missing space before *.

function*

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2016

Reckon this should do the trick:

function * lonelyGenerator () {}
@perguth

This comment has been minimized.

Copy link
Author

commented Jul 15, 2016

Yes, that works but I can hardly think that this is what we want 🙈

@saadq

This comment has been minimized.

Copy link

commented Jul 16, 2016

Personally, I would also prefer either function* lonelyGenerator () {} or function *lonelyGenerator () {}.

But I think the point of standard is that the style rules are already chosen and we have a consensus to follow them instead of arguing about arbitrary spacing and such.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 18, 2016

This is actually an intentional decision. It makes the * stand out more. It's been part of standard for several releases now.

@feross feross closed this Jul 18, 2016

@perguth

This comment has been minimized.

Copy link
Author

commented Jul 18, 2016

This is actually an intentional decision.

Oh, good to know. But weird. Let's see how that feels after a couple of uses.

@feross

This comment has been minimized.

Copy link
Member

commented Jul 18, 2016

Sounds good 👍

@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.