皮棉阶段未在预提交时运行 [英] lint-staged not running on precommit
本文介绍了皮棉阶段未在预提交时运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
prettier不在precommit上运行.这在其他项目中使用了相同的配置,因此我感到困惑,为什么它这次不起作用.
prettier is not running on precommit. This worked with the same configuration in other projects, so I'm baffled why it's not working this time.
这是我package.json文件的相关部分:
This is the relevant section of my package.json file:
"scripts": {
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,json,css,scss,html,md}": [
"prettier --write",
"git add"
]
},
编辑.这里是相关的devDependencies:
Edit. Here are the relevant devDependencies:
"devDependencies": {
"husky": "^0.14.3",
"lint-staged": "^7.0.4",
"prettier": "1.12.0"
},
推荐答案
重新安装哈士奇犬,现在看来可以正常工作.感谢@ mpasko256的帮助!
Reinstalled husky and now seems to be working. Thanks @mpasko256 for your help!
这篇关于皮棉阶段未在预提交时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文