Visual Studio Code代码校验-eslint代码校验

学习分享2年前 (2022)更新 bestcyt
333 0 0

Vue项目代码书写规范校验

项目开启代码校验

...(config.dev.useEslint ? [createLintingRule()] : []),

Visual Studio Code插件安装

Visual Studio Code代码校验-eslint代码校验

插件配置

打开命令版输入:setting.json选择最后一个替换下面的代码,然后保存即可
 

{
    "window.zoomLevel": 0,
    "editor.mouseWheelZoom": true,
    "open-in-browser.default": "chrome",
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 60000,
    "explorer.confirmDelete": false,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "editor.snippetSuggestions": "top",
    "editor.formatOnPaste": true,
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "editor.minimap.enabled": false,
    "[javascript]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "editor.renderIndentGuides": false,
    "eslint.enable": true,
    "extensions.autoUpdate": false,
    "workbench.iconTheme": "vscode-icons",
    "eslint.autoFixOnSave": true,
    "auto-rename-tag.activationOnLanguage": [
        "html",
        "xml",
        "php",
        "javascript",
        "vue"
    ],
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        {
            "language": "vue",
            "autoFix": true
        }
    ],
    "bracket-pair-colorizer-2.colors": [
        "Gold",
        "Orchid",
        "LightSkyBlue"
    ],
    "workbench.colorTheme": "Monokai"
}

 

© 版权声明

相关文章