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
why airbnb is using yet semicolons? #1567
Comments
I'm not sure where you've read that, and it's quite false. Using semicolons is something the vast majority of JS devs do, despite the recent rise in usage of "standardJS" - something that is not actually a standard, nor something that aligns with what the majority of JS devs do in a number of ways. The professional and modern thing to do is not to omit optional tokens, but to always use them, since explicit > implicit. |
Additionally, not using semicolons can rise a series of unexpected bugs, take this line of code for example:
This results in an error, although the expected is to log the obj. |
This comment has been minimized.
This comment has been minimized.
I started a new project without using semicolons and after a few days I switched back to using semicolons for a simple reason: With semicolons, you get better parser, and in case of TypeScript, compiler messages. Let's say you have forgotten a closing parenthesis on one line and went to the next line. The compiler may tell you that it expects a comma at the end of the line for an optional parameter, but if you closed the line with a semicolon, it will tell you that it expects a closing parenthesis. Also, I find it easier to skim through the code when lines are ended with semicolons. |
I've read moderns apps don't use anymore semicolons, maybe in the future airbnb style too ? maybe with https://standardjs.com/ ?
The text was updated successfully, but these errors were encountered: