Next.js Starter
Base Starter for Next.js Project
This branch is the most basic starter for a new Next.js project.
It includes only packages used in every Next.js project being:
Typescript
A statically-typed superset of JavaScript.
TailwindCSS
A utility-first CSS framework for building responsive designs.
ESLint
A pluggable linting utility for JavaScript and TypeScript.
(using) App Router
A recommended routing solution for Next.js applications.
Prettier
An opinionated code formatter for consistent code styling.
Prettier Tailwind Plugin - orders classNames
A Prettier plugin that orders TailwindCSS classNames.
# above the app directory run...
D:\CODE\TOOLS>pnpm dlx create-next-app nxt
# choose options. Would you like to...
# use TypeScript? Yes
# use ESLint? Yes
# use Tailwind CSS? Yes
# use 'src/' directory? No
# use App Router? (recommended) Yes
# customize the default import alias (@/*)? No
# hop into the project folder
D:\CODE\TOOLS>cd nxt
# Add Prettier and the Tailwind plugin for it to sort classes as development dependencies
D:\CODE\TOOLS\nxt>pnpm add -D prettier prettier-plugin-tailwindcss
# open in VS code using...
D:\CODE\TOOLS\nxt>code .
# create .prettierrc file in the project and add settings (see D:\CODE\TOOLS\nxt\.prettierrc)
# can now run and open in http://localhost:3000
D:\CODE\TOOLS\nxt>pnpm dev
Check VS Code settings (important for ordering TailwindCSS classNames)...
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Marker | 001