TFS is an extension that will format your terraform code when you save your .tf files.
It's simply runs terraform fmt <path-to-your-current-file> or tofu fmt <path-to-your-current-file> before saving your .tf or .tfvars files.
Terraform or tofu installed.