Fixes formatting for go template files. The only peer dependency is prettier.
npm install --save-dev prettier-plugin-go-template
The following file types are detected automatically:
.gohtml
, .gotmpl
, .go.tmpl
, .tmpl
, .tpl
, .html.tmpl
To use it with GoHugo and basic .html
files, you'll have to override the used parser inside your .prettierrc
file:
{
"overrides": [
{
"files": ["*.html"],
"options": {
"parser": "go-template"
}
}
]
}