个人VS code自动保存时格式化代码的一些配置

首先.prettierrc的一些配置

{
  "printWidth": 150,
  "tabWidth": 2,
  "useTabs": false,
  "singleQuote": true,
  "semi": false,
  "trailingComma": "all",
  "bracketSpacing": true,
  "jsxBracketSameLine": true,
  "arrowParens": "avoid",
  "proseWrap": "never"
}

然后是VS code中设置-setting代码

{
  "search.followSymlinks": false,
  "gitlens.advanced.messages": {},
  "files.autoSave": "onFocusChange",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "eslint.validate": ["javascript", "html", "vue"],
  "eslint.options": {
    "plugins": ["html"]
  }
}

 

你可能感兴趣的:(个人VS code自动保存时格式化代码的一些配置)