{
  "files.eol": "\n",
  "typescript.preferences.quoteStyle": "single",
  "javascript.preferences.quoteStyle": "single",
  // tab 大小为2个空格
  "editor.tabSize": 2,
  // 编辑器换行
  "editor.wordWrap": "off",
  "css.validate": false,
  "less.validate": false,
  "scss.validate": false,
 
  "workbench.tree.indent": 15, // 项目文件目录树间距
  "workbench.tree.renderIndentGuides": "always", // 总是显示文件目录树的辅助线
  "workbench.colorCustomizations": {
    "tree.inactiveIndentGuidesStroke": "#05ef3c"  // 辅助线颜色
  },

  // 开启 vscode 文件路径导航
  "breadcrumbs.enabled": true,
  // prettier 设置语句末尾不加分号
  "prettier.semi": false,
  // prettier 设置强制单引号
  "prettier.singleQuote": true,
  // 选择 vue 文件中 template 的格式化工具
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  // vetur 的自定义设置
  "vetur.format.defaultFormatterOptions": {
    // 让html的attributes不换行,看起来更美观
    "js-beautify-html": {
      // aligned-multiple 、auto
      "wrap_attributes": "auto",
      "wrap_line_length": 240,
      "end_with_newline": false
    },
    "prettier": {
      "singleQuote": true,
      "semi": false,
      "printWidth": 100,
      "wrapAttributes": false,
      "sortAttributes": false
      // "trailingComma": "none" // 禁止随时添加逗号
    }
  },
  "tabnine.experimentalAutoImports": true,
  // 保存代码,自动格式化
  "editor.formatOnSave": true,
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "prettier.configPath": "./prettier.config.js",
  "prettier.useEditorConfig": false,
  "settingsSync.ignoredSettings": [],
  "security.workspace.trust.untrustedFiles": "open",
  "workbench.editor.enablePreview": false,
  "editor.stickyScroll.enabled": false,
  // 配置elint
  "eslint.enable": true,
  "eslint.validate": [
    "javascript",
    // 用eslint的规则检测JS代码
    {
      "language": "vue", // 检测Vue文件
      "autoFix": true //为vue文件开启保存自动修复的功能
    },
    {
      "language": "html",
      "autoFix": true
    },
    "vue"
  ]
  // "editor.codeActionsOnSave": {
  //   "source.fixAll.eslint": "explicit"
  // }
}

// 当保存的时候,eslint自动帮我们修复错误
// "editor.codeActionsOnSave": {
//   "source.fixAll": true
// }

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐