In terms of tooling how should we set this up?
FWIW, I've been using a pre-commit hook with
lint-staged in a bunch of projects and it's been nothing but awesome so far. I can code however I like, and in the end I commit and it's formatted however the project wants it. 👌
While I understand the concern about loosing work, the chance of prettier removing something at all is tiny, and then to remove something that's critical and you can't trivially reproduce based on the context is... highly unlikely.
In my opinion, the cost of having to comment under many PRs with failed CIs because the submitters forgot to run prettier is higher than the potential to loose critical, irreplaceable work. This is subjective, so take it with a grain of salt, but I think it makes sense to run it in a pre commit hook.
... read the whole story at github.com.