ESLint+Prettier的配置

发布于:2025-02-11 ⋅ 阅读:(27) ⋅ 点赞:(0)

ESLint+Prettier的配置

安装插件

​​​​​​在这里插入图片描述

在settings.json中写下配置

{
    // tab自动转换标签
    "emmet.triggerExpansionOnTab": true,

    "workbench.colorTheme": "Default Dark+",
    "editor.tabSize": 2,
    "editor.fontSize": 14,
    "[vue]": {
      "editor.defaultFormatter": "octref.vetur"
    },
    "security.workspace.trust.untrustedFiles": "open",
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": "explicit"
    },
    "editor.detectIndentation": false,
    "editor.formatOnSave": true,
    "eslint.validate": [
      "javascript",
      "javascriptreact",
      "html",
      "vue"
    ],
    "prettier.eslintIntegration": true,
    "prettier.semi": false,
    "prettier.singleQuote": true,
    "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
    "vetur.format.defaultFormatter.html": "js-beautify-html",
    "vetur.format.defaultFormatter.js": "vscode-typescript",
    "vetur.format.defaultFormatterOptions": {
      "js-beautify-html": {
            "wrap_line_length": 140,
            "wrap_attributes": "auto",
            "end_with_newline": false
        },
        "prettier": {
            "printWidth": 180
        }
    },
    "stylusSupremacy.insertColons": false,
    "stylusSupremacy.insertSemicolons": false,
    "stylusSupremacy.insertBraces": false,
    "stylusSupremacy.insertNewLineAroundImports": false,
    "stylusSupremacy.insertNewLineAroundBlocks": false,
    "editor.language.brackets": [
    
    ],
    "eslint.nodeEnv": "",

  }

网站公告

今日签到

点亮在社区的每一天
去签到