Skip to content

code in <script> tag with go templates are not formattedΒ #119

@shaozi

Description

@shaozi

If there is go template in a <script> block, the whole block will not be formatted.

 <script>
let x = {{.X}}
let y = x++
</script>

The above block will not be formatted. Prettier output does not show errors.

Everything else works fine.

Version

β”œβ”€β”€ prettier-plugin-go-template@0.0.15
└── prettier@3.5.1

.prettierrc

{
  "plugins": ["prettier-plugin-go-template"],
  "overrides": [
    {
      "files": ["*.html"],
      "options": {
        "parser": "go-template",
        "bracketSameLine": true
      }
    },
    {
      "files": ["*.js", "*.ts", "*.html"],
      "options": {
        "semi": false,
        "singleQuote": true
      }
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions