Our default export contains rules related to commits by following conventional commits specifications.
npm install npm@latest -g
npm install --global yarn
npm install --save-dev @commitlint/{cli,config-conventional}
yarn add @commitlint/{cli,config-conventional} -D
npm install husky --save-dev
yarn add husky --dev
npx husky install
yarn husky install
npx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}"
- Ensure that you don't have a typo in your filename. For example, precommit or pre-commit.sh are invalid names. See Git hooks documentation for valid names.
- Check that git config core.hooksPath returns .husky (or your custom hooks directory).
- Verify that hook files are executable. This is automatically set when using husky add command but you can run
chmod +x .husky/<hookname>
to fix that. - Check that your version of Git is greater than 2.9.
- create a file called
.commitlintrc.json
in root directory of application where .git file is located. - paste the following snippet
{
.
extends: ['@eddlondon'];
}
run the following command
yarn push-patch
npm run push-minor
yarn push-minor
npm publish access=public