Skip to content

Commit bcdb5af

Browse files
authored
chore: add husky and commitlint (#8)
1 parent f4d0535 commit bcdb5af

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.commitlintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@commitlint/config-conventional"
4+
]
5+
}

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "e-ipfs-core-lib",
3-
"version": "0.3.0-beta-1",
3+
"version": "0.3.0",
44
"description": "E-IPFS core library",
55
"license": "(Apache-2.0 AND MIT)",
66
"homepage": "https://github.com/elastic-ipfs/core-lib",
77
"scripts": {
88
"test": "c8 --reporter=text --reporter=html tap test/*.test.js",
99
"test:ci": "npm test && c8 check-coverage --lines 100 --functions 100 --branches 100",
1010
"format": "standard src test --fix",
11-
"lint": "standard src test"
11+
"lint": "standard src test | snazzy",
12+
"prepare": "husky install"
1213
},
1314
"engines": {
1415
"node": "18.12"
@@ -28,12 +29,20 @@
2829
"xml-js": "^1.6.11"
2930
},
3031
"devDependencies": {
32+
"@commitlint/cli": "^17.3.0",
33+
"@commitlint/config-conventional": "^17.3.0",
3134
"c8": "^7.12.0",
3235
"dedent": "^0.7.0",
36+
"husky": "^8.0.2",
37+
"lint-staged": "^13.0.4",
38+
"snazzy": "^9.0.0",
3339
"split2": "^4.1.0",
3440
"standard": "^17.0.0",
3541
"tap": "^16.3.2"
3642
},
43+
"lint-staged": {
44+
"*.{js,jsx}": "standard --cache --fix"
45+
},
3746
"type": "module",
3847
"exports": "./src/index.js",
3948
"main": "./src/index.js"

0 commit comments

Comments
 (0)