Skip to content

Commit b125da5

Browse files
committed
chore: adds husky, lint-staged and commitlint
1 parent c174c2b commit b125da5

File tree

3 files changed

+1250
-36
lines changed

3 files changed

+1250
-36
lines changed

.commitlintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

package.json

+24-1
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,37 @@
88
"start": "next start",
99
"type-check": "tsc",
1010
"lint": "eslint --ignore-path .gitignore \"src/**/*.+(ts|js|tsx)\"",
11-
"lint:fix": "yarn lint --fix",
1211
"format": "prettier --ignore-path .gitignore \"src/**/*.+(ts|js|tsx)\" --write"
1312
},
13+
"husky": {
14+
"hooks": {
15+
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
16+
"pre-commit": "lint-staged",
17+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
18+
}
19+
},
20+
"lint-staged": {
21+
"./src/**/*.{ts,js,jsx,tsx}": [
22+
"yarn lint --fix",
23+
"yarn format"
24+
]
25+
},
1426
"dependencies": {
1527
"next": "9.3.1",
1628
"react": "16.13.0",
1729
"react-dom": "16.13.0"
1830
},
1931
"devDependencies": {
32+
"@commitlint/cli": "^8.3.5",
33+
"@commitlint/config-conventional": "^8.3.4",
2034
"@types/node": "^13.9.2",
2135
"@types/react": "^16.9.23",
2236
"@types/react-dom": "^16.9.5",
2337
"@typescript-eslint/eslint-plugin": "^2.24.0",
2438
"@typescript-eslint/parser": "^2.24.0",
2539
"babel-plugin-module-resolver": "^4.0.0",
40+
"commitizen": "^4.0.3",
41+
"cz-conventional-changelog": "3.1.0",
2642
"eslint": "^6.8.0",
2743
"eslint-config-airbnb": "^18.1.0",
2844
"eslint-config-prettier": "^6.10.0",
@@ -32,7 +48,14 @@
3248
"eslint-plugin-prettier": "^3.1.2",
3349
"eslint-plugin-react": "^7.19.0",
3450
"eslint-plugin-react-hooks": "^2.5.0",
51+
"husky": "^4.2.3",
52+
"lint-staged": "^10.0.8",
3553
"prettier": "^1.19.1",
3654
"typescript": "^3.8.3"
55+
},
56+
"config": {
57+
"commitizen": {
58+
"path": "./node_modules/cz-conventional-changelog"
59+
}
3760
}
3861
}

0 commit comments

Comments
 (0)