王多静

这里是我的记事本

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

git commit提交时报错husky > pre-commit (node v10.16.0) Stashing changes... [started] Stashing changes... [skipped] → No partially staged files found... Running linters..

项目中使用了husky, 这个会在你git commit的时候先执行里面的严谨模式, 对代码进行检查,  有error就会终止提交

 一直想怎么关闭vue里的严谨模式, 后面问到后台有说可以忽略的,问题和方法如下:

 

git 提交的时候各种提示

复制代码
$ git commit -m "提交页面"
husky > pre-commit (node v10.16.0)
Stashing changes... [started]
Stashing changes... [skipped]
→ No partially staged files found...
Running linters... [started]
Running tasks for src/**/*.{js,vue} [started]
eslint --fix [started]
eslint --fix [failed]
→
Running tasks for src/**/*.{js,vue} [failed]
→
Running linters... [failed]



× eslint --fix found some errors. Please fix them and try committing again.

E:\project\hlwl-siw-pc\src\views\informationManage\sealTemplate.vue
333:30  error  Expected '===' and instead saw '=='         eqeqeq
338:30  error  Expected '===' and instead saw '=='         eqeqeq
347:29  error  'msg' is assigned a value but never used    no-unused-vars
348:18  error  Expected '===' and instead saw '=='         eqeqeq
352:16  error  Expected error to be handled                handle-callback-err
379:29  error  'msg' is assigned a value but never used    no-unused-vars
379:34  error  'total' is assigned a value but never used  no-unused-vars
380:18  error  Expected '===' and instead saw '=='         eqeqeq
390:16  error  Expected error to be handled                handle-callback-err
410:27  error  Expected '===' and instead saw '=='         eqeqeq
425:23  error  'data' is assigned a value but never used   no-unused-vars
425:29  error  'msg' is assigned a value but never used    no-unused-vars
425:34  error  'total' is assigned a value but never used  no-unused-vars
426:18  error  Expected '===' and instead saw '=='         eqeqeq
433:16  error  Expected error to be handled                handle-callback-err
441:33  error  Expected '===' and instead saw '=='         eqeqeq
494:22  error  Expected '===' and instead saw '=='         eqeqeq
502:20  error  Expected error to be handled                handle-callback-err
519:23  error  Expected '===' and instead saw '=='         eqeqeq
531:23  error  Expected '===' and instead saw '=='         eqeqeq

✖ 20 problems (20 errors, 0 warnings)
husky > pre-commit hook failed (add --no-verify to bypass)
复制代码

 

解决办法: 

git commit -m "提交页面备注" --no-verify

 

 不按要求改的话, 提交的时候这样提交, 就可以绕过了eslint的检查了

 

原因这位大哥描述的很详细: git commit前检测husky与pre-commit

 严谨模式规则什么的点这里看广告很多

posted on   王多静  阅读(6029)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示