Proposed JavaScript Standard Style
41–50 of 116 posts
Re: Proposed JavaScript Standard Style
#42Earlier quoted context omitted.
Let's just say that coupling this preference with the name "standard" is an extremely contentious decision (search the github issues).
https://github.com/Flet/semistandard Of course the solution is to create a separate "standard."
I'm going to fork this and create my own standard...
Re: Proposed JavaScript Standard Style
#43Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting list.map(func1) .filter(func2) .map(func3) .reduce(func4); in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1). EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.
Re: Proposed JavaScript Standard Style
#44Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting list.map(func1) .filter(func2) .map(func3) .reduce(func4); in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1). EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.
Re: Proposed JavaScript Standard Style
#452 spaces for indentation? No :(
I always use a tab and set the IDE to show two spaces for each tab. Visual Studio has a setting for this. In the same project if someone wants 4, they can just change it to 4 spaces. In the file, its always stored as a tab
Re: Proposed JavaScript Standard Style
#46Re: Proposed JavaScript Standard Style
#47I've been lucky enough to avoid having to deal with a style guide in a long time. The general idea is sound, but such a guide is always accompanied by hours-long meetings of senior developers hurling their egos at each other over an issue like semicolon usage. Such a waste of everyone's time.
Re: Proposed JavaScript Standard Style
#48Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting list.map(func1) .filter(func2) .map(func3) .reduce(func4); in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1). EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.
The code works as expected.
Re: Proposed JavaScript Standard Style
#49Regarding the "no semicolon" stuff, is there actually any way to write this type of formatting list.map(func1) .filter(func2) .map(func3) .reduce(func4); in JavaScript? As far as I know, the semicolon rules would automatically terminate the statement after map(func1). EDIT: Ah, thanks – the things I read never mentioned JS doing lookahead during ASI. This makes it a lot nicer, tbh.
[0] Not true for "restricted productions", which include naked returns, and some other "special" cases.