Skip to content

refactor: 코드 품질 개선 및 개발 환경 현대화#16

Merged
chan9yu merged 15 commits intomainfrom
refactor/code-quality-improvements
Feb 20, 2026
Merged

refactor: 코드 품질 개선 및 개발 환경 현대화#16
chan9yu merged 15 commits intomainfrom
refactor/code-quality-improvements

Conversation

@chan9yu
Copy link
Owner

@chan9yu chan9yu commented Feb 20, 2026

Summary

  • 개발 환경 설정 현대화 (ESLint Flat Config, Lefthook, CI 워크플로우)
  • CLAUDE.md 코딩 표준 기반 전체 코드베이스 리팩토링 (43개 소스 파일)
  • React 19 패턴 적용, 접근성(a11y) 개선, 코드 품질 향상

Changes

개발 환경

  • ESLint Flat Config(defineConfig) 마이그레이션 및 .claude/** ignore 추가
  • Lefthook pre-commit hooks 설정 (prettier, eslint, type-check)
  • GitHub CI workflow 및 PR 템플릿 추가
  • Claude Code commands/hooks/skills 설정
  • tsconfig es2022 타겟, noUncheckedIndexedAccess 적용
  • Node.js v24, pnpm 10.30 업데이트

Import 경로 통일 (17개 파일)

  • 상대 경로(../) → @/* 절대 경로 변경
  • Barrel file 누락 export 추가 (MdxImg, SeriesPosts, BlogPostCard, ViewToggle)
  • Barrel file 우회 import → barrel 경유로 수정

React 19 패턴 적용

  • useContext()use() 마이그레이션
  • Context.Provider<Context> 단축 문법 적용
  • React.ReactNode, React.MouseEvent → 직접 import

접근성(a11y) 개선 (16개 컴포넌트)

  • 장식 아이콘에 aria-hidden="true" 추가
  • Drawer, SearchModal, BlogLayout에 role="dialog", aria-modal="true" 추가
  • 트리거 버튼에 aria-expanded, ViewToggle에 aria-pressed 추가
  • useId() 기반 aria-labelledby 연결

코드 품질 개선

  • JSX 인라인 함수 → named 함수 추출 (10건)
  • 매직 넘버 → 명명된 상수 변경 (7건)
  • post-helpers.ts 유틸리티 함수 추출: sortPostsByDateDescending, findRelatedPostsByTags, findAdjacentPosts

Test Plan

  • pnpm type:check 통과
  • pnpm lint 통과
  • pnpm format:check 통과
  • pnpm build 통과
  • 홈 페이지 최근 포스트 표시
  • 포스트 상세 (TOC, 관련 포스트, 네비게이션)
  • 검색 모달 (Cmd+K)
  • 이미지 라이트박스
  • 태그/시리즈 페이지
  • 테마 토글, 모바일 메뉴

🤖 Generated with Claude Code

chan9yu and others added 13 commits February 19, 2026 14:41
- ESLint flat config를 defineConfig API로 간소화
- eslint-config-next 의존성 추가
- tsconfig target을 es2022로 업그레이드, noUncheckedIndexedAccess 적용
- toc.ts 배열 인덱스 접근에 guard 추가 (noUncheckedIndexedAccess 대응)
- .editorconfig indent를 space로 통일
- Node.js v24.13.1, pnpm 10.30.0 업데이트
- pnpm-workspace allowBuilds 형식으로 마이그레이션
- next.config에 poweredByHeader: false 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- lefthook을 prepare-commit-msg hook으로 변경
- pre-commit에 type-check 추가
- 커밋 템플릿을 간결하게 정리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- self-review, commit, create-pr 커맨드 추가
- deferred linting 패턴의 hooks 설정 추가
- $CLAUDE_PROJECT_DIR 기반 이식성 있는 경로 설정
- hook timeout 설정 (mark-lint: 5초, post-stop-lint: 120초)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- commit-msg.js → commit-msg.mjs
- copy-content-images.js → copy-content-images.mjs
- lefthook.yaml, package.json 참조 경로 업데이트

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
같은 feature 내부에서도 상대 경로 대신 @/* 절대 경로를 사용하도록
규칙을 변경하여 프로젝트 전체의 import 일관성을 확보

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PR 대상 CI 파이프라인 추가 (lint, type:check, build)
- PR 템플릿 추가
- .claude lint flag 파일 정리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tailwind CSS @apply 등 커스텀 at-rule 경고 비활성화

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
빌드 타임에 contents 서브모듈에서 복사되는 public/posts/ 제외

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- features 내부 상대 경로(../) import를 @/features/*/로 변경 (17건)
- mdx barrel에 MdxImg export 추가
- series barrel에 SeriesPosts export 추가
- cross-feature import를 barrel 경유로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- useContext → use(), Context.Provider → Context 단축 문법 적용
- React.ReactNode/MouseEvent를 직접 import로 변경 (5건)
- 포스트 정렬/관련 포스트/인접 포스트 유틸리티 함수 추출
- BlogLayout에 useId() 기반 aria-labelledby 연결
- blog barrel에 BlogPostCard, ViewToggle, 유틸리티 함수 export 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 장식 아이콘에 aria-hidden="true" 추가 (16개 컴포넌트)
- Drawer, SearchModal에 role="dialog", aria-modal="true" 추가
- MobileMenu, SearchButton에 aria-expanded 추가
- ViewToggle에 aria-pressed 추가
- JSX 인라인 함수를 named 함수로 추출 (10건)
- 매직 넘버를 명명된 상수로 변경 (7건)
- barrel bypass import를 barrel 경유로 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- app/page.tsx의 인라인 sort를 유틸리티 함수로 교체
- TrendingPosts의 인라인 sort를 유틸리티 함수로 교체
- 홈 페이지 포스트 제한 수를 RECENT_POSTS_LIMIT 상수로 추출

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ESLint globalIgnores에 .claude/** 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog9yu-dev Ready Ready Preview, Comment Feb 20, 2026 1:54am

GitHub Actions 예약어 제한으로 GITHUB_REPO_CLONE_TOKEN → REPO_CLONE_TOKEN 변경

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chan9yu chan9yu merged commit 8cade39 into main Feb 20, 2026
4 checks passed
chan9yu added a commit that referenced this pull request Feb 20, 2026
refactor: 코드 품질 개선 및 개발 환경 현대화
chan9yu added a commit that referenced this pull request Feb 28, 2026
refactor: 코드 품질 개선 및 개발 환경 현대화
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant