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 upStarting Lines With Semicolons (ES6) #80
Comments
This comment has been minimized.
This comment has been minimized.
|
My opinion is if you have |
This comment has been minimized.
This comment has been minimized.
|
Ah, the wording led me to believe the tool would never allow it. Maybe listing it as a bullet point below "no semicolons" would be better, like:
It could link to a code example showing the ;[ approach next to the preferred alternative (with var or some assignment). And maybe a note about ES6 edge cases. |
This comment has been minimized.
This comment has been minimized.
|
@mattdesl not a bad idea, I think we might as well just change that whole line to link to a separate markdown file with more detail rather than try to explain complex stuff in the bullet list |
This comment has been minimized.
This comment has been minimized.
|
Let's add more detailed explanations of these edge cases on the wiki: https://github.com/feross/standard/wiki I'm going to close this now. Thanks for bringing this up, @mattdesl! |
feross
closed this
Apr 9, 2015
This comment has been minimized.
This comment has been minimized.
|
@feross You could pull the wiki into git for proper commits/PRs/etc. I tend to do that on my own projects since the wikis are a bit lacklusre. |
This comment has been minimized.
This comment has been minimized.
|
Thanks @mattdesl. Added a |
mattdesl commentedMar 24, 2015
Note: This isn't a question about whether to use ASI or not (already discussed #78).
@maxogden
Can you expand on this a bit more? To me
voidis confusing and code-smell-ish. I don't really see anything wrong with enforcing a preceding semicolon for[and(and disallowing lines starting with other operators (like regexes and template strings).Preceding semicolon:
Void: (does this even work??)
Avoiding it completely:
Aside from swapping variables, it can also be useful to write code like this: