Skip to content

Commit 85d2997

Browse files
committed
feat(repo): Add husky hooks with commitlint
1 parent f65842f commit 85d2997

File tree

4 files changed

+1089
-15
lines changed

4 files changed

+1089
-15
lines changed

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit $1

commitlint.config.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const {
2+
utils: { getPackages },
3+
} = require('@commitlint/config-lerna-scopes');
4+
5+
module.exports = {
6+
extends: ['@commitlint/config-conventional'],
7+
rules: {
8+
'subject-case': [2, 'always', ['sentence-case']],
9+
'body-max-line-length': [1, 'always', '150'],
10+
'scope-empty': [2, 'never'],
11+
'scope-enum': async (ctx) => [
12+
2,
13+
'always',
14+
[...(await getPackages(ctx)), 'repo'],
15+
],
16+
},
17+
};

0 commit comments

Comments
 (0)