Skip to content

Commit ab6e070

Browse files
committed
build: add lint-staged and simple-git-hooks for pre-commit linting
1 parent 533f3f9 commit ab6e070

File tree

3 files changed

+317
-3
lines changed

3 files changed

+317
-3
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export default antfu({
1111
'packages/api/public/**/*',
1212
'packages/showcase/src/*/demo/data.ts',
1313
],
14-
typescript: true,
1514
formatters: true,
1615
markdown: true,
1716
react: true,

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"private": true,
66
"packageManager": "pnpm@10.11.0",
77
"scripts": {
8+
"prepare": "simple-git-hooks",
89
"dev": "next",
910
"build": "NODE_OPTIONS=\"--max-old-space-size=4096\" next build",
1011
"start": "next start",
@@ -36,14 +37,23 @@
3637
"@types/react": "^19.1.6",
3738
"@types/react-dom": "^19.1.5",
3839
"eslint": "^9.28.0",
40+
"eslint-plugin-format": "^1.0.1",
3941
"eslint-plugin-react-hooks": "^5.2.0",
4042
"eslint-plugin-react-refresh": "^0.4.20",
4143
"eslint-plugin-readable-tailwind": "^2.1.2",
4244
"file-loader": "^6.2.0",
45+
"lint-staged": "^16.1.0",
4346
"postcss": "^8.5.4",
4447
"shiki": "^3.4.2",
48+
"simple-git-hooks": "^2.13.0",
4549
"tailwindcss": "^4.1.8",
4650
"tailwindcss-animate": "^1.0.7",
4751
"typescript": "^5.8.3"
52+
},
53+
"simple-git-hooks": {
54+
"pre-commit": "pnpm lint-staged"
55+
},
56+
"lint-staged": {
57+
"!submodules/*": "eslint"
4858
}
4959
}

0 commit comments

Comments
 (0)