Skip to content

Convention

Areum Yang edited this page Sep 16, 2022 · 4 revisions

์ปจ๋ฒค์…˜ ๋ฃฐ

๐Ÿค— Naming

ํŒŒ์ผ๋ช…

  • ํŒŒ์ผ๋ช…์€ ๊ธฐ๋ณธ์ ์œผ๋กœ PascalCase๋กœ ์ž‘์„ฑํ•œ๋‹ค.
  • style์€ ์ปดํฌ๋„ŒํŠธ ํŒŒ์ผ๊ณผ ํ•จ๊ป˜ ์ž‘์„ฑํ•œ๋‹ค.(emotion)

๋ณ€์ˆ˜๋ช…

  • ๋ณ€์ˆ˜๋ช…์€ ๊ธฐ๋ณธ์ ์œผ๋กœ camelCase๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • ๊ฐ€๋Šฅํ•œ ๋ช…์‚ฌ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • ๋ณต์ˆ˜์˜ ๊ฒฝ์šฐ ๋ณต์ˆ˜ํ˜• ๋ช…์‚ฌ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • boolean ํ˜•์„ ๊ฐ–๋Š” ๋ณ€์ˆ˜๋Š” ์•ž์— is๋ฅผ ๋ถ™์ธ๋‹ค.

ํ•จ์ˆ˜๋ช…

  • ํ•จ์ˆ˜๋ช…์€ ๊ธฐ๋ณธ์ ์œผ๋กœ camelCase๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • ๊ฐ€๋Šฅํ•œ ๋™์‚ฌ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • ํ•จ์ˆ˜๋ช…์„ ์ถ•์•ฝํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • booleanํ˜•์„ returnํ•˜๋Š” ํ•จ์ˆ˜๋Š” ์•ž์— check๋ฅผ ๋ถ™์ธ๋‹ค.

์Šคํƒ€์ผ

  • ๊ณตํ†ต ์Šคํƒ€์ผ ์†์„ฑ, ๋ณ€์ˆ˜๋Š” ๋ฉ”์ธ Stylesheet์— ์ •์˜
  • ์ดํ›„ ๊ฐ ์ปดํฌ๋„ŒํŠธ๋งˆ๋‹ค ํ•ด๋‹นํ•˜๋Š” ์Šคํƒ€์ผ์„ emotion/styled-components ๋กœ ์ •์˜
  • ์Šคํ† ๋ฆฌ๋ถ์„ ํ†ตํ•ด ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„ ๋ฐ ํ…Œ์ŠคํŠธ ์ง„ํ–‰

์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ๋„ค์ด๋ฐ

  • props๋Š” on~
  • ํ•จ์ˆ˜์ด๋ฆ„์€ handle~

๐Ÿ˜ Type Conventions

https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/basic_type_example#more-advice

  • API, library ๋“ฑ์˜ ํƒ€์ž…์„ ์ •์˜ํ•  ๋•Œ๋Š” ์ถ”ํ›„ ํ™•์žฅ์— ์šฉ์ดํ•˜๋„๋ก interface๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
  • Props, State ๋“ฑ์˜ ํƒ€์ž…์„ ์ •์˜ํ•  ๋•Œ๋Š” ์ผ๊ด€์„ฑ๊ณผ ์ œํ•œ์ ์ด๊ธฐ ๋•Œ๋ฌธ์— type์„ ์‚ฌ์šฉํ•œ๋‹ค.

๐Ÿ™„ Issue Conventions

  • Issue ๋‚ด์šฉ์€ Todo-List ํ˜•์‹์œผ๋กœ ์ž‘์„ฑํ•œ๋‹ค.
  • Issue ๋‹จ์œ„๋Š” ๊ธฐ๋Šฅ ๋‹จ์œ„๋กœ ์ž‘์„ฑํ•œ๋‹ค.
  • Issue ๋ช…
    • feat/Issue ๋ช…
    • fix/Issue ๋ช…

๐Ÿ‘Š Commit Message Conventions

  • ์ปค๋ฐ‹ ์‹œ ์•„๋ž˜ ๊ทœ์น™์„ ์ฐธ๊ณ ํ•ด ๋ฉ”์„ธ์ง€๋ฅผ ์ž‘์„ฑํ•˜์ž, ์˜์–ด๋กœ ์ž‘์„ฑํ•  ํ•„์š”๋Š” ์—†๋‹ค.
  • issue-number๋Š” Github์˜ issue๋ฅผ ๋ฐœ๊ธ‰ํ•˜๊ณ , ์ƒ์„ฑ๋œ ๋ฒˆํ˜ธ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.
โœจ feat: ํŒŒ์ผ, ํด๋”, ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€
๐Ÿ› fix: ๋ฒ„๊ทธ ์ˆ˜์ •
๐Ÿ’„ style: ์ฝ”๋“œ ์Šคํƒ€์ผ ๋ณ€๊ฒฝ + UI ๋ณ€๊ฒฝ
๐Ÿ“ docs: ๋ฌธ์„œ ์ƒ์„ฑ, ์ถ”๊ฐ€, ์ˆ˜์ • README.md
โ™ป๏ธ refactor: ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง
๐Ÿ’ฉ chore: ์ˆ˜์ • (JSON ๋ฐ์ดํ„ฐ ํฌ๋งท ๋ณ€๊ฒฝ / css ๋ณ€๊ฒฝ ๋“ฑ)

๐Ÿ˜พ Github branching

  • main : ๋ฐฐํฌ (๋ฒ„์ „)
  • feature/{issue-number} : ๊ธฐ๋Šฅ ๊ตฌํ˜„ branch
  • fix/{issue-number} : ๋ฒ„๊ทธ ์ˆ˜์ • branch
  • feature -> (๋ฐฐํฌ) main

๐Ÿ‘Š PR Title Conventions

  • feature/{issue-number} {desc}

๐Ÿ‘ถ Code

  • VS Code์˜ eslint์™€ prettier extention์„ ํ™œ์šฉํ•œ๋‹ค.
  • ๋ฒ„๊ทธ๊ฐ€ ์žˆ์œผ๋ฉด ์ปค๋ฐ‹ ํ•  ์ˆ˜ ์—†๋‹ค.
  • ํ•œ ๋ฉ”์„œ๋“œ์— ์˜ค์ง ํ•œ ๋‹จ๊ณ„์˜ ๋“ค์—ฌ์“ฐ๊ธฐ(๋‘ ๋‹จ๊ณ„๊นŒ์ง„ ๋ด์คŒ)๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅํ•œ๋‹ค. (3๋‹จ๊ณ„ ์•ˆ ๋“ค์–ด๊ฐ€๋„๋ก?)
  • else ์˜ˆ์•ฝ์–ด๋Š” ๊ถŒ์žฅํ•˜์ง€ ์•Š์Œ
  • ์ƒ์ˆ˜๋Š” ๋‘ ํŒŒ์ผ ์ด์ƒ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ๋ณ„๋„์˜ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌํ•ด์„œ ์ž‘์„ฑํ•œ๋‹ค.