Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter for Go templates #529

Open
peaceiris opened this issue May 11, 2022 · 0 comments
Open

Formatter for Go templates #529

peaceiris opened this issue May 11, 2022 · 0 comments
Labels
dependencies-npm enhancement New feature or request

Comments

@peaceiris
Copy link
Owner

peaceiris commented May 11, 2022

Formatter for Go templates - tips & tricks - HUGO
NiklasPor/prettier-plugin-go-template: Fixes prettier formatting for go templates 🐹

npm i -D prettier prettier-plugin-go-template
vim .prettierrc
{
  "overrides": [
    {
      "files": ["*.html"],
      "options": {
        "parser": "go-template",
        "goTemplateBracketSpacing": true,
        "bracketSameLine": true
      }
    },
    {
      "files": ["*.js", "*.ts"],
      "options": {
        "useTabs": true,
        "printWidth": 120,
        "singleQuote": true
      }
    }
  ]
}
@peaceiris peaceiris added enhancement New feature or request dependencies-npm labels May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies-npm enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant