Prettier-vscode: Vue template support not working in 1.7.2

Created on 13 Nov 2018  路  5Comments  路  Source: prettier/prettier-vscode

Prettier VS Code v. 1.7.2
Visual Studio Code 1.29.0

When I open a *.vue file, only the JS and CSS part gets prettied on save, but not the vue template part.

In the last version this should be supported.

Am I doing something wrong?

locked

Most helpful comment

disable "Vetur" vscode extension

or

  "vetur.format.defaultFormatter.html": "none",
  "vetur.format.defaultFormatter.css": "none",
  "vetur.format.defaultFormatter.postcss": "none",
  "vetur.format.defaultFormatter.scss": "none",
  "vetur.format.defaultFormatter.less": "none",
  "vetur.format.defaultFormatter.stylus": "none",
  "vetur.format.defaultFormatter.js": "none",
  "vetur.format.defaultFormatter.ts": "none"

All 5 comments

Things which can go wrong:

  • By default this extension does not format 'vue' files
  • It can conflict with other formatting extension (Vetur?)
  • An older prettier version (<1.15.0) is installed in your project

OK, it works now (i had to do two things):

  • "prettier.disableLanguages": [], inside my global vscode settings
  • disable "Vetur" vscode extension

disable "Vetur" vscode extension

or

  "vetur.format.defaultFormatter.html": "none",
  "vetur.format.defaultFormatter.css": "none",
  "vetur.format.defaultFormatter.postcss": "none",
  "vetur.format.defaultFormatter.scss": "none",
  "vetur.format.defaultFormatter.less": "none",
  "vetur.format.defaultFormatter.stylus": "none",
  "vetur.format.defaultFormatter.js": "none",
  "vetur.format.defaultFormatter.ts": "none"

I've done all of this but still prettier only formats the javascript and css portions of my .vue files, it doesn't format the html inside the template tags

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SkeLLLa picture SkeLLLa  路  4Comments

Tanmccuin picture Tanmccuin  路  3Comments

vesper8 picture vesper8  路  3Comments

sebastijandumancic picture sebastijandumancic  路  4Comments

GantMan picture GantMan  路  3Comments