feat(typescript): React 템플릿 타입스크립트 도입 및 마이그레이션 지원 #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
수정 사유 Reason for modification
수정된 소스 내용 Modified source
본 PR은 전자정부 표준프레임워크 React 템플릿에 TypeScript 지원을 추가하는 PR입니다.
최근 웹 개발의 트렌드 및 안전성을 반영하여
Issue #14: TypeScript 버전 추가 요청을 해결했습니다.
이를 통해 기존 JavaScript 코드베이스와의 완전한 호환성을 보장하면서,
타입스크립트 마이그레이션 및 새로운 기능 개발이 가능하도록 프로젝트 구조를 개선했습니다.
개발자는 필요에 따라 기존 .jsx 파일을 유지하거나 .tsx 파일로 전환할 수 있도록 설계하였습니다.
1. 주요 기능
2. 주요 변경사항
TypeScript 설정 파일 추가
tsconfig.json: 프로젝트의 TypeScript 컴파일러 옵션을 설정했습니다. (strict 모드 활성화, 경로 별칭 @/* 설정 등)jsconfig.json: JavaScript 개발 환경을 위한 경로 별칭 등을 설정했습니다.ESLint 설정 현대화 (Flat Config)
eslint.config.js: 최신 Flat Config 형식으로 변경하여 설정을 단순화했습니다.@typescript-eslint플러그인을 통합했습니다.타입 정의 시스템 구축
src/types/디렉토리를 생성하여 공통, API, 환경변수 타입을 관리하도록 설계하였습니다.빌드 시스템 통합 (Vite)
vite.config.js:.ts및.tsx파일을 처리하도록 Vite 설정을 업데이트하고, 타입 경로 별칭(@/types)을 추가했습니다.package.json스크립트typescript,typescript-eslint등 개발 의존성을 추가하였습니다.설계 고려사항 및 기대효과
본 프로젝트를 타입스크립트를 적용하는데 있어, 기존 프로젝트와의 호환성을 최대한 고려하여 설계를 진행하였고,
기존
.jsx코드와의 충돌 없이, 점진적으로 타입스크립트 마이그레이션이 가능하도록 구성하였습니다.아래는 본 pr을 통해 예상되는 기대효과를 정리해 보았습니다.
상세 내용은 아래 파일을 확인해주시면 감사하겠습니다.
TYPESCRIPT.mdJUnit 테스트 JUnit tests
테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.
테스트 브라우저 Test Browser
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video