vscode .vue文件格式配置 使其与webstorm设置一致

时间:2022-07-22
本文章向大家介绍vscode .vue文件格式配置 使其与webstorm设置一致,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
{
  "files.autoSave": "afterDelay",
  "editor.renderControlCharacters": true,
  "workbench.iconTheme": "material-icon-theme",
  "window.zoomLevel": 0,
  "[html]": {
    "editor.defaultFormatter": "HookyQR.beautify"
  },
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features",
  },
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "remote.SSH.showLoginTerminal": true,
  "remote.SSH.remotePlatform": {},
  "remote.SSH.enableAzureIntegration": true,
  "sonarlint.ls.javaHome": "c:\Users\杨东楠\.vscode\extensions\sonarsource.sonarlint_managed-jre\jre\jdk-11.0.7+10-jre",
  "editor.tabSize": 2,
  "editor.detectIndentation": false,
  "editor.wordWrap": "off",
  "editor.tabCompletion": "on",
  "workbench.colorTheme": "Atom One Dark",
  "editor.formatOnType": true,
  "editor.formatOnPaste": true,
  "editor.renderWhitespace": "all",
  "beautify.config": "",
  "explorer.confirmDelete": false,
  "files.associations": {
    ".vue": "html",
    ".ts": "ts",
  },
  //在文件末尾自动插入空白行
  "files.insertFinalNewline": true,
  //自定义格式化选项 tab缩进 此处设置后上面的将不生效
  "vetur.format.options.tabSize": 2,
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      //自动换行
      "wrap_attributes": "auto",
      "wrap_attributes_mode": "auto",
      //换行最大长度
      "wrap-line-length": 120,
      "wrapped_attributes_per_line": "multiple",
      "wrapped_attributes_indent": "auto",
      "wrapped_attributes_end": "auto"
    },
    "prettier": {
      //强制设置单引号
      "singleQuote": true,
      //尾部是否加分号
      "semi": true,
      "printWidth": 100,
    },
    "prettyhtml": {
      "printWidth": 100,
      "singleQuote": false,
    }
  },
  "emmet.includeLanguages": {
    "vue": "html",
  },
  "vetur.format.options.useTabs": true,
  //默认script标签缩进
  "vetur.format.scriptInitialIndent": true,
  //默认style标签缩进
  "vetur.format.styleInitialIndent": true,
  "vetur.grammar.customBlocks": {
    "docs": "md",
    "i18n": "json"
  },
}