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
严谨模式规则什么的点这里看广告很多
标签:
git
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」