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 upSemicolons #79
Comments
This comment has been minimized.
This comment has been minimized.
|
Thanks for the feedback. We no longer recommend starting lines with semicolons. It's hacky. Start lines with |
maxogden
closed this
Mar 24, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@goatslacker could you submit a test to clearly outline this? |
This comment has been minimized.
This comment has been minimized.
mattdesl
commented
Mar 24, 2015
|
I can't imagine a scenario where a line starts with a template string, or any of these other gotchas: + * / - ` , . But the readme and standard should discourage these explicitly from the start of the line. |
This comment has been minimized.
This comment has been minimized.
|
I don't mean to talk about scenarios where you would start a line with any particular character. I think starting lines with any character that fails ASI is poor style anyway. I'm just pointing this out. |

goatslacker commentedMar 24, 2015
FYI if you're on ES6 then you can't start lines with the template literal syntax either, so that needs to be preceded by a semicolon.
This is because if an identifier precedes the statement then the parser will parse it as a tagged template.
foo `trololol`is the same as
foo`trololol`