DEV Community

Discussion on: Do you use semicolon in JS?

Collapse
 
stephanie profile image
Stephanie Handsteiner

When I join a codebase I use whatever the codebase defines, to keep it consistent within.

As for my own projects, yes, I always use semicolons and have setup my linting config in a way to respect that. I just like my semis! πŸ™‚

Collapse
 
javien profile image
Javien Lee • Edited

Frankly, it's not a big deal to follow the rules they already use. Thank you πŸ‘

Collapse
 
fjones profile image
FJones

This. Evidently, adapt to the prevalent style in the codebase, and be consistent with it. But I also prefer using them and enforcing them through linting rules. In fact, I'm currently in the process of adding linter rules to the codebase I was just put in charge of, and semicolons are on the list of rules to enable as soon as I have time to resolve the existing inconsistencies.

Collapse
 
javien profile image
Javien Lee

It's true linter makes us not fall into conflictπŸ˜‚ And as one of the people who uses semicolons, may I ask why you prefer to use semicolons?

Thread Thread
 
fjones profile image
FJones

For a start, semicolons are more readable - they terminate a statement, regardless of indentation confusing things. But also because, for me at least, omitting them takes more thought than just adding them, so it's a timesink, too.