Lesson 02: Project Setup - strvcom/frontend-academy-2022 GitHub Wiki
Speaker: Lucas Constantino
Resources
- Pull Request
- Recording (Gdrive; Was recorded separately, not during the live lesson.)
- Slides (Google Slides)
- Slides (PDF)
Other resources
Coding Steps
Create Next App
1.npx create-next-app@latest --ts .
git add .
git commit -m 'chore: create-next-app'
ESLint
2.yarn add --dev @strv/eslint-config-react @strv/eslint-config-typescript
- Update
.eslintconfig
:{ "extends": [ "next/core-web-vitals", "@strv/react", "@strv/typescript", "@strv/typescript/react" ], "parserOptions": { "project": "./tsconfig.json" } }
yarn lint
-> failsyarn lint --fix
-> worksgit commit -m 'chore: configured eslint'
Prettier
3.yarn add --dev prettier @strv/prettier-config
- Add
.prettierrc
:"@strv/prettier-config"
- Add
.prettierignore
:# 3rd Party Code node_modules # Generated .next .vercel # Misc .idea
- Update
package.json
:{ "scripts": { "format": "prettier --check ." } }
git commit -m 'chore: configured prettier'
lint-staged
4.yarn add --dev lint-staged
- Add
.lintstagedrc
:{ "*.{js,ts,tsx}": [ "eslint --fix", "prettier --write" ] }
git commit -m 'chore: configured lint-staged'
Husky
5.yarn add --dev husky
yarn husky install
yarn husky add .husky/pre-commit "yarn lint-staged"
- Update
package.json
:{ "scripts": { "prepare": "husky install" } }
git commit -m 'chore: configured husky'
Commit Linting
6.yarn add --dev @commitlint/cli @strv/commitlint-config
yarn husky add .husky/commit-msg "yarn commitlint --edit $1"
- Add file
.commitlintrc
:{ "extends": ["@strv/commitlint-config"] }
git commit -m 'chore: configured commitlint'
Readme
8.Create the contents of README.
9. Deployment
- Setup Vercel deployment.
npx vercel
<- will guide through whole deployment process