prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.04k stars 446 forks source link

Add support for thymeleaf custom html tags/blocks #3294

Open dimaslanjaka opened 3 months ago

dimaslanjaka commented 3 months ago

Is your feature request related to a problem? Please describe. I develop spring boot with thymeleaf engine using VSCode+Redhat Java. in thymeleaf has new element blocks like <th:block> (https://stackoverflow.com/a/68204022/6404439)

my prettierrc.json

{
  "$schema": "https://json.schemastore.org/prettierrc",
  "printWidth": 120,
  "tabWidth": 2,
  "useTabs": false,
  "bracketSameLine": true,
  "bracketSpacing": true,
  "semi": true,
  "singleQuote": true,
  "trailingComma": "none",
  "endOfLine": "lf",
  "quoteProps": "as-needed",
  "htmlWhitespaceSensitivity": "css",
  "singleAttributePerLine": true,
  "overrides": [
    {
      "excludeFiles": [
        "*.min.js",
        "*.min.css",
        "*.min.html",
        "*.min.scss"
      ],
      "files": [
        "*.js",
        "*.css",
        "*.sass",
        "*.html",
        "*.md",
        "*.ts"
      ],
      "options": {
        "semi": true
      }
    },
    {
      "files": [
        "*.ejs",
        "*.html"
      ],
      "options": {
        "parser": "html"
      }
    }
  ]
}

Describe the solution you'd like I want format the html using Prettier VSCode Plugin.

Additional context

error while formatting custom html tags <th:block/> image image

successful without custom blocks image