NiklasPor / prettier-plugin-go-template

Fixes prettier formatting for go templates 🐹

Home Page:prettier-plugin-go-template-niklaspor.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.prettierrc format problem in documentation

behnamgolds opened this issue · comments

I followed the README and the issue referenced to solve the installation problem, and yet in the README file it says to put the config in the .prettierrc file like this :

// .prettierrc
{
  "plugins": ["prettier-plugin-go-template"]
}

but when I did that the prretier plugin threw a bunch of errors about invalid config file format.

Seems that the config file should be in YAML format and not JSON. So I changed the file like this:

---
goTemplateBracketSpacing: true
plugins:
  - prettier-plugin-go-template

Seems there is an upstream prettier plugin change in the config file parsing that should be reflected here in the documentation.

Weird, the prettier docs still state that json or yml are ok:

image

https://prettier.io/docs/en/configuration.html

I din't follow up on that , but yeah it says JSON too! I don't know maybe I did something wrong the first time. But I'm sure my json config was correct.