Commit 7eb27ca
authored
Yuhoyeong/frontend/coding convention (#95)
네, 방금 적용하신 React 프로젝트 파일 네이밍 컨벤션을 정리해 드립니다.
앞으로 팀원들과 협업할 때 이 기준을 따르면 프로젝트 구조가 훨씬 일관성 있게 유지될 것입니다.
🎨 변경된 프론트엔드 코딩 컨벤션 (File Naming)
목적: ESLint를 통해 파일 이름 규칙을 강제하여, 일관성 있는 프로젝트 구조를 유지함.
1. React 컴포넌트 파일 (.tsx)
규칙: PascalCase (대문자로 시작)
적용 대상: *.tsx 확장자를 가진 모든 파일 (단, *.d.tsx 제외)
예시:
✅ GlossaryModal.tsx
✅ UserProfile.tsx
❌ glossaryModal.tsx (소문자 시작 불가)
❌ user-profile.tsx (케밥 케이스 불가)
이유: React 컴포넌트는 코드 내에서 <GlossaryModal />처럼 대문자로 사용되므로, 파일명과 컴포넌트명을 일치시키는
것이 관례입니다.
2. 일반 함수 / Hooks / 유틸 파일 (.ts)
규칙: camelCase (소문자로 시작, 중간 단어 대문자)
적용 대상: *.ts 확장자를 가진 모든 파일 (단, *.d.ts, vite-env.ts 등 설정 파일 제외)
예시:
✅ useModal.ts (Hooks)
✅ apiClient.ts (Utils)
❌ UseModal.ts (Hooks는 보통 소문자 use로 시작)
❌ APIClient.ts
⚡️ 적용 방법 및 확인
검사 실행: 터미널에서 npm run lint를 입력하면 컨벤션에 맞지 않는 파일들이 에러로 표시됩니다.
자동 감지: VS Code 등 에디터에서 ESLint 플러그인을 사용 중이라면, 파일 생성 시 규칙에 어긋날 경우 즉시 빨간 줄이
그어집니다.
지금 바로 수정해야 할 파일들 (예시):
src/components/.../glossaryModal.tsx ➡️ GlossaryModal.tsx
src/pages/community.tsx ➡️ Community.tsx
src/pages/guide.tsx ➡️ Guide.tsx1 parent 5dc4871 commit 7eb27ca
File tree
64 files changed
+637
-267
lines changed- frontend
- src
- api
- core
- glossary
- services
- assets/image/icon
- components
- common
- CompatiblilityCheckModal
- deleteAccountModal
- expertVerify/fileUploadBox
- glossary
- glossaryModal
- moreButton
- searchResult
- guide
- contentArea
- sidebar
- stepIndicator
- header
- home
- landingPage
- PromoSection
- closingSection
- section
- searchBar
- setting
- expertPopup
- interestSelector
- stepHeader
- signIn/authSection
- layout
- base
- providers
- ui
- constants
- hooks
- pages
- oauth/kakao
- services
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+637
-267
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
22 | 45 | | |
23 | | - | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments