• Vue+VSCode开发环境配置备忘(代码格式设置)


     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_line_length": 120,
                "wrap_attributes": "aligned-multiple", // 可解决vue文件中<template>中默认格式化,属性自动换行问题,可以换成上面任意一种value:aligned-multiple 一行; force-expand-multiline 换行
                "end_with_newline": false
              }
        },
        "vetur.completion.scaffoldSnippetSources": {
            "vetur.format.defaultFormatter.html":"js-beautify-html",
        },
        "editor.minimap.maxColumn": 150,
         //为了符合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"
        },
        "git.confirmSync": false,
        "editor.minimap.enabled": true,
        "terminal.integrated.shell.windows":"C:\Program Files\Git\bin\bash.exe"
        
    }

    关闭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
        }
    }

     格式化方案二:

    vscode 1.42.1

    Prettier-Code formatter

    {
      "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
        },
        "[html]": {
          "editor.defaultFormatter": "esbenp.prettier-vscode"
        }
    }
  • 相关阅读:
    【prufer编码】BZOJ1430 小猴打架
    【费马小定理】BZOJ3260 跳
    【欧拉函数】BZOJ2705: [SDOI2012]Longge的问题
    【卡特兰数】BZOJ1485: [HNOI2009]有趣的数列
    【缩点+拓扑判链】POJ2762 Going from u to v or from v to u?
    【Floyd】BZOJ1491: [NOI2007]社交网络
    【转】对信息学竞赛中调试方法的建议
    【建图+拓扑判环】BZOJ3953: [WF2013]Self-Assembly
    【dfs判负环】BZOJ1489: [HNOI2009]最小圈
    【二分+最小树形图】UVA11865 比赛网络
  • 原文地址:https://www.cnblogs.com/zhuji/p/12637967.html
Copyright © 2020-2023  润新知