파일
pages.tsxtypes.tsutils.ts디렉토리
compontents/컴포넌트
Homepage.tsx변수
카멜 케이스
예 :
const userName = 'John Doe'
boolean 변수는 is , has, should, can 으로 시작
예 :
const isLoggedIn = true;
const hasPermission = false;
const shouldRenderModal = true;
const canEditProfile = false;
상수
대문자 스네이크 케이스
예 :
const API_BASE_URL
함수
카멜 케이스 사용
예 :
function getUserData(userId: string): User {}
함수는 동사로 시작
예 :
getUser();
updateCard();
이벤트 핸들러는 handle 로 시작
예 :
const handleButtonClick = (event: MouseEvent): void => {}
콜백 함수는 on 접두사 사용
예 :
const onUserLogin = (): void => {};
BASE_URL 직후 엔드 포인트 기준으로 파일 생성
/card : cardApi.ts