dotnet format[0] with .editorconfig should do the job.
[0]: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-f...