Next.js 프로젝트 시작하기

thumbzzero·2023년 6월 22일

next.js docs: https://nextjs.org/docs
prettier docs: https://prettier.io/docs/en/install.html

typescript로 프로젝트 시작
npx create-next-app@latest --typescript

run: yarn dev

prettier 설정
설치: yarn add --dev --exact prettier
기본 설정: echo {}> .prettierrc.json

{
  "trailingComma": "es5",
  "tabWidth": 2,
  "semi": true,
  "singleQuote": true
}

eslint 기본 포맷 rule과 충돌나지 않도록: yarn add --dev eslint-config-prettier
.eslintrc.json 파일에 prettier 추가:

{
  "extends": ["next/core-web-vitals", "prettier"]
}

사용하지 않는 파일 정리 : index.tsx, public 폴더 내 파일들, css 파일

0개의 댓글