DEV Community

Discussion on: Does your team have a formatting standard?

Collapse
 
nicolasini profile image
Nico S___

Is very important to have a formatter with rules that get enforced either when files are saved via IDE tools or when committing code to the source repository. The rules should also be kept in the repository alongside the code. This way there is no room for discussions and nobody has to think about it, code gets formatted, period.

We have a NodeJS codebase, and we are using Prettier for formatting, enforced on a GIT hook when we commit the code.

Collapse
 
theothertimduncan profile image
Tim

Thanks for the response. I do have my rules documented and in the same repo for my projects. But one challenge is getting people to read and follow them much less trying to implement something that requires action on their part. It's also nice to see at least one place that both recognizes the value and has taken action to make it a non-issue.