Vue+VSCode开发环境配置备忘

关闭vscode 的  eslint  参考

2020 4月

{
  "explorer.confirmDelete": false,
    "vetur.validation.template": false,
    "files.autoSave":"off",
    "eslint.enable": false,
    "eslint.autoFixOnSave": true,
    "eslint.validate": [
       "javascript",
       "javascriptreact",
       "html",
       { "language": "vue", "autoFix": true }
     ],
     "eslint.options": {
        "plugins": ["html"]
     },
     //为了符合eslint的两个空格间隔原则
    "editor.tabSize": 2,
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    }
}

 Beautify 1.5.0插件下的格式化配置

{
    "beautify.config": "",
    "beautify.language": {
        "css": {
            "type": ["css", "scss"],
            "indent_size": 2
        },
        "js": {
            "type": ["javascript", "json"],
        },
        "html": {
            "brace_style": "none,preserve-inline",
            "indent_size": 2,
            "indent_char": " ",
            "jslint_happy": true,
            "unformatted": [
                "a", "pre"
            ],
        }
    },
    "vetur.format.defaultFormatter.html": "js-beautify-html",//对应插件Beautify 1.5.0
    "vetur.format.defaultFormatterOptions" : {
        "js-beautify-html": {
            "wrap_attributes": "aligned-multiple" // 可解决vue文件中<template>中默认格式化,属性自动换行问题,可以换成上面任意一种value
          }
    },
    "vetur.completion.scaffoldSnippetSources": {
        "vetur.format.defaultFormatter.html":"js-beautify-html",
    },
    "editor.minimap.maxColumn": 300,
     //为了符合eslint的两个空格间隔原则
     "editor.tabSize": 2,
     "editor.codeActionsOnSave": {
       "source.fixAll.eslint": false
     },
    "html.format.wrapLineLength": 0,
    "html.format.maxPreserveNewLines": null,
    "git.enableSmartCommit": true,
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    }
    
}

猜你喜欢

转载自www.cnblogs.com/zhuji/p/12637967.html
今日推荐