3 ms·
That doesn't sound like a good idea (after all, there can only be one codebase in source control) but I believe it actually would be possible – and in fact, pre
by rattray 10y ago
That doesn't sound like a good idea (after all, there can only be one codebase in source control) but I believe it actually would be possible – and in fact, prettier would be a vital component to making it happen.
If you have a pair of particularly persnickety peers, you could theoretically:
1) run prettier with the company-wide config as a precommit hook (https://github.com/prettier/prettier#pre-commit-hook-for-changed-files https://github.com/prettier/prettier#pre-commit-hook-for-cha...)
2) instruct your colleagues to have their editor run prettier with their own preferences on save.
This way, your colleagues can simply open a file locally and save it to see things their way – and the code will be back to company-normal when they commit. They'll still have to see that unbearable bracket-spacing during code review, of course.
Prettier doesn't have many configuration options (intentionally!) so they'd probably opt to use prettier-eslint or similar, which allows more configuration (at the cost of speed).
Hopefully, after trying this, they would come to the conclusion that life is better just using the defaults, two-space-indents be damned. Bikesheds are great places for compromise.