정중식
2020. 1. 4. 01:13
프로젝트 구조
- 폴더를 프론트와 백엔드로 나눔
- cd front , npm init
- npm i react react-dom next , npm i -D nodemon webpack , npm i -D eslint (협업 작업시 코드스타일 규칙을 정할수있음★)
- front -> .eslintrc파일 생성
{
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module", // import, export등등
"ecmaFeatures": {
"jsx": true
} // jsx문법 허용
},
"env": {
"browser": true,
"node": true
// react는 브라우저와 node위에서 돌아가기때문에 true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
// eslint가 기본적으로 제공해주는 옵션
"plugins": ["import", "react-hooks"] // import문법과 hooks문법을 지원해줌
}
plugins 에있는건 다 설치해줘야함
- npm i -D eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks
(devDependencies에 가도록)