Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): check if the commit message is a conventional commit
- For the husky v.8 not use the `.huskyrc` file for set the configuration. Set the configuration inside the `.husky` folder, in the individual files as the `commit-msg` hook. https://typicode.github.io/husky/#/?id=migrate-from-v4-to-v8 Steps: - Add the next command to the `commit-msg` hook: `npx --no -- commitlint --edit $1` Error: - Error: Cannot find module "@commitlint/config-conventional" from "/Applications/MAMP/htdocs/vue-todolist" at resolveId (/Users/beatrizsmerino/.npm/_npx/16d437951fea4b5e/node_modules/@commitlint/resolve-extends/src/index.ts:131:14) - ✖ body's lines must not be longer than 100 characters [body-max-line-length] ✖ found 1 problems, 0 warnings ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint Solution: - Install locally the packages: `npm install @commitlint/cli @commitlint/config-conventional --save-dev` `npm install commitizen cz-conventional-changelog --save-dev` - Update the configuration `commitlint`, increase the `body-max-line-length` References: - https://www.youtube.com/watch?v=jNxDNoYEGVU - https://www.youtube.com/watch?v=OJqUWvmf4gg - https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13 - https://github.com/qoomon/git-conventional-commits - https://remarkablemark.org/blog/2019/05/29/git-husky-commitlint/ - https://typicode.github.io/husky/#/?id=husky_git_params-ie-commitlint- - https://stackoverflow.com/a/67074398 - https://rahulgurung.com/How-to-use-the-latest-Husky-8-with-Commitizen-for-adding-git-hooks-to-your-projects/ - https://www.techiediaries.com/git-hooks-husky-commitlint/ - https://www.freecodecamp.org/news/how-to-use-commitlint-to-write-good-commit-messages/ - https://medium.com/dottech/mejorando-los-mensajes-de-git-commit-con-husky-y-commitlint-7bddf6ab22c2 - commitizen/cz-cli#289 - https://github.com/conventional-changelog/commitlint - conventional-changelog/commitlint#613 - https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/index.js - https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md#body-max-line-length
- Loading branch information