2024-04-02.md

๐Ÿก

DIL: ๋ชจ๋˜ ๋ฆฌ์•กํŠธ ๋”ฅ ๋‹ค์ด๋ธŒ, 5์ฃผ์ฐจ-2

์Šคํ„ฐ๋””: ์›”๊ฐ„ CS, https://github.com/monthly-cs/2024-03-modern-react-deep-dive
์˜ค๋Š˜ ์ง„ํ–‰: ๊ฐœ์ธ๊ณต๋ถ€


DIL-week5-2_2024-04-02

| DIL ์ฃผ์ฐจ | ๋ฒ”์œ„ | ๋‚ด์šฉ | ์˜ค๋Š˜์ฐจ ์ง„๋„ | | -------- | ---- | -------------------------------------------------- | ----------- | | 5์ฃผ์ฐจ | 9์žฅ | ๋ชจ๋˜ ๋ฆฌ์•กํŠธ ๊ฐœ๋ฐœ ๋„๊ตฌ๋กœ ๊ฐœ๋ฐœ ๋ฐ ๋ฐฐํฌ ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ | 538p~542p |

์˜ค๋Š˜ ์ฝ์€ ๋‚ด์šฉ์„ markdown์œผ๋กœ ๊ฐ„๋‹จํžˆ ๋ฉ”๋ชจ


๋ชจ๋˜ ๋ฆฌ์•กํŠธ ๊ฐœ๋ฐœ ๋„๊ตฌ๋กœ ๊ฐœ๋ฐœ ๋ฐ ๋ฐฐํฌ ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ

next.config.js ์ž‘์„ฑ

/** @type {import("next").NextConfig} */
const nextConfig = {
  reactStrictMode: true, // ๋ฆฌ์•กํŠธ ์—„๊ฒฉ๋ชจ๋“œ
  poweredByHeader: false, // X-Powered-By ํ—ค๋” ์ œ๊ฑฐ
  eslint: {
    ignoreDuringBuilds: true,
    // - ์ผ๋ฐ˜์ ์œผ๋กœ ๋นŒ๋“œ ์‹œ Next.js, ESLint๋„ ๊ฐ™์ด ์ˆ˜ํ–‰ํ•œ๋‹ค
    // - true๋กœ ์„ค์ •ํ•ด์„œ ESLint CI ๊ณผ์ •์—์„œ ๋ณ„๋„๋กœ ์ž‘๋™ํ•˜๊ฒŒ ํ•˜๊ธฐ -> ๋นŒ๋“œ๋ฅผ ๋น ๋ฅด๊ฒŒ!
  },
};

module.exports = nextConfig;

ESLint์™€ Prettier ์„ค์ •ํ•˜๊ธฐ

  • ESLint JS๊ฐ€ ์ •์  ๋ถ„์„์— ์˜์กด
  • eslint-config-next๋Š” ์Šคํƒ€์ผ๋ง ์ •์˜๋Š” x
  • @titicaca/eslint-config-triple
//.eslintrc.json
{
  "extends": ["next/core-web-vitals"]
}

์Šคํƒ€์ผ ์„ค์ •ํ•˜๊ธฐ

  • styled-component ์„ค์ •์˜ ๊ฒฝ์šฐ
    • ServerStyleSheet: _document.tsx์— Provider ๋ž˜ํผ ์ถ”๊ฐ€
    • next.config.js์— styledComponent: true ์ถ”๊ฐ€