2021.6.25 vscode配置

{
  // 換行
  "editor.wordWrap": "off",

  // 代码缩进修改成2个空格
  "editor.tabSize": 2,

  // 控制编辑器是否启用了代码折叠。
  "editor.folding": true,

  // 不檢查縮進,保存后統一按設置項來設置
  "editor.detectIndentation": false,
  
  // html格式化
  "vetur.format.defaultFormatter.html": "js-beautify-html",

  // vue组件中html代码格式化样式
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
        "wrap_attributes": "force-aligned"
    }
  },

  // 文件保存时是否根据eslint进行格式化
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },

  "eslint.format.enable": true,

  "javascript.validate.enable": false,

  //autoFix默认开启自动修复功能,只需输入字符串数组即可【用eslint的规则检测js文件、检测vue文件】
  "eslint.validate": [
    "javascript",
    "javascriptreact" ,
    "vue",
    "html",
    "jsx",
    ],

  "eslint.alwaysShowStatus": true,

  // eslint配置文件
  "eslint.options": {
    "extensions": [
      ".js",
      ".vue"
    ]
  },

  // 設置行高
  "editor.lineHeight": 20,

  // 让prettier使用eslint的代码格式进行校验
  "prettier.eslintIntegration": true,

  // 去掉代码结尾的分号
  "prettier.semi": true,

  // 使用带引号替代双引号
  "prettier.singleQuote": true,

  // js設置單引號
  "javascript.preferences.quoteStyle": "single",

  "vetur.format.defaultFormatter.js": "vscode-typescript",

  "vetur.format.defaultFormatter.css": "prettier",
 
  "vetur.format.defaultFormatter.less": "prettier",

  // 配置文件关联,以便启用对应的提示
  "files.associations": {
    "*.vue": "vue",
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript",
    "*.art": "html"
  },
  "less.compile": {
    // "compress":  true,  // 是否删除多余空白字符
    // "sourceMap": true,  // 是否创建文件目录树,true的话会自动生成一个 .css.map 文件
    "outExt": ".wxss" // 输出文件的后缀,默认为.css
  },
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/dist": true
  },
  "emmet.syntaxProfiles": {
    "javascript": "jsx",
    "vue": "html",
    "vue-html": "html"
  },
  "git.confirmSync": false,
  "editor.renderWhitespace": "boundary",
  "editor.cursorBlinking": "smooth",
  "editor.minimap.enabled": true,
  "editor.minimap.renderCharacters": false,
  "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
  "editor.codeLens": true,
  "editor.snippetSuggestions": "top",
  "emmet.includeLanguages": {
    "wxml": "html"
  },
  "minapp-vscode.disableAutoConfig": true,
  "files.autoSave": "off",
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "explorer.confirmDragAndDrop": false,
  "diffEditor.ignoreTrimWhitespace": true,
  "[css]": {
    "editor.defaultFormatter": "aeschli.vscode-css-formatter"
  },
  "emmet.triggerExpansionOnTab": true,
  "emmet.showSuggestionsAsSnippets": true,
  "vsicons.dontShowNewVersionMessage": true,
  "emmet.extensionsPath": [
    ""
  ],
  "workbench.iconTheme": "vscode-icons",
  
  "auto-close-tag.activationOnLanguage": [
  "*.art",
    "xml",
    "php",
    "blade",
    "ejs",
    "jinja",
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "plaintext",
    "markdown",
    "vue",
    "liquid",
    "erb",
    "lang-cfml",
    "cfml",
    "HTML (EEx)",
    "HTML (Eex)",
    "plist"
  ],
  // 高亮的颜色,emm暂时只支持这样写
  "wxmlConfig.activeColor": {
    "color": "#e5c07b"
  },
  // 是否禁用高亮组件
  "wxmlConfig.activeDisable": false,
  // 是否开启保存自动格式化
  "wxmlConfig.onSaveFormat": false,
  "wxmlConfig.format": {
    "brace_style": "collapse",
    "end_with_newline": false,
    "indent_char": "",
    "indent_handlebars": false,
    "indent_inner_html": false,
    "indent_scripts": "keep",
    "indent_size": 2,
    "indent_with_tabs": true,
    "max_preserve_newlines": 1,
    "preserve_newlines": true,
    "wrap_attributes": "force-expand-multiline"
  },
  // 高亮所忽略的组件数组
  "wxmlConfig.tagNoActiveArr": [
    "view",
    "button",
    "text",
    "icon",
    "image",
    "navigator",
    "block",
    "input",
    "template",
    "form",
    "camera",
    "textarea"
  ],
  // 设置终端为cmder
  "terminal.integrated.shell.windows": "cmd.exe",
  "terminal.integrated.env.windows": {
      //设置cmder的根目录
      "CMDER_ROOT": "D:\\Users\\cmder"
  },
  "terminal.integrated.shellArgs.windows": [
      "/k",
      //设置启动初始化目录
      "cmder的根目录\\vendor\\init.bat"
  ],
  "turboConsoleLog.quote": "'",
  "editor.formatOnSave": true,
  "editor.renderIndentGuides": false
}
image.png

image.png

image.png

微信小程序自定义组件代码片段提示
Auto Close Tag
Auto Rename Tag
AutoFileName
Beautify
Beautify css/sass/scss/less
Bracket Pair Colorizer
Browser Preview
Chinese (Simplified) Language Pack for Visual Studio Code
Cobalt2 Theme Official
Colonize
CSS Formatter
CSS Peek
CSS Tree
Debugger for Chrome
DotENV
Easy LESS
Element UI Snippets
ES7 React/Redux/GraphQL/React-Native snippets
ESLint
Guides
Highlight Matching Tag
HTML Snippets
i18n Ally
Iconify IntelliSense
JetJet-theme
Material Icon Theme
minapp
Path Autocomplete
Picture Element
Prettier - Code formatter
stylelint
Turbo Console Log
Vetur
VS Code Counter
VSCode Great Icons
vscode wxml
vscode-icons
vue
Vue 3 Snippets
Vue VSCode Snippets
WakaTime
WindiCSS IntelliSense
wxml
wechat-snippet

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 本文目录: 1.汉化 2.常用插件 3.设置默认浏览器 4.用户代码片段 5.调节左侧导航栏字体大小 6.修改格式...
    前端辉羽阅读 998评论 0 8
  • 插件列表: Color Info 这个便捷的插件,将为你提供你在CSS 中使用颜色的相关信息。你只需在颜色上悬...
    骑着蜗牛撵大象阅读 13,143评论 0 2
  • 一、HTML中的标签、属性、和取值 1.基础类标签: :双标签,是header的简写,此html文件内的标题(bl...
    刘远舟阅读 601评论 0 0
  • 基础必备插件 Chinese (Simplified) Language Pack for Visual Stud...
    正在学前端的流萤阅读 280评论 0 0
  • vscode 前端扩展建议 开源,帮助方便,使用简单,占系统资源少,提供丰富的插件,界面很赞 vs code 汉化...
    镜轩夕照阅读 1,535评论 0 2