Hello. #{Somebody}
프로젝트 파일명 스타일 정하기
✅ 보편적인 파일명 스타일
• 케밥케이스(kebab-case): my-component.js, user-profile.tsx
• 스네이크케이스(snake_case): my_component.py, config_file.json
• 파스칼케이스(PascalCase): MyComponent.jsx (React 컴포넌트)
• 카멜케이스(camelCase): 파일명에서는 거의 사용하지 않음
🛠 파일명 스타일을 선택하는 기준
스타일 사용 예시 용도
케밥케이스 (kebab-case) - HTML, CSS, JavaScript 파일 (대부분의 프로젝트) (ex. my-component.js)
스네이크케이스 (snake_case) - Python, 설정 파일, 데이터 파일 (ex. config_file.json)
파스칼케이스 (PascalCase) - React 컴포넌트 파일 (ex. MyComponent.jsx)
카멜케이스 (camelCase) - 파일명에서는 잘 사용하지 않음
📌 React 개발 시 파일명 예시 (VS Code + macOS 환경)
• 컴포넌트: UserProfile.tsx, LoginForm.jsx (파스칼케이스)
• 유틸 함수: format-date.ts, api-helper.js (케밥케이스 또는 스네이크케이스)
• 스타일 파일: button.module.css, theme.scss (케밥케이스)
React 프로젝트에서는 컴포넌트 파일은 PascalCase, 일반적인 파일은 kebab-case 또는 snake-case를 추천합니다.
Bye. #{Somebody}
'Programming > etc' 카테고리의 다른 글
[git] git 설치 및 사용하는 방법 (0) | 2025.04.06 |
---|---|
[git] git 초기화 / 파일 추가 / 커밋 / 푸시 (git init / git commit / git push) (0) | 2025.03.03 |