git hooks、husky 、lint-staged 、结合 eslint stylelint 进行代码commit 校验

参考链接:

https://commitlint.js.org/#/

https://www.cnblogs.com/ly0612/p/15545803.html

https://blog.csdn.net/snowball_li/article/details/121850069

https://typicode.github.io/husky/#/?id=install

 

 

注意点husky  的版本的坑大于5.x的版本 多了一步   要有.husky文件生成  

并且要结合 

 

 

npx --no-install commitlint --edit "$1"    可以校验commit 提交是文字的描述规范
npm run lint-staged    直接运行项目中对应的脚本然后 进行js   css 等一系列校验   https://stylelint.io/       https://eslint.org/
"prepare": "husky install", 命令必须要有是执行lint-staged 的关键
posted @ 2022-05-13 14:14  小魏code  阅读(106)  评论(0编辑  收藏  举报