Vscode configuration file - vutur automatic formatting - eslint verification - attribute wrapping

Vscode configuration file - vutur automatic formatting - eslint verification - attribute wrapping

{
    
    
    // eslint 配置
    "eslint.enable": true,
    "eslint.run": "onType",
    "eslint.options": {
    
    
        "extensions": [
            ".js",
            ".vue",
            ".jsx",
            ".tsx"
        ]
    },
    // 自动格式化代码设置
    "editor.codeActionsOnSave": {
    
    
        // "source.fixAll.eslint": true,
        // 保存时格式化
        // "editor.formatOnSave": true,
        // prettier 设置语句末尾加分号 true 加分号 false 不加分号
        // "prettier.semi": false,
        // 使用单引号代替双引号
        // "prettier.singleQuote": true,
        // 设置 eslint 保存时自动修复  和 editor.formatOnSave 选一即可 影响 function () {} 格式
        // "eslint.autoFixOnSave": true,
    },
    "vetur.format.defaultFormatterOptions": {
    
    
        "js-beautify-html": {
    
    
            // "wrap_line_length": 250, // 换行字符串阈值
            "tabWidth": 20, // tab缩进大小,默认为2
            "semi": false, // 去掉末尾分号
            // "htmlWhitespaceSensitivity": "strict", // html空格敏感度,可选值:'css'(样式表)|'strict'(严格)|'ignore'(忽略)
            // "vueIndentScriptAndStyle": true, // vue文件中的script及style标签缩进
            // "endOfLine": "auto", // 结尾是 \n \r \n\r auto
            // auto 不进行格式化
            // force 首个属性与开始标签共一行,最后的属性与开始标签结束的 > 符号共一行,其他属性单独一行。
            // force-aligned 所有属性强制对齐,若组件名较长太不美观,不建议使用。
            // force-expand-multiline 所有属性单独占据一行且对齐。开始标签和开始标签结束的 > 符号同样单独占据一行。
            "wrap_attributes": "force-aligned", //属性换行
            // "end_with_newline": false,
        },
        "prettyhtml": {
    
    
            // "printWidth": 100,
            "singleQuote": false, // //去掉末尾分号
            // "wrapAttributes": false,
            "sortAttributes": false
        },
        "prettier": {
    
    
            // "semi": true, //去掉末尾分号
            "trailingComma": true, // 这个就是设置是否末尾添加逗号的字段
            "singleQuote": true //将所有双引号改为单引号
        }
    },
    // #让vue中的js按"prettier"格式进行格式化
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "prettier",
    "path-autocomplete.extensionOnImport": true,
    "path-autocomplete.pathMappings": {
    
    
        "@": "${folder}/src"
    },
    "security.workspace.trust.untrustedFiles": "open",
    "editor.fontSize": 15,
    "liveServer.settings.donotShowInfoMsg": true,
    "less.compile": {
    
    
        "out": "../css/"
    },
    "editor.tabSize": 2,
    "[javascript]": {
    
    
        "editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
    },
    "[vue]": {
    
    
        "editor.defaultFormatter": "octref.vetur"
    },
    "workbench.startupEditor": "none",
    "explorer.confirmDelete": false,
    "[html]": {
    
    
        "editor.defaultFormatter": "vscode.html-language-features"
    },
    "cssrem.rootFontSize": 80,
    "cssrem.vwDesign": 1920,
    "[typescript]": {
    
    
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },
    "liveServer.settings.port": 0,
    "vetur.validation.interpolation": false,
    "vetur.validation.script": false,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "editor.inlineSuggest.enabled": true,
    "eslint.trace.server": "off",
    "eslint.alwaysShowStatus": true,
    "github.copilot.enable": {
    
    
        "*": true,
        "yaml": false,
        "plaintext": false,
        "markdown": false
    },
    "git.openRepositoryInParentFolders": "always",
    "terminal.integrated.enableMultiLinePasteWarning": false,
    "eslint.nodeEnv": "",
    "editor.semanticTokenColorCustomizations": {
    
    },
    "editor.tokenColorCustomizations": {
    
    },
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    "editor.formatOnSave": true,
    "window.openFoldersInNewWindow": "on",
    "window.openFilesInNewWindow": "on",
    "editor.formatOnPaste": true,
    "backgroundCover.imagePath": "c:\\Users\\85839\\Pictures\\壁纸\\QQ截图20230412214624.png",
    "backgroundCover.opacity": 0.3,
    "backgroundCover.randomImageFolder": "c:\\Users\\85839\\Pictures\\壁纸",
    "backgroundCover.autoStatus": true,
    "workbench.colorTheme": "Default Dark+ Experimental",
    "[jsonc]": {
    
    
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "javascript.updateImportsOnFileMove.enabled": "always",
    "diffEditor.ignoreTrimWhitespace": false
}

Effect
insert image description here

Guess you like

Origin blog.csdn.net/qq_61950936/article/details/130852703