git提交时报了两条错误:
1、stylelint --syntax less found some errors. Please fix them and try committing again
2、npm run lint-staged:js found some errors. Please fix them and try committing again.
这两个错误都是由一个原因引起的,那便是git提交时的检测代码规范机制,详情请点击以下链接:
git commit前检测husky与pre-commit
第一种解决方案:
在提交时加入 --no-verify参数,用来跳过检测机制,输入以下命令:
git commit --no-verify -m "提交时的注释"
第二种解决方案:
找到根目录中的.eslintignore文件,将src放入其中,以便git提交时跳过src目录中所有文件的eslint检测机制。如下
build/*.js
public
dist
src
网友评论