Commits
Commitlint
makes sure you are following the rules of
conventional-commits
Schema: <type>(<scope?>): <message>
In combination withhusky
we can use Git hooks like pre-commit
and
commit-msg
to lint the commit and its message.
pre-commit
hook
To ensure a consistent code style, the pre-commit
hook runs ESLint. To get more details about
the rules, visit Codestyle and Linting in our docs. It also runs
Prettier (in write-mode) and applies certain rules. At
last, it sorts all package.json
files via sort-package-json
.
commit-msg
hook
If the commit message doesn’t follow the convention of conventional-commits, commitlint will error out and husky gives you an idea of what is wrong.