Open raycon opened 3 years ago
.prettierrc
{
"singleQuote": true,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80
}
.eslintrc
{
"extends": ["airbnb", "prettier"],
"settings": {
"import/resolver": {
"node": {
"paths": ["node_modules", "src", "pages"]
}
}
},
"rules": {
"no-unused-vars": 0,
"react/react-in-jsx-scope": 0, // next.js 에서는 React 를 import 할 필요가 없는 것 같음
"react/jsx-filename-extension": 0,
"react/jsx-props-no-spreading": 0,
"react/destructuring-assignment": 0,
"react/prop-types": 0,
"react/no-unescaped-entities": 0,
"react/self-closing-comp": 0
},
"plugins": ["import", "react", "react-hooks"],
"env": {
"browser": true // document 를 사용하기 위해 설정
},
"parser": "babel-eslint"
}
Material-UI
https://github.com/mui-org/material-ui/tree/master/examples/nextjs
npm install @material-ui/core @material-ui/styles
앱 생성
npx create-next-app
폴더 구조를 변경한다.
절대 경로 import 설정
jsconfig.js
import 구문에서
src/
밑의 경로로 import 할 수 있게 설정한다.ESLint
npx install-peerdeps --dev eslint-config-airbnb
npm install --save-dev eslint-config-prettier