vsCode实现美化代码

1、安装eslint,prettier

2、在setting中,配置setting.json文件如下:(settings----open Settings(json))

{
    "breadcrumbs.enabled": false,
    // "html.format.wrapLineLength": 80,
    "editor.wordWrap": "on",
    "editor.cursorBlinking": "expand",
    "editor.cursorSmoothCaretAnimation": true,
    "terminal.integrated.rendererType": "dom",
    "editor.tabSize": 2,
    "editor.suggestSelection": "first",
    "[vue]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "prettier.singleQuote": true,
    "prettier.semi": false,
    "prettier.jsxSingleQuote": true,
    "vetur.format.defaultFormatter.js": "prettier-eslint",
    "[jsonc]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "liveServer.settings.donotShowInfoMsg": true,
    "editor.formatOnSave": true,
    "editor.formatOnPaste": true,
    "editor.formatOnType": true,
    "editor.multiCursorModifier": "alt",
    "editor.columnSelection": false,
    "[html]": {
      "editor.defaultFormatter": "vscode.html-language-features"
    },
    "files.associations": {
      "*.html": "html"
    },
    "editor.codeActionsOnSave": {
      "source.fixAll.eslint": true
    },
    "git.alwaysShowStagedChangesResourceGroup": true,
  }
  

 

 

你可能感兴趣的:(vue)