vscode 自动化格式代码






5.拷贝到settings.json

{
  // tab 大小为2个空格
  "editor.tabSize": 2,
  // 100 列后换行
  "editor.wordWrapColumn": 150,
  // 保存时格式化
  "editor.formatOnSave": true,
  //让prettier使用eslint的代码格式进行校验
  "prettier.eslintIntegration": true, 
  // 开启 vscode 文件路径导航
  "breadcrumbs.enabled": true,
  // 让函数(名)和后面的括号之间加个空格
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true, 
  // 格式化.vue中html
  "vetur.format.defaultFormatter.html": "js-beautify-html", 
  //让vue中的js按编辑器自带的ts格式进行格式化
       "vetur.format.defaultFormatter.js": "vscode-typescript", 
  // prettier 设置语句末尾不加分号
  "prettier.semi": false,
  // prettier 设置强制单引号
  // "prettier.singleQuote": false,
  // 选择 vue 文件中 template 的格式化工具
  "vetur.format.defaultFormatter.html": "prettyhtml",
  // 显示 markdown 中英文切换时产生的特殊字符
  "editor.renderControlCharacters": true,
  // 设置 eslint 保存时自动修复
  "eslint.autoFixOnSave": true,
  // eslint 检测文件类型
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "html",
      "autoFix": true
    },
    {
      "language": "vue",
      "autoFix": true
    }
  ],
  // vetur 的自定义设置
  "vetur.format.defaultFormatterOptions": {
    "prettier": {
      "singleQuote": false,
      "semi": true
    }
  },
  "workbench.tree.indent": 20,
  "window.zoomLevel": 1,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "workbench.statusBar.visible": false,
  "tabnine.experimentalAutoImports": true,
  "files.associations": {},
  "editor.semanticTokenColorCustomizations": null,
  "gitlens.advanced.blame.customArguments": [],
  "gitlens.views.repositories.showBranchComparison": null,
  "gitlens.gitCommands.closeOnFocusOut": true,
  "gitlens.statusBar.dateFormat": "",
  "workbench.colorCustomizations": {
    "activityBarBadge.background": "#FF7042",
    "activityBar.activeBorder": "#FF7042",
    "list.activeSelectionForeground": "#FF7042",
    "list.inactiveSelectionForeground": "#FF7042",
    "list.highlightForeground": "#FF7042",
    "scrollbarSlider.activeBackground": "#FF704250",
    "editorSuggestWidget.highlightForeground": "#FF7042",
    "textLink.foreground": "#FF7042",
    "progressBar.background": "#FF7042",
    "pickerGroup.foreground": "#FF7042",
    "tab.activeBorder": "#FF7042",
    "notificationLink.foreground": "#FF7042",
    "editorWidget.resizeBorder": "#FF7042",
    "editorWidget.border": "#FF7042",
    "settings.modifiedItemIndicator": "#FF7042",
    "settings.headerForeground": "#FF7042",
    "panelTitle.activeBorder": "#FF7042",
    "breadcrumb.activeSelectionForeground": "#FF7042",
    "menu.selectionForeground": "#FF7042",
    "menubar.selectionForeground": "#FF7042",
    "editor.findMatchBorder": "#FF7042",
    "selection.background": "#FF704240",
    "statusBarItem.remoteBackground": "#FF7042"
  },
  "materialTheme.accent": "Orange",
  "gitlens.gitCommands.skipConfirmations": [
    "fetch:command",
    "switch:command"
  ],
  "gitlens.blame.dateFormat": "",
  "editor.fontLigatures": null,
  "explorer.confirmDelete": false
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值