Skip to content

Commit 950c48f

Browse files
committed
Adding husky pre-commit hooks
1 parent 7f4d37f commit 950c48f

File tree

2 files changed

+249
-10
lines changed

2 files changed

+249
-10
lines changed

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"eslint-plugin-prettier": "^3.3.0",
3939
"express": "^4.16.2",
4040
"fs-extra": "^4.0.2",
41+
"husky": "^4.3.6",
4142
"jsdoc": "^3.6.3",
4243
"jsdoc-to-markdown": "^6.0.1",
4344
"karma": "^4.0.0",
@@ -49,6 +50,7 @@
4950
"karma-sauce-launcher": "^2.0.2",
5051
"karma-sinon": "^1.0.5",
5152
"karma-sourcemap-loader": "^0.3.7",
53+
"lint-staged": "^10.5.3",
5254
"mocha": "^4.0.1",
5355
"prettier": "^2.2.1",
5456
"requirejs": "^2.3.6",
@@ -84,5 +86,15 @@
8486
"homepage": "https://github.com/amplitude/amplitude-javascript#readme",
8587
"directories": {
8688
"test": "test"
89+
},
90+
"husky": {
91+
"hooks": {
92+
"pre-commit": "lint-staged"
93+
}
94+
},
95+
"lint-staged": {
96+
"{src,test,scripts}/**/*.js": [
97+
"yarn run fix"
98+
]
8799
}
88100
}

0 commit comments

Comments
 (0)