DEV Community


Discussion on: To Semicolon, Or Not To Semicolon;

emnudge profile image
EmNudge Author

I use prettier too, but only for personal projects. It gets messy when working with teams where some people don't use it and abide by their own style guides.
Using prettier in those cases can lead to messy looking commit logs, making it hard to decipher what was actually changed.

stereobooster profile image
stereobooster • Edited

Use pre commit hook for prettier. Code standard should be a team decision. My team uses prettier. We have two projects one with semicolons one without, but both use prettier. I can't care less about semicolons, I type any code I want and it gets formatted on save in VSCode

Thread Thread
aurelio profile image

Code standard should be a team decision.

Exactly, and if the decision is that Prettier is part of the tooling, then everyone touching the code needs to have it. In my team we make sure that every dev's IDE is configured to format on save.

If you have a pre-existing project and you don't want to get distracted by formatting changes on the diffs you can run prettier and then commit a mega-fix. From there on, no more distractions for formatting changes.

I'll be honest, I thought that Prettier was a nice-to-have for a long time, but now I can't imagine working on a project where it's not part of the tools.