Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upmaking () optional in constructor and space around methods/names (generators) #689
Comments
jimmywarting
changed the title
making () optional in constructor and space around methods/names
making () optional in constructor and space around methods/names (generators)
Nov 17, 2016
dcousens
added
the
enhancement
label
Nov 18, 2016
This comment has been minimized.
This comment has been minimized.
NACK because it adds 1 more way to do something with potential confusion thrown in for good measure.
which are often the type of functions you'll find, and distinguishing those concepts more strongly is less... "functional" IMHO :S |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the issue.
Standard isn't really about "optional". We prefer to encourage one way to do things, whenever there is an eslint that allows us to enforce this. Ditto to your second question. Standard has spaces around the stars in generators, in all situations. |
jimmywarting commentedNov 17, 2016
•
edited
I have two questions
()when constructing a new object without argumentslike this:
So I'm just wondering why you haven't thought about making it optional...
functions... I could agree with space afterfunctionand thenamebut ever since I have found out about this nice async-class i have been writing lots of class methods that are generators, much like dose the examples in the other github pageLet me demonstrate what i have:
But today i try to use async/await if possible but it still comes times where i use
*when i want to support for...of for exampleWith your set of rules you would need space after the
*and the method nameI think this looks very weird to me having a loose hanging
*in the beginning with space around them. Don't you agree?The code starts at the same index as the method name
It's almost as if you where to write code like this
(quite idiotic but i try to prove my point and make you feel what i feel)