Force Prettier to place inner text on new line without trailing > Force Prettier to place inner text on new line without trailing > vue.js vue.js

Force Prettier to place inner text on new line without trailing >


Adding this to the .prettierrc or .prettierrc.json file seems to fix this kind of issue:

"htmlWhitespaceSensitivity": "ignore"

Yours would look like this:

{  "trailingComma": "none",  "tabWidth": 2,  "semi": false,  "singleQuote": true,  "htmlWhitespaceSensitivity": "ignore"}

To understand better if this is a good solution for you, you can read about this topic: Whitespace-sensitive formatting


Need to modify the printwidth option in the prettier, but you need to aware of the below thing

There are some edge cases, such as really long string literals, regexps, comments and variable names, which cannot be broken across lines (without using code transforms which Prettier doesn’t do). Or if you nest your code 50 levels deep your lines are of course going to be mostly indentation :) - prettier

https://i.stack.imgur.com/GjBGG.png