规范格式化github
统一standard代码风格
yarn add standard --dev
package.json中加入相关基础配置
scripts:{
"code-fix": "standard --fix",
},
"standard": {
"ignore": [
"/src/utils/",
"/src/plugins/",
"node_modules/"
],
"globals": [
"window",
"localStorage"
]
},
husky工具包-githooks
npm install husky --save-dev
//
yarn add husky --dev
使用配置
npm set-script prepare "husky install"
npm run prepare
npx husky add .husky/pre-commit "npm run code-fix"
git add .husky/pre-commit