Context matters, but this what I would do (and I always apply when landing in a project, own or client, that has no documented or enforced code style):
1/ always have pre-commit hooks running lint/fmt, and document how to implement them in a common fashion in the team,
2/ strive to follow the language conventions (and if not, have those divergences explicitly defined in the linter/formatter tool configuration), this helps the team to align with it,
3/ having a job server-side that blocks merging PRs that do not pass both of these steps.