美文网首页
vscode eslint vue 保存自动修复

vscode eslint vue 保存自动修复

作者: 煮茶听雨 | 来源:发表于2020-04-01 11:45 被阅读0次

    我安装的插件:


    image.png

    我的json配置:

    {
        // tab 大小为2个空格
        "editor.tabSize": 2,
        // 编辑器换行
        "editor.wordWrap": "off",
        // 保存时格式化
        "editor.codeActionsOnSave": {
          "source.fixAll.eslint": true
        },
        // 开启 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": {
          "js-beautify-html": {
            "wrap_attributes": "aligned-multiple"
          },
          "prettier": {
            "singleQuote": true,
            "semi": false,
            "printWidth": 100,
            "wrapAttributes": false,
            "sortAttributes": false
          }
        }
      }
    

    相关文章

      网友评论

          本文标题:vscode eslint vue 保存自动修复

          本文链接:https://www.haomeiwen.com/subject/atlcfhtx.html