코드 리뷰 시 스타일 관련 피드백을 줄이고, 일관된 스타일의 코드를 공유함으로써 가독성을 향상시킬 수 있습니다.
.vscode/settings.json
VSCode 명령 팔레트를 열고 (
Ctrl + Shift + P
또는Cmd + Shift + P
) - Use Workspace Version을 지정
.vscode/css_custom.json
.vscode/extensions.json
.gitattributes
.editorconfig
prettier-plugin-tailwindcss
를 사용하지 않고, eslint-plugin-tailwindcss
를 사용합니다..vscode/settings.json
1{ 2 "editor.tabSize": 2, 3 "editor.codeActionsOnSave": { 4 "source.fixAll": "always" 5 }, 6 "css.customData": [ 7 ".vscode/css_custom.json" 8 ], 9 "typescript.tsdk": "node_modules/typescript/lib", 10 "tailwindCSS.experimental.classRegex": [ 11 [ 12 "cva\\(([^)]*)\\)", 13 "[\"'`]([^\"'`]*).*?[\"'`]" 14 ], 15 [ 16 "cx\\(([^)]*)\\)", 17 "(?:'|\"|`)([^']*)(?:'|\"|`)" 18 ] 19 ] 20}
editor.tabSize
로 들여쓰기 크기를 통일하고, 저장 시 자동으로 코드 스타일을 수정합니다.
또한, TypeScript의 버전을 프로젝트에 명시된 버전을 따르도록 하여, VSCode와 프로젝트 간 버전 불일치를 방지할 수 있습니다.
.vscode/extensions.json
1{ 2 "recommendations": [ 3 "dbaeumer.vscode-eslint", 4 "bradlc.vscode-tailwindcss" 5 ] 6}
.vscode/css_custom.json
1{ 2 "version": 1.1, 3 "atDirectives": [ 4 { 5 "name": "@tailwind", 6 "description": "Use the @tailwind directive to insert Tailwind's `base`, `components`, `utilities`, and `screens` styles into your CSS." 7 }, 8 { 9 "name": "@apply", 10 "description": "Use @apply to inline any existing utility classes into your own custom CSS." 11 } 12 ] 13}
.gitattributes
1* text=auto eol=lf
Git이 모든 텍스트 파일의 줄 끝을 LF로 통일하도록 강제합니다. 결과적으로는 개발자가 사용하는 OS 간 발생할 수 있는 줄끝 관련 차이를 제거하여 문제를 방지할 수 있습니다.
.editorconfig
1# 최상위에 있는 파일로 명시 2root = true 3 4# 모든 파일에 적용 5[*] 6end_of_line = lf 7insert_final_newline = true 8charset = utf-8 9indent_style = space 10indent_size = 2 11trim_trailing_whitespace = true 12 13# TypeScript와 JavaScript 파일에 대한 특별 설정 14[*.{ts,tsx,js,jsx}] 15indent_size = 2
에디터마다 다를 수 있는 기본 설정을 통일하여, 코드 작성 시 일관된 스타일을 유지합니다.