Skip to content

Commit 9f093f6

Browse files
committed
chore(precise-commits): configure precise-commits
1 parent e59e45a commit 9f093f6

File tree

4 files changed

+181
-12
lines changed

4 files changed

+181
-12
lines changed

.husky/common.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
command_exists () {
2+
command -v "$1" >/dev/null 2>&1
3+
}
4+
5+
# Workaround for Windows 10, Git Bash and Yarn, https://typicode.github.io/husky/#/?id=yarn-on-windows
6+
if command_exists winpty && test -t 1; then
7+
exec < /dev/tty
8+
fi

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
. "$(dirname "$0")/common.sh"
4+
5+
yarn pre-commit

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"repository": "github:softwareventures/array",
1515
"license": "ISC",
1616
"scripts": {
17+
"pre-commit": "precise-commits",
1718
"fix": "tsc --noEmit && eslint . --fix && prettier --write .",
1819
"lint": "tsc --noEmit && eslint . && prettier --check .",
19-
"prepare": "tsc",
20+
"prepare": "husky install && tsc",
2021
"semantic-release": "semantic-release",
2122
"test": "ava"
2223
},
@@ -31,12 +32,14 @@
3132
},
3233
"devDependencies": {
3334
"@softwareventures/eslint-config": "5.1.0",
35+
"@softwareventures/precise-commits": "2.0.17",
3436
"@softwareventures/prettier-config": "3.0.0",
3537
"@softwareventures/semantic-release-config": "2.0.0",
3638
"@softwareventures/tsconfig": "5.1.1",
3739
"ava": "4.0.1",
3840
"cz-conventional-changelog": "3.3.0",
3941
"eslint": "8.8.0",
42+
"husky": "7.0.4",
4043
"prettier": "2.5.1",
4144
"semantic-release": "17.4.7",
4245
"ts-node": "10.4.0",

0 commit comments

Comments
 (0)