In the document:
Vetur bundles all the above formatters. When Vetur observes a local install of the formattesr, it'll prefer to use the local version.
Is that means vetur has a built-in prettier and prettier-eslint and I can use all features by installing vetur in VS Code without run yarn add prettier-eslint?
I follow the document to setup veturin VS Code, however the formatting feature does not work well when I press Format Document shortcut (shift+alt+F). It format the code in a different rule fromeslintrc.js. If I press Ctrl + S, the code can be formatted properly. And after I run yarn add prettier-eslint, everything works well.
I' m confused that do I have to install a formatter locally to format code with eslint ?
part of settings.json:
{
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
"eslint.autoFixOnSave": true,
"vetur.validation.template": false,
"vetur.format.defaultFormatter.js": "prettier-eslint",
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true,
"semi": false,
"eslintIntegration": true
}
}
}
however the formatting feature does not work well when I press Format Document shortcut (shift+alt+F)
What's the input, and what's the output of Format Document and output of format on save?
I've noticed as well that I had to specifically install prettier-eslint in my local packages for vetur to honour the .eslintrc.js config:

So, without prettier-eslint locally installed I get:

With prettier-eslint locally installed I get:

According to the text here
VSCode ESLint and TSLint Integration
prettier-eslint and prettier-tslint are included with the installation of this extension. There is no need for a separate local or global install of either for functionality.
which I guess causes the confusion.
Thank you!
Most helpful comment
I've noticed as well that I had to specifically install
prettier-eslintin my local packages for vetur to honour the.eslintrc.jsconfig:So, without

prettier-eslintlocally installed I get:With

prettier-eslintlocally installed I get:According to the text here
which I guess causes the confusion.
Thank you!