vsCode automatically saved most standard formatting codes, simple, out of the box, super easy to use, just two steps

Development Background: Now your team is mainly used vue framework for the development, in the development of people, code formatting styles, can lead to unnecessary conflicts when merging the code, so I want to unify the code in the style of a team development.

Implementation steps:

1, vsCode store in search ESlint, vetur, install it.

 

 2, vsCode add the following code in the file settings.json

"vetur.format.defaultFormatter.js": "none", // prohibit vetur format js js formatted using the eslint 
  "editor.tabSize": 2, // the Tab spacing character 
  "editor.formatOnSave": to true , // edit when stored in the format code 
  "eslint.autoFixOnSave": to true , // eslint when saving automatic formatting code 
  // to set the file type action 
  "eslint.validate" : [
     "JavaScript" ,
     "javascriptreact" ,
    {
      "language": "html",
      "autoFix": true
    },
    {
      "language": "vue",
      "autoFix": true
    }
  ]

 

Guess you like

Origin www.cnblogs.com/chuntian1989/p/11988276.html