Skip to content

Commit 0e7d0ba

Browse files
committed
Adding husky for a pre-commit hook
1 parent 901be1f commit 0e7d0ba

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.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+
npm test

package-lock.json

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@
3333
"rollup": "rollup --config",
3434
"test": "npm run lint && npm run mocha",
3535
"test-webpack": "mkdir -p test/webpack && rm -rf test/webpack/* && git clone [email protected]:rabelais88/typescript-webpack.git test/webpack && echo \"import { filesize } from 'filesize';console.log(filesize(1234));\" >> test/webpack/src/index.ts && cd test/webpack && npm install && mkdir -p node_modules/filesize/dist && cp ../../package.json node_modules/filesize/ && cp ../../dist/* node_modules/filesize/dist/ && npm run build",
36-
"types": "npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"
36+
"types": "npx -p typescript tsc src/*.js --declaration --allowJs --emitDeclarationOnly --outDir types",
37+
"prepare": "husky install"
3738
},
3839
"devDependencies": {
3940
"@rollup/plugin-terser": "^0.4.0",
4041
"auto-changelog": "^2.4.0",
4142
"eslint": "^8.37.0",
43+
"husky": "^8.0.3",
4244
"mocha": "^10.2.0",
4345
"rollup": "^3.20.2",
4446
"typescript": "^5.0.2"

0 commit comments

Comments
 (0)