- β‘οΈ Next.js 12
- βοΈ React 18
- β TypeScript
- π ESLint β Find and fix problems in your code
- π Prettier β Code Formatter for consistent style
- πΆ Husky β For running scripts before committing
- π Commitizen β To define a standard way of committing rules
- π Commitlint β Make sure your commit messages follow the convention
- π Renovate β Keep your dependencies up to date
- π« lint-staged β To run ESLint and Prettier against staged Git files
- π· PR Workflow β Run Type Check & Linters on all Pull Requests
- βοΈ EditorConfig - Maintain consistent coding styles across editors and IDEs
- π Path Mapping β Import components or images using the
@prefix
The best way to start with this template is using Create Next App.
yarn create next-app -e https://github.com/jpedroschmitz/typescript-nextjs-starter
# or
npx create-next-app -e https://github.com/jpedroschmitz/typescript-nextjs-starter
To start the project locally, run:
yarn devOpen http://localhost:3000 with your browser to see the result.
βThis starter is by far the best TypeScript starter for Next.js. Feature packed but un-opinionated at the same time!β
β Arafat Zahan
βBrilliant work!β
β Soham Dasgupta
List of websites that started off with Next.js TypeScript Starter:
- Node.js >= 12.22.0
- Yarn 1 (Classic)
.githubβ GitHub configuration including the CI workflow..huskyβ Husky configuration and hooks.publicβ Static assets such as robots.txt, images, and favicon.srcβ Application source code, including pages, components, styles.
yarn devβ Starts the application in development mode athttp://localhost:3000.yarn buildβ Creates an optimized production build of your application.yarn startβ Starts the application in production mode.yarn type-checkβ Validate code using TypeScript compiler.yarn lintβ Runs ESLint for all files in thesrcdirectory.yarn formatβ Runs Prettier for all files in thesrcdirectory.yarn commitβ Run commitizen. Alternative togit commit.
TypeScript are pre-configured with custom path mappings. To import components or files, use the @ prefix.
import { Button } from '@/components/Button';
// To import images or other files from the public folder
import avatar from '@/public/avatar.png';By default, this starter uses Yarn 1 (Classic), but this choice is yours. If you'd like to switch to npm, delete the yarn.lock file, install the dependencies with npm install, and change the CI workflows, Husky Git hooks, and lint-staged steps to use npm commands.
This project is licensed under the MIT License - see the LICENSE.md file for more information.
