Can't make it work in VSCode on gohtml with pnpm
BigBoulard opened this issue · comments
Hi,
Here are the steps I've walked through:
package installation (globally)
> pnpm i -g prettier-plugin-go-template
WARN prettier-plugin-go-template has no binaries
+ prettier-plugin-go-template 0.0.13
get the global pnpm node_modules path
> pnpm root -g
/users/me/Library/pnpm/global/5/node_modules
set Prettier: Prettier Path in VSCode
/users/me/Library/pnpm/global/5/node_modules/prettier
Add a .prettierrc
config file
{
"overrides": [
{
"files": ["*.gohtml"],
"options": {
"parser": "go-template"
}
}
],
"goTemplateBracketSpacing": true
}
outcome: nothing. Prettier is not available for .gohtml files
You might be missing the plugin part in the config:
{
"plugins": ["prettier-plugin-go-template"],
"overrides": [
{
"files": ["*.html"],
"options": {
"parser": "go-template"
}
}
]
}
Do also note that I am using this with just html files and I've configured the following in my user settings json:
"files.associations": {
"*.tmpl": "html",
"*.gohtml": "html"
}
that way, gohtml is treated as just html in VSCode. I haven't yet managed to make the plugin work myself, but perhaps the above is an approach for you.