Tech Stack:
Next.js | TypeScript | ESLint | Prettier | Tailwind CSS | pnpm
To use this starter, run the following command to create your Next.js app:
pnpm create next-app my-app -e https://github.com/heloineto/next-starter
Note:
To have an up-to-date project, verify when this template was last updated. If you believe it was too long ago, consider recreating it following (and changing if necessary) the steps below.
-
You can create a TypeScript project with
create-next-app
using the--ts
,--typescript
flag. Instructions here.pnpm create next-app --ts next-starter
-
Install Tailwind. Instructions here.
Remember to use
pnpm
instead ofnpm
Add automatic tailwind class sorting with prettier. Instructions here
pnpm i -D prettier prettier-plugin-tailwindcss
-
Configure Prettier. See configuration.
Install
eslint-config-prettier
. See more.pnpm i -D eslint-config-prettier
Notes:
Trailing commas improve developer experience. See why
-
Configure ESLint. See configuration.
Install ESLint Plugin TypeScript. Instructions here.
pnpm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser`
-
Add Husky and lint-staged
Install husky. Instructions here.
Add lint-staged. Instructions here.
-
Add vscode settings & extensions
// .vscode/settings.json { "editor.codeActionsOnSave": [ "source.addMissingImports", "source.fixAll", "source.organizeImports" ], "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.foldingImportsByDefault": true, "editor.formatOnSave": true }
// .vscode/extensions.json { "recommendations": [ "svelte.svelte-vscode", "bradlc.vscode-tailwindcss", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode" ] }
-
Add common utils
src/ ├ lib/ ├ utils/ │ └ classes.ts