I do love me some SQL Prompt from Redgate Software. It does more than just format the code. It also provides type-ahead, supports Azure SQL Database and Managed Instances, has code analysis, snippets, more. It's a very complete method for programming T-SQL, not just a formatter.
I loved it even before I went to work for them. Yes, I work for them.