๋ณธ๋ฌธ์œผ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

201215

ยท ์•ฝ 3๋ถ„

React + TypeScript + Storybook + ESLint ์„ธํŒ…#

ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ#

yarn create react-app my-app-name --template typescript

CRA + ESLint + Prettier#

Create-React-App with TypeScript, ESLint, Prettier, and Github Actions

Husky + lint-staged#

์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํŒŒ์ผ ์ง€์šฐ๊ธฐ#

.gitignore#

.gitignore ๋Š” ํ”„๋กœ์ ํŠธ์—์„œ ์ค‘์š”ํ•œ ๊ฒƒ์œผ๋กœ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ์ž์ฒด์—์„œ ์ƒ์„ฑํ•œ ํŒŒ์ผ์ด๋‚˜ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋‚˜์—ดํ•ด์•ผ ํ•œ๋‹ค. ๊ฐ€์žฅ ์ข‹์€ ์˜ˆ๋Š” ์บ์‹œ ํŒŒ์ผ, ๋กœ๊ทธ, ๋กœ์ปฌ ๊ตฌ์„ฑ ๋“ฑ์ด๋‹ค.

.vscode , .idea , .DS_Store ๋“ฑ์€ ํ”„๋กœ์ ํŠธ์˜ .gitignore ๋ณด๋‹ค ์ปดํ“จํ„ฐ์˜ ๊ธ€๋กœ๋ฒŒ .gitignore ์— ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

๊ธ€๋กœ๋ฒŒ .gitignore ๋Š” home ๋””๋ ‰ํ† ๋ฆฌ์˜ .gitconfig ์„ ๋ณด๋ฉด ์•Œ ์ˆ˜ ์žˆ๋‹ค.

[core]    excludesfile = /Users/{home}/.gitignore_global

Don't put .idea and .vscode directories to project's .gitignore

ํด๋” ๊ตฌ์„ฑํ•˜๊ธฐ#

โ””โ”€โ”€ src    โ”œโ”€โ”€ components        โ””โ”€โ”€ src    โ”œโ”€โ”€ pages    โ”œโ”€โ”€ App.tsx    โ””โ”€โ”€ index.tsx

Storybook ์„ค์น˜ํ•˜๊ธฐ#

npx sb init

https://storybook.js.org/docs/react/get-started/install


์›น ํฐํŠธ ์‚ฌ์šฉ#

NAVER D2


free illustration#

unDraw - Open source illustrations for any idea


Styled Components#

The Advanced Way to Style with Styled Components

Thoughts around design systems: implementationโ€Š-โ€ŠReact, Styled-Components, and more

How does the ampersand work in styled-components?

The Sass Ampersand | CSS-Tricks

Type Guard#

https://www.typescriptlang.org/docs/handbook/advanced-types.html

validate css unit value#

https://www.reddit.com/r/learnjavascript/comments/8u5pew/function_that_can_validate_if_a_string_is_a_valid/