Skip to content

Commit c6634b8

Browse files
authored
chore: integrate lintstaged husky (#16)
* chore: integrate lintstaged husky * chore: integrate lintstaged husky * chore: integrate lintstaged husky * chore: update lint command to have --fix
1 parent cacc127 commit c6634b8

File tree

6 files changed

+715
-16
lines changed

6 files changed

+715
-16
lines changed

.husky/commit-msg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npx --no-install commitlint --edit "$1"
2+

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged --concurrent false

.lintstagedrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,ts,tsx}": ["pnpm run format", "pnpm run lint:fix --"],
3+
}

commitlint.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat',
9+
'fix',
10+
'docs',
11+
'chore',
12+
'style',
13+
'refactor',
14+
'ci',
15+
'test',
16+
'revert',
17+
'perf',
18+
'vercel',
19+
],
20+
],
21+
},
22+
}

package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
"dev": "turbo run dev",
77
"lint": "turbo run lint",
88
"lint:fix": "turbo run lint:fix",
9-
"format": "prettier --write \"**/*.{ts,tsx,md}\""
9+
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
10+
"prepare": "husky install"
1011
},
1112
"devDependencies": {
13+
"@commitlint/cli": "^19.8.0",
14+
"@commitlint/config-conventional": "^19.8.0",
15+
"@types/node": "^22.13.9",
16+
"husky": "^8.0.0",
17+
"lint-staged": "^15.5.0",
1218
"prettier": "^3.5.3",
19+
"tsx": "^4.19.3",
1320
"turbo": "^2.4.4",
14-
"typescript": "5.8.2",
15-
"@types/node": "^22.13.9",
16-
"tsx": "^4.19.3"
21+
"typescript": "5.8.2"
1722
},
1823
"packageManager": "[email protected]",
1924
"engines": {

0 commit comments

Comments
 (0)