question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updated prettier today and html formatter no longer works

See original GitHub issue
  • [x ] I have searched through existing issues
  • [x ] I have read through docs
  • [x ] I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.11.6
  • VS Code version: 1.19.2
  • Prettier Vs Code: 1.1.2

Problem

my configuration below no longer works after updating prettier

"vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "indent_size": 2,
      "end_with_newline": false,
      "wrap_attributes": "force-aligned",
      "wrap_attributes_indent_size": 2,
      "editorconfig": true
    }
  }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
CiGitcommented, Jan 18, 2018

Hello Vetur users!

Since prettier-vscode@1.1 we register a formatter for “vue” files (prettier@1.10). It seems it’s interacting badly with Vetur which does the same… (and seems we are wining the formatter battle ✌️ ) You can disable prettier on vue files prettier.disableLanguages: ["vue"] (restart vscode) and continue to use Vetur’s formatter which also formats the html template part of your SFC. Prettier only takes care of script and style part.

I don’t know if you can do the opposite tho.

4reactions
hunmarcommented, Sep 19, 2018

I just tried prettier "vetur.format.defaultFormatter.html": "prettier" and it works for html part

vetur@0.12.6 prettier@1.6.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier not formatting HTML files in VS Code - Stack Overflow
Long Answer: Most of the times the reason why Prettier doesn't work is that you have a markup error. ex: you haven't close...
Read more >
Format on Save (prettier) stopped working with latest update
Same thing happened to me just now. I set prettier as the Default Formatter in Settings and it started working again. My Default...
Read more >
How to fix Prettier Extension not working issue in VS CODE
0:00 · New ! Watch ads now so you can enjoy fewer interruptions. Got it.
Read more >
Prettier extension not working on HTML files : r/vscode - Reddit
First make sure that you don't have multiple extensions to format html files. Uninstall the ones that you don't need - or at...
Read more >
Prettier not working in VSCode – possible fixes - LinuxPip
Set Prettier as Default Formatter. VSCode have a huge ecosystem of extensions, which includes numerous formatters for multiple different ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found