Skip to content

Commit 75ead3f

Browse files
feat: next.js 16 (#1444)
* chore: next.js 16 * chore: update eslint config and page layout * docs: update readme with husky instructions * docs: update next version * docs: ahh missed more stuff * docs: missing stuff
1 parent 10d9b29 commit 75ead3f

File tree

13 files changed

+1111
-575
lines changed

13 files changed

+1111
-575
lines changed

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.pnp.js
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
712

813
# JetBrains IDE files
914
.idea/
@@ -28,8 +33,8 @@ yarn-debug.log*
2833
yarn-error.log*
2934
.pnpm-debug.log*
3035

31-
# local env files
32-
.env*.local
36+
# env files
37+
.env*
3338

3439
# vercel
3540
.vercel

.lintstagedrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import path from 'node:path';
2+
3+
const buildEslintCommand = (filenames) =>
4+
`eslint --fix ${filenames.map((f) => `"${path.relative(process.cwd(), f)}"`).join(' ')}`;
5+
6+
export default {
7+
'*.{js,jsx,ts,tsx}': [buildEslintCommand, 'prettier --write'],
8+
};

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
24

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 João Pedro Schmitz
3+
Copyright (c) 2025 João Pedro Schmitz
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<br />
66

77
<div align="center"><strong>Non-opinionated TypeScript starter for Next.js</strong></div>
8-
<div align="center">Highly scalable foundation with the best DX. All the tools you need to build your next project.</div>
8+
<div align="center">Highly scalable foundation with the best DX. All the tools you need to build your Next project.</div>
99

1010
<br />
1111

@@ -27,7 +27,7 @@
2727

2828
## Features
2929

30-
- ⚡️ Next.js 15 (App Router)
30+
- ⚡️ Next.js 16 (App Router)
3131
- ⚛️ React 19
3232
- ⛑ TypeScript
3333
- 📏 ESLint 9 — To find and fix problems in your code
@@ -88,15 +88,14 @@ List of websites that started off with Next.js TypeScript Starter:
8888
- [rocketseat.com.br](https://www.rocketseat.com.br)
8989
- [vagaschapeco.com](https://vagaschapeco.com)
9090
- [unfork.vercel.app](https://unfork.vercel.app)
91-
- [cryptools.dev](https://cryptools.dev)
9291
- [Add yours](https://github.com/jpedroschmitz/typescript-nextjs-starter/edit/main/README.md)
9392

9493
## Documentation
9594

9695
### Requirements
9796

98-
- Node.js >= 20
99-
- pnpm 9
97+
- Node.js >= 24
98+
- pnpm 10
10099

101100
### Directory Structure
102101

@@ -149,6 +148,16 @@ The Content Security Policy (CSP) is a security layer that helps to detect and m
149148

150149
It contains a default and minimal policy that you can customize to fit your application needs. It's a foundation to build upon.
151150

151+
### Husky
152+
153+
Husky is a tool that helps us run scrips before Git events. We have 3 hooks:
154+
155+
- `pre-commit` — (Disabled by default) Runs lint-staged to lint and format the files.
156+
- `commit-msg` — Runs commitlint to check if the commit message follows the conventional commit message format.
157+
- `post-merge` — Runs pnpm install to update the dependencies if there was a change in the `pnpm-lock.yaml` file.
158+
159+
> Important note: Husky is disabled by default in the pre-commit hook. This is intention because most developers don't want to run lint-staged on every commit. If you want to enable it, run `echo 'HUSKY_ENABLED=true' > .husky/_/pre-commit.options`.
160+
152161
## License
153162

154163
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for more information.

eslint.config.mjs

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
import path from 'node:path';
2-
import { fileURLToPath } from 'node:url';
3-
import { FlatCompat } from '@eslint/eslintrc';
4-
import js from '@eslint/js';
5-
import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin';
6-
import tsParser from '@typescript-eslint/parser';
7-
import prettier from 'eslint-plugin-prettier';
8-
9-
const __filename = fileURLToPath(import.meta.url);
10-
const __dirname = path.dirname(__filename);
11-
const compat = new FlatCompat({
12-
baseDirectory: __dirname,
13-
recommendedConfig: js.configs.recommended,
14-
allConfig: js.configs.all,
15-
});
16-
17-
export default [
18-
...compat.extends('next', 'next/core-web-vitals', 'prettier'),
1+
import eslint from '@eslint/js';
2+
import nextVitals from 'eslint-config-next/core-web-vitals';
3+
import nextTs from 'eslint-config-next/typescript';
4+
import prettier from 'eslint-config-prettier/flat';
5+
import pluginPrettier from 'eslint-plugin-prettier/recommended';
6+
import { defineConfig, globalIgnores } from 'eslint/config';
7+
import tseslint from 'typescript-eslint';
8+
9+
const eslintConfig = defineConfig([
10+
...nextVitals,
11+
...nextTs,
12+
prettier,
13+
pluginPrettier,
14+
eslint.configs.recommended,
15+
tseslint.configs.strict,
16+
tseslint.configs.stylistic,
1917
{
20-
plugins: {
21-
prettier,
22-
},
23-
2418
rules: {
2519
'prettier/prettier': 'error',
2620
camelcase: 'off',
@@ -29,18 +23,6 @@ export default [
2923
'react/jsx-props-no-spreading': 'off',
3024
'react/no-unused-prop-types': 'off',
3125
'react/require-default-props': 'off',
32-
33-
'import/extensions': [
34-
'error',
35-
'ignorePackages',
36-
{
37-
ts: 'never',
38-
tsx: 'never',
39-
js: 'never',
40-
jsx: 'never',
41-
},
42-
],
43-
4426
'jsx-a11y/anchor-is-valid': [
4527
'error',
4628
{
@@ -51,28 +33,14 @@ export default [
5133
],
5234
},
5335
},
54-
...compat.extends('plugin:@typescript-eslint/recommended', 'prettier').map((config) => ({
55-
...config,
56-
files: ['**/*.+(ts|tsx)'],
57-
})),
58-
{
59-
files: ['**/*.+(ts|tsx)'],
60-
61-
plugins: {
62-
'@typescript-eslint': typescriptEslintEslintPlugin,
63-
},
64-
65-
languageOptions: {
66-
parser: tsParser,
67-
},
68-
69-
rules: {
70-
'@typescript-eslint/explicit-function-return-type': 'off',
71-
'@typescript-eslint/explicit-module-boundary-types': 'off',
72-
'no-use-before-define': [0],
73-
'@typescript-eslint/no-use-before-define': [1],
74-
'@typescript-eslint/no-explicit-any': 'off',
75-
'@typescript-eslint/no-var-requires': 'off',
76-
},
77-
},
78-
];
36+
// Override default ignores of eslint-config-next.
37+
globalIgnores([
38+
// Default ignores of eslint-config-next:
39+
'.next/**',
40+
'out/**',
41+
'build/**',
42+
'next-env.d.ts',
43+
]),
44+
]);
45+
46+
export default eslintConfig;

package.json

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,32 @@
2323
"format:ci": "prettier --list-different .",
2424
"postinstall": "husky"
2525
},
26-
"lint-staged": {
27-
"./src/**/*.{ts,js,jsx,tsx}": [
28-
"eslint \"src/**/*.+(ts|js|tsx)\" --fix",
29-
"prettier . --write"
30-
]
31-
},
3226
"dependencies": {
3327
"@t3-oss/env-nextjs": "0.13.8",
3428
"babel-plugin-react-compiler": "1.0.0",
35-
"next": "16.0.0-beta.0",
29+
"next": "16.0.0",
3630
"react": "19.2.0",
3731
"react-dom": "19.2.0",
3832
"zod": "4.1.12"
3933
},
4034
"devDependencies": {
4135
"@commitlint/cli": "20.1.0",
4236
"@commitlint/config-conventional": "20.0.0",
43-
"@eslint/eslintrc": "3.3.1",
44-
"@eslint/js": "9.37.0",
37+
"@eslint/js": "9.38.0",
4538
"@ianvs/prettier-plugin-sort-imports": "4.7.0",
46-
"@types/node": "22.18.11",
39+
"@types/node": "24.9.1",
4740
"@types/react": "19.2.2",
4841
"@types/react-dom": "19.2.2",
49-
"@typescript-eslint/eslint-plugin": "8.46.1",
50-
"@typescript-eslint/parser": "8.46.1",
51-
"eslint": "9.37.0",
52-
"eslint-config-next": "16.0.0-beta.0",
42+
"eslint": "9.38.0",
43+
"eslint-config-next": "16.0.0",
5344
"eslint-config-prettier": "10.1.8",
5445
"eslint-plugin-prettier": "5.5.4",
5546
"husky": "9.1.7",
56-
"lint-staged": "16.2.4",
47+
"lint-staged": "16.2.5",
5748
"prettier": "3.6.2",
5849
"prettier-plugin-sort-json": "4.1.1",
59-
"typescript": "5.9.3"
50+
"typescript": "5.9.3",
51+
"typescript-eslint": "8.46.2"
6052
},
6153
"pnpm": {
6254
"overrides": {

0 commit comments

Comments
 (0)