Skip to content
/ template-next Public template

A template for Next.js projects

License

Notifications You must be signed in to change notification settings

mkvlrn/template-next

Repository files navigation

template-next

A sane, opinionated template for esm nextjs projects written in typescript.

Uses:

why use this instead of nextjs-cli?

  • biome is a linter/formatter running on git hooks (pre-commit, pre-push)
  • vitest as a test runner

Aside from that, does what the cli does.

running

yarn dev

Runs the project in watch mode, and will automatically restart on changes.

yarn build

Builds the project to ./build.

yarn start

Runs the project in production mode using vite's preview server.

yarn test, yarn test:e2e

Runs tests with vitest.

yarn tidy

Runs biome in fix mode (only safe fixes) to lint and format the project. Not only ./src and ./test, but also all "loose" config files around root (js, ts, json, jsonc) or other directories.

yarn typecheck

Runs type checking using tsc and the tsconfig.json file, which is not the one used to build the project.

that tsconfig.json seems very strict and opinionated

Yup.

vscode

You might want to install the recommended extensions in vscode. Search for @recommended in the extensions tab, they'll show up as "workspace recommendations".

If you have been using eslint and prettier and their extensions, you might want to disable eslint entirely and keep prettier as the formatter only for certain types of files.

I suggesting using the settings in .vscode/settings-example.json, that should be pasted into your own .vscode/settings.json. I'm not commiting the .vscode/settings.json proper because it shouldn't be in VCS as it contains your personal settings.