# CRA로 리액트 프로젝트 시작 yarn create react-app . --template typescript
# eslint --init 으로 eslint 세팅 yarn eslint --init √ How would you like to use ESLint? · style √ What type of modules does your project use? · esm √ Which framework does your project use? · react √ Does your project use TypeScript? · Yes √ Where does your code run? · browser √ How would you like to define a style for your project? · guide √ Which style guide do you want to follow? · airbnb √ What format do you want your config file to be in? · JSON √ Would you like to install them now with npm? · No
입맛대로 답변한다
특히 마지막 Would you like to install them now with npm? 물음에는 No로 답변한다
No로 답변하고 필요한 종속성을 yarn으로 설치해준다
(Yes로 답변하면, npm으로 설치되며 package-lock.json이 생성된다)
terminal
1 2 3 4 5 6 7 8 9 10 11
# 콘솔에 적힌 종속성들을 복사해서 적절히 편집하고 실행한다 # 여러 버전들을 나열해서 알려주는데, 그중에서 최신 버전을 다운받았다 yarn add -D \ eslint-plugin-react@^7.21.5 \ @typescript-eslint/eslint-plugin@latest \ eslint-config-airbnb@latest \ eslint@^7.2.0 \ eslint-plugin-import@^2.22.1 \ eslint-plugin-jsx-a11y@^6.4.1 \ eslint-plugin-react-hooks@^4 \ @typescript-eslint/parser@latest
terminal
1 2 3 4 5
# eslint와 prettier를 함께 쓰려면 아래도 함께 설치한다 yarn add -D \ prettier \ eslint-plugin-prettier \ eslint-config-prettier