logoalt Hacker News

stack_framertoday at 12:05 AM1 replyview on HN

I never actually type semicolons in my JavaScript / TypeScript. In work projects, my IDE adds them for me thanks to the linter. In personal projects, I just leave them out (I don't use a linter, so my IDE does not add them), and I've never had a problem. Not even once.

Semicolon FUD is for the birds.


Replies

jfengeltoday at 12:14 AM

I occasionally run into problems with JS weird parsing rules. My favorite is:

    return
        x 
Which does not return. It returns undefined.

Typescript helps a lot with that. A linter will probably flag it as well. Still, JS went way out of its way to accept just about anything, whether it makes sense or not.

show 1 reply