Skip to content

Commit 574dc64

Browse files
committed
chore: add lint-staged hooks
1 parent bd81a52 commit 574dc64

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.huskyrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"hooks": {
3+
"pre-commit": "lint-staged",
34
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
45
}
56
}

.lintstagedrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"*.{js,ts,tsx}": [
3+
"prettier --write",
4+
"git add"
5+
],
6+
"*.md": [
7+
"prettier --write --parser markdown",
8+
"git add"
9+
],
10+
"*.json": [
11+
"prettier --write --parser json",
12+
"git add"
13+
]
14+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"husky": "3.0.5",
2929
"jsdom": "13.0.0",
3030
"lerna": "3.5.1",
31+
"lint-staged": "^9.2.5",
3132
"mocha": "5.2.0",
3233
"nyc": "13.1.0",
3334
"prettier": "^1.18.2",

0 commit comments

Comments
 (0)