chore: add commitlint and husky

This commit is contained in:
PreslavKozovski 2021-02-03 18:13:30 +02:00
Родитель 3d5dec011b
Коммит f597ffceac
2 изменённых файлов: 51 добавлений и 1 удалений

39
.commitlintrc.json Normal file
Просмотреть файл

@ -0,0 +1,39 @@
{
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"header-max-length": [
2,
"always",
100
],
"type-case": [
1,
"always",
[
"lower-case",
"upper-case"
]
],
"type-enum": [
2,
"always",
[
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"infra",
"perf",
"refactor",
"revert",
"style",
"test",
"WIP"
]
]
}
}

Просмотреть файл

@ -33,7 +33,11 @@
"lodash": "^4.17.20"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/core": "^11.0.0",
"eslint": "^7.19.0",
"husky": "^4.3.8",
"mocha": "^8.2.1"
},
"peerDependencies": {},
@ -43,5 +47,12 @@
"styles",
"docs",
"documentation"
]
],
"husky": {
"hooks": {
"pre-commit": "npm run lint",
"pre-push": "npm run lint && npm run test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}