Skip to content

Commit bf61cac

Browse files
Merge pull request #401 from tcet-opensource/398-add-husky
[woof]: Add husky to manage precommit hooks
2 parents cd837dc + 3d2ebe7 commit bf61cac

File tree

6 files changed

+644
-34
lines changed

6 files changed

+644
-34
lines changed

.husky/pre-commit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# npm test
5+
npx lint-staged
6+
7+
if [ "$(uname)" == "Darwin" ]; then
8+
npm run test
9+
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
10+
npm run test
11+
elif [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
12+
npm run testWin
13+
fi

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"*.js": [
3+
"prettier --write",
4+
"eslint --fix"
5+
]
6+
}

hooks/pre-commit

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)