#
React + TypeScript + Storybook + ESLint ์ธํ#
ํ๋ก์ ํธ ์์ฑyarn create react-app my-app-name --template typescript
#
CRA + ESLint + PrettierCreate-React-App with TypeScript, ESLint, Prettier, and Github Actions
#
Husky + lint-staged#
์ฌ์ฉํ์ง ์๋ ํ์ผ ์ง์ฐ๊ธฐreportWebVitals
- web-vitals๋ฅผ ํตํ ์ฑ๋ฅ ์ธก์ ์ ์ฌ์ฉ๋จyarn remove web-vitals
setupTests.ts
- browser API๋ฅผ ์ฌ์ฉํ๊ฑฐ๋ Test ์คํ ์ global setup์ด ํ์ํ๊ฒฝ์ฐ์ ์ฌ์ฉjest์
setupFilesAfterEnv
์ ๊ด๋ จ - https://jestjs.io/docs/en/configuration#setupfilesafterenv-arrayhttps://create-react-app.dev/docs/running-tests/#initializing-test-environment
react-app-env.d.ts
- yarn start ๋ง๋ค ์์ฑ๋จ. ๋ง์ ์ ์ ๊ฐ ์์ฑ์ ๋ฉ์ถฐ๋ฌ๋ผ๊ณ react team์ ์์ฒญํจ.gitignore
์/src/react-app-env.d.ts
์ถ๊ฐ.vscode/settings.json
์ ์ถ๊ฐ"files.exclude": { "src/*.d.ts": true}
#
.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
lint error ๋ฐ์ (์์)
.eslintignore
**/*.stories.tsx**/stories/*.tsx
.eslintrc.js
rules: { // ... 'import/no-extraneous-dependencies': [ 'error', { devDependencies: [ '**/*.stories.tsx', ], }, ], // ...}
storybook babel-loader crash
create-react-app babel-loader clash ยท Issue #4764 ยท storybookjs/storybook
https://storybook.js.org/docs/react/get-started/install
#
์น ํฐํธ ์ฌ์ฉ#
free illustrationunDraw - Open source illustrations for any idea
#
Styled ComponentsThe 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 Guardhttps://www.typescriptlang.org/docs/handbook/advanced-types.html