首页 > 其他 > 详细

[Tool] Enable Prettier in VSCode as Format on Save and add config files to gitingore

时间:2019-04-16 19:43:41      阅读:157      评论:0      收藏:0      [点我收藏+]

First of all, install Prettier extension: "Pettier - Code formatter".

The open the VSCode setting:

cmd + ,

Search for "format": and enable "Format On Save"

技术分享图片

 

Add .prettierrc file:

{
  "tabWidth": 4,
  "semi": true,
  "singleQuote": true
}

 

Add .prettierignore file: 

dist
package-lock.json

 

Add both file into global gitignore:

touch ~/.gitignore_global // create one if you don‘t have it

vim ~/.gitignore_global // edit it

//add 
.prettierrc
.prettierignore

// Run
git config --global core.excludesfile ~/.gitignore_global

 

[Tool] Enable Prettier in VSCode as Format on Save and add config files to gitingore

原文:https://www.cnblogs.com/Answer1215/p/10719286.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!