0


git commit报错:running pre-commit hook: lint-staged

报错截图:

在这里插入图片描述

报错信息:

running pre-commit hook: lint-staged

解决方式:

在项目(vue)的package.json文件中,查找 “husky” 部分,并确认其下的 “pre-commit” 钩子是否正确地引用了 lint-staged。
其中配置示例如下(供参考,不会配的话粘过去就能用):

"scripts":{...},......."husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"**/*.{js,jsx,ts,tsx}":["npm run lint-staged:js","prettier --write"],"**/*.{less,md,json}":["prettier --write"]},

希望记录的问题,能够帮助到你!

标签: git

本文转载自: https://blog.csdn.net/weixin_52443895/article/details/133962273
版权归原作者 今天不要写bug 所有, 如有侵权,请联系我们删除。

“git commit报错:running pre-commit hook: lint-staged”的评论:

还没有评论