D
D
Dmitry Belousov2019-07-03 10:39:18
Vue.js
Dmitry Belousov, 2019-07-03 10:39:18

Why doesn't the vsc+vetur+prettier bundle properly format the script section in .vue?

Good afternoon.
I'm trying to set up VSC, set vetur, eslint and prettier, enabled html, script and style formatting in "prettier" in vetur, set "prettier.singleQuote": true in prettier.
It formats .js files perfectly when saved, formats the template section perfectly in .vue files, and puts a semicolon at the end of the line and double quotes in the script section, although the semicolon is disabled in prettier, and the quotes must be single. I turn off formatting of the script section in vetur - naturally, auto-formatting disappears.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belousov, 2019-07-04
@dixdix

Helped in config
"vetur.format.defaultFormatterOptions": {
"vetur.format.options.tabSize": 2,
"vetur.format.options.useTabs": false,
"prettier": {
"singleQuote": true,
"semi" : false
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question