There's a discussion going around in management about creating a common style guide for our source code. Currently the only style that is enforced is that we use spaces instead of tabs and the length is two spaces per indentation level. Everything else is informal convention and there's a lot of subtle variation across the codebase.
We primarily use C# and SQL. I'm curious if you have to abide by a style guide and if you've encountered any pitfalls when enforcing a standard like that.
We use eslint with a set of airbnb and unicorn rules. We went from the recommended rules and changed a few settings. Most of the rules will reformat or fix the code automatically so it's not a huge problem during development. If it's not automatically fixed, you will still have a link to the documentation explaining why the rule exists. You also cannot merge to the main branch if the linter is not happy.
And I recently started to write custom eslint rules too, it's not very difficult and it's fun.