VS Code ESlint Vue Prettier Ctrl+S保存自动格式化

VS Code ESlint Vue Prettier Ctrl+S保存自动格式化功能将VS Code settings插入:

{
  "workbench.colorTheme": "Visual Studio Light",
  "editor.tabSize": 2,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.tokenColorCustomizations": null,
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[vue]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "explorer.confirmDelete": false,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "javascript.preferences.quoteStyle": "single",
  "[javascript]": {
    // "editor.defaultFormatter": "HookyQR.beautify"
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "typescript.preferences.quoteStyle": "single",
  "vetur.format.enable": false,
  "vetur.format.options.tabSize": 1,
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force-expand-multiline",
      "end_with_newline": true
    },
    "prettier": {
      "arrowParens": "void",
    },
    "prettyhtml": {
      "printWidth": 100,
      "singleQuote": false,
      "wrapAttributes": false,
      "sortAttributes": false
    }
  },
  "vetur.grammar.customBlocks": {
    "docs": "md",
    "i18n": "json"
  },
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  "files.exclude": {
    "node_modules/": true
  },
  "files.associations": {
    "*.vue": "html"
  },
  "vetur.experimental.templateInterpolationService": false,
  "vetur.validation.template": false,
  "vetur.validation.interpolation": false,
  "prettier.semi": true,
  "prettier.jsxSingleQuote": true,
  "prettier.singleQuote": true,
  "prettier.vueIndentScriptAndStyle": true,
  "prettier.jsxBracketSameLine": true,
  "prettier.packageManager": "yarn",
  "prettier.requireConfig": true,
  "prettier.requirePragma": true,
  "prettier.resolveGlobalModules": true,
  "prettier.trailingComma": "all",
  "eslint.run": "onSave",
  "eslint.validate": [
    "javascript",
    "html",
    "vue",
  ],
  "eslint.lintTask.enable": true,
  "eslint.alwaysShowStatus": true,
  "eslint.format.enable": true,
}

发表回复