DEV Community

Discussion on: Do you use semicolon in JS?

Collapse
 
crongm profile image
Carlos Garcia ★ • Edited

I've always used semicolons. The first time I heard about this new trend of not writing them, to be honest I found it quite dumb, like it made no sense. When I asked for the reasoning behind it on Twitter the only two kind of answers I got were "because they're not necessary" and "it saves you time". I wondered, how many seconds can you save in a day by not writing semicolons?

Then I landed on a project which codebase did not use semicolons. I did not bat an eye to it and just went along with being in a "modern" and "cool" project.

That is, until we got around to define our linting and auto-fix rules, when everyone agreed semicolons should be added on file formatting. What was the point then?

I guess it all comes down to personal preference, but as others have said, consistency is the most important thing.