Install and set Prettier as default formatter then Create .prettierrc file in your root directory and put this
{
"overrides": [
{
"files": "*.hbs",
"options": {
"parser": "html"
}
}
]
}
It will automatically format when you save the .hbs file.