Skip to content

Commit 1e16ed2

Browse files
committed
chore: add huskey and lint-staged
1 parent cee532a commit 1e16ed2

File tree

3 files changed

+214
-4
lines changed

3 files changed

+214
-4
lines changed

.commitlintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": ["@commitlint/config-angular"],
3+
"rules": {
4+
"subject-case": [
5+
2,
6+
"always",
7+
["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case", "camel-case"]
8+
],
9+
"type-enum": [
10+
2,
11+
"always",
12+
[
13+
"build",
14+
"chore",
15+
"ci",
16+
"docs",
17+
"feat",
18+
"fix",
19+
"perf",
20+
"refactor",
21+
"revert",
22+
"style",
23+
"test",
24+
"sample"
25+
]
26+
]
27+
}
28+
}

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"eslint-plugin-prettier": "^3.1.4",
3939
"form-data": "^3.0.0",
4040
"fs-extra": "^9.0.1",
41+
"husky": "^4.3.0",
42+
"lint-staged": "^10.4.0",
4143
"nodemon": "^2.0.6",
4244
"np": "^7.0.0",
4345
"npm-run-all": "^4.1.5",
@@ -54,5 +56,15 @@
5456
"ignore": [
5557
"build/info.json"
5658
]
59+
},
60+
"husky": {
61+
"hooks": {
62+
"pre-commit": "lint-staged",
63+
"commit-msg": "commitlint -c .commitlintrc.json -E HUSKY_GIT_PARAMS"
64+
}
65+
},
66+
"lint-staged": {
67+
"*.js": "eslint",
68+
"*.ts": "eslint --ext .ts"
5769
}
5870
}

0 commit comments

Comments
 (0)