[Setting/#124] Husky 및 lint-staged 기반 pre-commit 자동 검사 환경 설정#127
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough모달 훅의 타이머 정리와 렌더 플래그 설정 로직이 null-안전하게 강화되고 eslint 예외 주석이 추가되었습니다. 마이페이지 저장 핸들러는 저장 성공 시 이미지 파일 상태를 초기화하고 편집 모드를 종료하도록 변경되었습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 추가 검토 의견 (근거 + 대안/예시)
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/hooks/common/useModalPresence.ts`:
- Around line 31-33: In useModalPresence (useModalPresence.ts), standardize
timeout-ref checks to use explicit !== null rather than truthy checks: change
any occurrences that test timeRef.current truthiness to timeRef.current !== null
(including the effect start) and in the cleanup after calling
window.clearTimeout(timeRef.current) set timeRef.current = null to ensure the
ref is consistently reset and future checks behave predictably.
In `@src/pages/myPage/MyInfoPage.tsx`:
- Around line 38-45: The derived "original" form (created by useMemo) can show
stale server values if you call setIsEditing(false) before the data refetch
completes; change the save flow so you await/refetch the latest server data
before turning off edit mode (i.e., call refetch() and wait for its resolution
or use the mutation response, then call setIsEditing(false)), or alternatively
update the local source used by original with the optimistic response; update
places that setIsEditing(false) (e.g., save handlers referenced around lines
shown) to only run after refetch/response to prevent briefly showing previous
values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e246a195-c3d2-4a91-8de5-2b95e7176a1e
⛔ Files ignored due to path filters (3)
.husky/pre-commitis excluded by none and included by nonepackage.jsonis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yamland included by none
📒 Files selected for processing (2)
src/hooks/common/useModalPresence.tssrc/pages/myPage/MyInfoPage.tsx
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pages/myPage/MyInfoPage.tsx`:
- Around line 65-68: The onSuccess handler currently calls
setOriginalImageFile(draftImageFile) which causes the UI to prefer the local
blob over the refetched server image; instead remove that call and rely on
qc.invalidateQueries({ queryKey: ["memberInfo"] }) + the refetched
data.profileImage as the source of truth for read mode. Concretely: in the
onSuccess block (referencing setOriginalImageFile, draftImageFile,
qc.invalidateQueries, setIsEditing) stop mutating originalImageFile, or
eliminate originalImageFile state entirely and render read mode from
data.profileImage while reserving draftImageFile only for edit previews; keep
awaiting invalidateQueries and then call setIsEditing(false).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5a2a036a-5940-4bcb-869b-801f91b31964
📒 Files selected for processing (2)
src/hooks/common/useModalPresence.tssrc/pages/myPage/MyInfoPage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/hooks/common/useModalPresence.ts
dew102938
left a comment
There was a problem hiding this comment.
유용한 기능이네요! 동작 방식까지 정리해주셔서 이해하는 데 도움이 됐습니다 수고하셨습니다!
* [Docs/#118] Issue/PR 템플릿 수정 (프로젝트 재정비) (#119) * docs: PR 템플릿 수정 * docs: issue/PR template 수정 * docs: 템플릿 수정에 맞게 Readme변경 * refactor: 사용되지 않는 파일 삭제 * refactor: 미사용 ProfileAvatar 컴포넌트를 MyInfoPage에 적용 * refactor: 사용되지 않는 패키지 삭제 * refactor: 사용되지 않는 export 정리 * 사용되지 않는 함수 toRestaurantSummary 삭제 * refactor: 좌석 타입 라벨을 table.ts 공통 상수로 통합 * refactor: 사용되지 않는 export 타입, 인터페이스 정리 * refactor: 사용되지 않는 타입, 인터페이스 삭제 * [Setting/#121] ESLint/Prettier 설정 및 useEffect 비동기 랜더링 에러 수정 (#123) * setting: ESLint/Prettier 설정 및 useEffect 비동기 랜더링 에러 수정 * fix: vercel build에러 수정 * fix: 코드래빗 일부수정 * fix: 코드래빗 수정사항 반영 * fix: lint error 수정 (#126) * [Setting/#124] Husky 및 lint-staged 기반 pre-commit 자동 검사 환경 설정 (#127) * fix: lint error 수정 * setting: Husky 도입 및 pre-commit lint 검사 설정 * setting: lint-staged 및 자동 포맷 검사 설정 * fix: coderabbit 반영 * fix: coderabbit 수정사항 반영 * [Setting/#128] GitHub Actions CI 환경설정 추가 (#129) * setting: GitHub Actions CI 설정 추가 * fix: GitHub Actions pnpm 버전 중복 지정으로 인한 오류 수정 * fix: node버전 기존 24에서 22로 수정 * [Setting/#130] ESLint warning 정리 및 any 타입 제거 리팩토링 (#133) * fix:any타입 에러 수정중 * fix: lint 에러 수정중(중간저장목적) * fix: lint에러 수정중(중간저장목적) * fix: lint에러 수정중 중간 저장 * fix: lint에러 수정중 중간점검 * fix: lint 에러 수정완료 * fix: build 에러 수정 * fix: 코드래빗 수정사항 반영 * fix: 화면 오류확인해서 삭제했던 globals.css 복구 * fix: 코드래빗 수정사항 반영 * fix: 예약금결제 스크롤 에러 수정 (#135) --------- Co-authored-by: Dew <eidnwq@gmail.com>
🔢 관련 이슈 링크
📌 변경사항PR
💻 작업내용
prepare스크립트 추가.husky/pre-commithook 추가lint-staged설정 추가ts/tsx/js/jsx파일에 대해eslint --fix,prettier --write실행되도록 설정json/md/css파일에 대해prettier --write실행되도록 설정🪧 미완성 작업
N/A
🤔 논의 사항 및 참고 사항
현재는 warning이 많아서 warning 차단은 설정안해놓았습니다.
추후에 개발 재설계 완료한 후에 새로운 기능 개발 진행 전에 warning 차단 설정 넣으면 좋을것같습니다.
현재 Husky에 대한 개념을 공부중인데, 간단히 설명하면
이렇게 나뉜다고 보면 됩니다.
Husky는 검사 자체를 하는 도구가 아닌, 커밋 전에 특정 명령을 자동으로 실행할수 있도록 연결해주는 도구입니다.
현재는 커밋 직전 단계(pre-commit단계) 에서
lint-staged를 실행하도록 설정되어있으며, 현재 작업물중에서 추가되거나 변경된 파일에 대해서만eslint --fix와prettier --write작업이 수행되도록 설정했습니다.여기서,
eslint --fix: ESLint 가 단순 경고표시만 하는것 뿐만아니, 자동 수정 가능한 간단한 규칙에 대해서는 코드를 직접 수정해주는 기능 제공해줍니다.prettier --write:prettier가 코드 포맷 정리 도구이고,--write는 파일을 실제로 포맷을 적용해서 고쳐쓰는 옵션입니다.✅ 체크리스트
Summary by CodeRabbit