I think it depends on the ecosystem. e.g. Ruby guidelines is to write with 2 spaces. And consistency is important.
For HTML, JS and CSS I switched a couple of years ago from tabs (that show 4 spaces) to 2 spaces. I still use the tab key, Sublime Text converts it to 2 spaces. More and more web open source projects adapted 2 spaces. It has become a standard, and if you can't beat them, join them.
Same for JS camelCase, CSS dash-case, ruby snake_case, react PascalCase. Do whatever is the standard in the ecosystem.