vscode 格式化代码 vetur 修改配置文件,末尾加分号,单引号变双引号,方法名后空格,末尾加引号

打开vetur的settings.json文件,这些问题都是为了把格式化的代码和ESLint格式对上

增加如下配置

"vetur.format.defaultFormatterOptions": { "prettier": {
      // 分号 
      "semi": false,
      //引号 
      "singleQuote": true,
      // 逗号   
      "trailingComma": "none"
         } },
         "vetur.format.defaultFormatter.js": "vscode-typescript",
         "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
         "typescript.format.insertSpaceBeforeFunctionParenthesis": true,

贴一张我用的设置,有些东西没用,但我没去细究


{
    "window.zoomLevel": 1,
    "files.autoSave": "onFocusChange",
    // prettier:每行在这个字符数内整合代码,如果你的屏幕较宽分辨率较高可以适当加大
    "prettier.printWidth": 120,

    "vetur.format.defaultFormatterOptions": { "prettier": {
      // 分号 
      "semi": false,
      //引号 
      "singleQuote": true,
      // 逗号   
      "trailingComma": "none"
         } },
         "vetur.format.defaultFormatter.js": "vscode-typescript",
         "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
         "typescript.format.insertSpaceBeforeFunctionParenthesis": true,
    // vetur:对html的内容使用js-beautify-html
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "files.autoSave":"off",
    "emmet.syntaxProfiles": {
      "vue-html": "html",
      "vue": "html"
    },
    "eslint.validate": [
      "javascript",
      "javascriptreact",
      "html",
      { "language": "vue", "autoFix": true }
    ],
    "eslint.options": {
      "plugins": ["html"]
    },
    "grunt.autoDetect": "on",
    "eslint.codeActionsOnSave.rules": null,
    "explorer.confirmDelete": false,
    "Codegeex.Privacy": true,
    "Codegeex.Comment.LanguagePreference": "中文",
    "[vue]": {
      "editor.defaultFormatter": "octref.vetur"
    },
    "prettier.bracketSameLine": true,
    "prettier.jsxSingleQuote": true,
    "vetur.completion.scaffoldSnippetSources": {

      "workspace": "💼",
      "user": "🗒️",
      "vetur": "✌"
    },
    "Codegeex.EnableExtension": false
    
  }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值