Git取消提交前的eslint检查

这尼玛大早上的,Git又犯抽了 …

➜  chnqoo-recollections-service git:(master) ✗ git commit -m "🆕 新增文件上传服 务 ..."
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ package.json — 11 files
❯ ./src/**/*.{ts,js,jsx,tsx} — 6 files
✖ eslint --ignore-path .gitignore --fix [FAILED]
◼ prettier --ignore-path .gitignore --write
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ eslint --ignore-path .gitignore --fix:

/Users/net.cctv3.i/chnqoo-recollections-service/src/app/api/chnqoo-notebook/login/route.ts
13:27 error 'request' is defined but never used @typescript-eslint/no-unused-vars
42:28 error 'request' is defined but never used @typescript-eslint/no-unused-vars

/Users/net.cctv3.i/chnqoo-recollections-service/src/app/api/chnqoo-notebook/note/route.ts
13:28 error 'request' is defined but never used @typescript-eslint/no-unused-vars

/Users/net.cctv3.i/chnqoo-recollections-service/src/app/api/chnqoo-notebook/sms/route.ts
14:9 error 'mobile' is assigned a value but never used @typescript-eslint/no-unused-vars
43:28 error 'request' is defined but never used @typescript-eslint/no-unused-vars

/Users/net.cctv3.i/chnqoo-recollections-service/src/app/api/chnqoo-notebook/talker/route.ts
15:9 error 'result' is assigned a value but never used @typescript-eslint/no-unused-vars

/Users/net.cctv3.i/chnqoo-recollections-service/src/app/api/common/fileUploader/route.ts
11:3 error Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free @typescript-eslint/ban-ts-comment

✖ 7 problems (7 errors, 0 warnings)

husky - pre-commit script failed (code 1)

解决方法,提交的时候加--no-verify参数 …

作者

江北饮马、江南折花

发布于

2024-02-17

更新于

2024-02-18

许可协议

评论