DEV Community

loading...

Discussion on: Semicolons in JavaScript: To Use or Not to Use?

Collapse
elarcis profile image
Elarcis

I prefer using semicolons, always:

  • It's easier to just put one without wondering if it's needed
  • I'm more comfortable with formating tools when they add stuff than when they remove it.

I even push it further, and always use trailing commas when they're at the end of a line (like Prettier does with the "trailingComma": "all" setting), mainly because adding items to arrays and argument lists only highlights the new lines in source control (while not using trailing commas also highlights untouched lines where a comma was added).