Convention - boostcampwm-2022/web36-Japari GitHub Wiki

๋„ค์ด๋ฐ ์ปจ๋ฒค์…˜

CSS

  • kebab-case

DB

  • snake_case

ํŒŒ์ผ, ํด๋” ์ด๋ฆ„

  • ํด๋ž˜์Šค, ์ปดํฌ๋„ŒํŠธ ํŒŒ์ผ
    • PascalCase
  • ๊ทธ ์™ธ ํŒŒ์ผ, ํด๋”
    • camelCase
  • client/pages ํ•˜์œ„ ํŒŒ์ผ์€ ์ปดํฌ๋„ŒํŠธ์ง€๋งŒ ์˜ˆ์™ธ๋กœ camelCase ์‚ฌ์šฉ

JS

  • ํด๋ž˜์Šค, ์ปดํฌ๋„ŒํŠธ
    • PascalCase
  • ๋ณ€์ˆ˜, ํ•จ์ˆ˜
    • camelCase

๊ธฐํƒ€

  • ๊ฒฝ๋กœ์™€ ๊ด€๋ จ๋œ ๊ฒƒ์€ ์ œ์ผ ์ƒ๋‹จ์— import
  • SEO๋ฅผ ์ƒ๊ฐํ•˜๋ฉด์„œ ํƒœ๊ทธ ์„ ํƒํ•ด๋ณด๊ธฐ
  • ๊ทธ ์™ธ ๊ทœ์น™์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ํ•˜๋ฉด์„œ ๋งž์ถฐ๊ฐ€๊ธฐ๋กœ ๊ฒฐ์ •

๋ธŒ๋ Œ์น˜ ์ปจ๋ฒค์…˜

  • kebab-case
  • ์ œ์ผ ์ƒ๋‹จ์— main
  • ์•„๋ž˜์— develop
  • ๊ธฐ๋Šฅ ๋ณ„๋กœ feature/000๋กœ ๊ฐœ๋ฐœํ•œ๋‹ค.
  • ํ”„๋ก ํŠธ์™€ ๋ฐฑ์—”๋“œ ์ฝ”๋“œ์˜ ํ˜ผํ•ฉ ๋ฐฉ์ง€๋ฅผ ์œ„ํ•ด ์ปค๋ฐ‹

CSS ์ปจ๋ฒค์…˜

  • rem์œผ๋กœ ํ†ต์ผ

URL ์ปจ๋ฒค์…˜

  • ๋žœ๋”ฉ ํŽ˜์ด์ง€
    • /
  • ๋กœ๋น„ ํŽ˜์ด์ง€
    • /lobby
  • ๋Œ€๊ธฐ์‹ค ํŽ˜์ด์ง€
    • /waiting/:id
  • ๊ฒŒ์ž„ ํŽ˜์ด์ง€
    • /playing/:id
      • game ์ •๋ณด ๋ถˆ๋Ÿฌ์˜จ ํ›„, participants์— user๊ฐ€ ์†ํ•ด์žˆ๋Š”์ง€ ๊ฒ€์‚ฌ ํ›„, ์—†์œผ๋ฉด ๋กœ๋น„๋กœ ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ

์ฝ”๋“œ ์Šคํƒ€์ผ

Prettier

{
  "singleQuote": false,
  "semi": true,
  "useTabs": false,
  "tabWidth": 2,
  "trailingComma": "es5",
  "printWidth": 120,
  "arrowParens": "avoid"
}

Eslint

npx eslint --init ์œผ๋กœ ์ตœ์ดˆ ์„ค์ • ํ›„ prettier, react, react-hooks ๊ด€๋ จ ์„ค์ • ์ถ”๊ฐ€

  module.exports = {
  env: {
    browser: true,
    es2021: true,
  },
  plugins: ["react", "react-hooks", "@typescript-eslint"],
  extends: [
    "eslint:recommended",
    "plugin:react/recommended",
    "plugin:react-hooks/recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:prettier/recommended",
  ],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module",
    project: "./tsconfig.json",
  },
  rules: {},
  settings: {
    react: {
      version: "detect",
    },
  },
};

ํด๋” ๊ตฌ์กฐ ์ปจ๋ฒค์…˜

  • ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ ๋ฐ”๋€” ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ํ™•์ •ํ•˜์ง€ ์•Š๋Š”๋‹ค.

ํ”„๋ก ํŠธ์—”๋“œ

  • public
  • src
    • api
    • pages
      • LandingPage
        • index.tsx
        • style.ts
    • components
    • hooks
    • constants
    • utils
    • store
    • styles (reset, global, theme)
    • @types
      • index.d.ts
      • import { BuildingUploading } from "@types";
      • image
      • building.d.ts
      • image

๋ฐฑ์—”๋“œ

โš ๏ธ **GitHub.com Fallback** โš ๏ธ