Hacker News new | ask | show | jobs
by solardev 950 days ago
Oh, yeah, we had that issue too and solved it pretty successfully with `.editorconfig` (shareable between VScode and IntelliJ, https://editorconfig.org/) combined with `prettier`.

Each IDE is configured to:

- Not reformat code on its own

- Ignore whitespace

- Run `prettier` as a pre-commit hook

Those settings are saved to `.editorconfig` where possible, or to each IDE's repo-specific folder (e.g. `.idea`).

Then in theory each developer can use whatever IDE they want, whatever whitespace settings they want (tabs vs spaces), and the end code committed to the repo is still the same. It took a commit or three to set up and work out all the kinks, but afterward it ran flawlessly.

1 comments

I've suggested that twice now, but it's a couple of the more senior members on the team being resistant, so the feet dragging continues.
Don't worry, one day soon you'll become the senior and pass along the torment with your favorite code styles :) And thus the cycle continues...
I can't wait to mandate tabs over spaces, haha :D.