Skip to content

Instantly share code, notes, and snippets.

@niclaslindstedt
Last active May 19, 2021 10:57
Show Gist options
  • Save niclaslindstedt/b7fedae9d215e1d94802014c1073b9a4 to your computer and use it in GitHub Desktop.
Save niclaslindstedt/b7fedae9d215e1d94802014c1073b9a4 to your computer and use it in GitHub Desktop.
Husky with commitlint
{
"scripts": {
"postinstall": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"husky": "^4.3.5"
},
"commitlint": {
"parserPreset": "conventional-changelog-conventionalcommits",
"rules": {
"body-leading-blank": [
2,
"always"
],
"body-max-line-length": [
2,
"always",
70
],
"footer-leading-blank": [
2,
"always"
],
"footer-max-line-length": [
2,
"always",
70
],
"header-max-length": [
2,
"always",
70
],
"scope-case": [
2,
"always",
"lower-case"
],
"subject-case": [
2,
"always",
"lower-case"
],
"subject-empty": [
2,
"never"
],
"subject-full-stop": [
2,
"never",
"."
],
"type-case": [
2,
"always",
"lower-case"
],
"type-empty": [
2,
"never"
],
"type-enum": [
2,
"always",
[
"chore",
"ci",
"docs",
"feat",
"fix",
"refactor",
"repo",
"scripts",
"test",
"wip"
]
]
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment