Reputation: 8563
I'd like to use huksy and commitlint to my angular project.
How can I achieve this ?
Upvotes: 0
Views: 1078
Reputation: 8563
npm i husky --save-dev
npx husky init
The
init
command simplifies setting up husky in a project. It creates apre-commit
script in.husky/
and updates theprepare
script inpackage.json
. Modifications can be made later to suit your workflow. Husky doc
npm i @commitlint/cli @commitlint/config-conventional --save-dev
commitlint.config.js
file at the root of the project.module.exports = {
extends: ['@commitlint/config-conventional'],
};
.husky
folder, add commit-msg
filenpx --no-install commitlint --edit "$1"
pre-commit
file if you do not have any test
git commit -m "Keep calm and commit"
.../COMMIT_EDITMSG
?Just open the .git
folder and add an empty COMMIT_EDITMSG
file.
Git needs it to know the title you're trying to type, maybe he doesn't have the access to create the file.
Upvotes: 3