Today I Learned

Vite로 React + TypeScript 프로젝트 생성하기

디아_ 2024. 8. 5. 21:12
728x90

출처: https://blog.bitsrc.io/maximize-your-react-skills-build-a-to-do-list-app-from-start-to-finish-with-typescript-vite-b1b5e0faecbe

 

 

1. 프로젝트 생성

yarn create vite my-app --template react-ts

 

 

타입스크립트 없이 리액트만 사용하고 싶다면 react-tsreact를 써준다.

프로젝트가 정상적으로 생성 되면 yarn을 한번 더 입력해서 패키지 설치를 해준다.

 

2. (optional) eslint 설정

 

프로젝트를 생성하고 나면 eslint 에러가 나는 것을 확인할 수 있다.

 

 

해당 '~~' is assigned a value but never used 에러 해결하기 위해서 eslint config 파일에 rules에 no-unused-vars 옵션을 off로 설정해주는 규칙을 추가해준다.

 

 


참고자료

https://vitejs.dev/guide/#scaffolding-your-first-vite-project

728x90