vscode prettier格式化vue中解构格式错乱

新手上路,请多包涵

问题描述

vscode prettier格式化vue中 解构 格式错乱

clipboard.png

这个是配置文件:

"eslint.alwaysShowStatus": true,
"eslint.options": {
    "plugins": ["html", "vue"],
    "configFile": "./.eslintrc.js"
},
"eslint.validate": [
    "javascript",
    "javascriptreact",
    "scss",
    "sass",
    "css",
    {
        "language": "html",
        "autoFix": true
    },
    {
        "language": "vue",
        "autoFix": true
    }
],
"eslint.autoFixOnSave": true,
"prettier.singleQuote": true,
"prettier.jsxSingleQuote": true,
"prettier.useTabs": false,
"prettier.eslintIntegration": true,
"prettier.trailingComma": "es5",
"prettier.tabWidth": 2,
"prettier.arrayExpand": true,
"prettier.arrowParens": "avoid",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
        "wrap_attributes": "auto"
    },
    "prettyhtml": {
        "printWidth": 100,
        "singleQuote": false,
        "wrapAttributes": false,
        "sortAttributes": true
    }
},
"vetur.format.defaultFormatter.js": "prettier-eslint",
"beautify.config": {
    "brace_style": "collapse,preserve-inline"
},
"editor.formatOnPaste": true,
"editor.formatOnType": true,
"terminal.integrated.shell.osx": "zsh",
"editor.formatOnSave": true,
"editor.fontWeight": "500"
阅读 3.1k
1 个回答

试试把这个改下

"vetur.format.defaultFormatter.js": "vscode-typescript"
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题