VSCode 设置代码格式化

文件->首选项->设置   然后右上角 打开设置(json)

 

VSCode 设置代码格式化_第1张图片

 整个复制进去

{
    "git.autofetch": true,
    "editor.quickSuggestions": {
    "strings": true
    },
    "files.autoSave": "afterDelay",
    // vetur configuration
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "prettier",
    "vetur.format.defaultFormatter.css": "prettier",
    "vetur.format.defaultFormatter.ts": "prettier",
    "vetur.format.defaultFormatterOptions": {
    // 属性强制折行对齐
    "wrap_attributes": "force-aligned"
    },
    // eslint configuration
    "eslint.enable": true,
    "eslint.autoFixOnSave": true,
    "eslint.validate": [
    {
    "language": "html",
    "autoFix": true
    },
    {
    "language": "vue",
    "autoFix": true
    },
    {
    "language": "css",
    "autoFix": true
    },
    {
    "language": "scss",
    "autoFix": true
    },
    {
    "language": "typescript",
    "autoFix": true
    },
    {
    "language": "javascript",
    "autoFix": true
    },
    {
    "language": "javascriptreact",
    "autoFix": true
    }
    ],
    "explorer.confirmDelete": true,
    "vetur.validation.template": false,
    "editor.fontSize": 16,
    "window.zoomLevel": 0,
    "editor.minimap.enabled": false,
    "workbench.startupEditor": "newUntitledFile",
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "workbench.colorTheme": "Visual Studio Dark",
    "javascript.updateImportsOnFileMove.enabled": "never",
}

 

你可能感兴趣的:(前端)