Skip to content

Commit a784e05

Browse files
committed
feat: add husky and commit lint
1 parent c69274f commit a784e05

File tree

6 files changed

+23
-4743
lines changed

6 files changed

+23
-4743
lines changed

.github/workflows/test.yml

+10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@ name: Test
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- 'README.md'
8+
- 'LICENSE'
9+
- '.editorconfig'
510
branches:
611
- main
712
- master
813
pull_request:
14+
paths-ignore:
15+
- 'docs/**'
16+
- 'README.md'
17+
- 'LICENSE'
18+
- '.editorconfig'
919
branches:
1020
- main
1121
- master

.husky/commit-msg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
npx --no-install commitlint --edit $1

.husky/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
[ -n "$CI" ] && exit 0
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run test

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']}

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"build:types": "node tools/cleanup types && tsc -p config/tsconfig.types.json",
1616
"clean": "node tools/cleanup",
1717
"package": "npm run build && npm pack",
18-
"test": "jest",
19-
"test:cov": "jest --coverage",
18+
"test": "jest --no-cache --runInBand",
19+
"test:cov": "jest --coverage --no-cache --runInBand",
2020
"addscope": "node tools/packagejson name @tomchen/example-typescript-package"
2121
},
2222
"publishConfig": {
@@ -50,6 +50,8 @@
5050
},
5151
"dependencies": {},
5252
"devDependencies": {
53+
"@commitlint/cli": "^11.0.0",
54+
"@commitlint/config-conventional": "^11.0.0",
5355
"@types/jest": "^26.0.20",
5456
"@typescript-eslint/eslint-plugin": "^4.15.0",
5557
"@typescript-eslint/parser": "^4.15.0",

0 commit comments

Comments
 (0)