Formatting of JavaScript in .vue files is broken after release of Prettier 1.13.0
See original GitHub issueInfo
- Platform: macOS
- Vetur version: 0.12.3
- VS Code version: 1.23
Problem
Formatting of JavaScript in the <script>
block is broken with the release of Prettier 1.13.0. Format Document does not make any corrections.
In contrast, the <style>
block is being formatted as expected.
Installing Prettier 1.12.1 in the project and reloading VSCode fixes the issue:
npm install -D -E prettier@1.12.1
Reproducible Case
- Create a VueJs project by running
vue init webpack-simple
and accepting the defaults. - Open App.vue and introduce a misalignment or a trailing space inside the
<script>
block. - Run “Format Document”.
- Observe that no corrections are made in the
<script>
block. - Install Prettier 1.12.1 using the npm command given above and reload the window.
- Run “Format Document”.
- Observe that the formatting issues added in step 2 are corrected.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:13 (5 by maintainers)
Top Results From Across the Web
VSCode prettier/vue formatting settings don't work properly
and my formatter is causing the " at the end of the line after "...isInteger(quantity)" to be line-broken which breaks my entire component's ......
Read more >Prettier | WebStorm Documentation - JetBrains
Prettier is a tool to format .js, .ts, .css, .less, .scss, .vue, and .json code. With WebStorm, you can format selected code fragments...
Read more >How To Configure ESLint and Prettier for Vue.js - DigitalOcean
First, you'll want to install prettier globally from NPM, if you haven't already. It can be installed on a per-project basis, but that's...
Read more >prettierx | Yarn - Package Manager
(with some prettierX language-js updates now based on Prettier 2.3.2). with some updates including: switch to pure CSS parser using PostCSS 8 (see...
Read more >ESLint and Prettier with Vite and Vue.js 3 - Vue School Blog
We just need to install the eslint-config-prettier config. This disables the formatting rules in ESLint that Prettier is going to be responsible ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same problem,so I changed the setting
it works well.
@octref I upgraded the Prettier VSCode extension, which now uses prettier@1.13.4, and I’m still running into the same error as well.