Most of solution that exist in the internet is tell you to create a task and call it using ctrl-shift-p menu.
This extension basically using htmlbeautifier to format your file using the Formatter API from the vscode, so no need to create a hack using Task, etc.
Features
Requirements
gem install htmlbeautifier
or
To use the gem with Bundler, add to your Gemfile:
gem 'htmlbeautifier'
NOTE: For you that have a filename with extension .html.erb, your file might be recognized as html file, not as erb file. In that case, add a setting in your settings.json like below: