Package Exports
- @d3p1/commitlint-config
- @d3p1/commitlint-config/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@d3p1/commitlint-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Introduction
Just a little shareable configuration for commitlint
to be able to validate the addition of an issue number to the end of a commit message that follows the Conventional Commits specification.
The commit message structure must be:
<type>(<scope>): <description> [<issue-number>]
Where:
<type>
is mandatory<scope>
is optional<description>
is mandatory<issue-number>
is mandatory
Usage
Install commitlint
and this configuration:
npm install --save-dev @commitlint/cli @d3p1/commitlint-config
Then, extend this configuration from your commitlint
configuration object using the extends
option. For example, create in the root of your project a commitlint.config.js
file with the following content:
module.exports = {
extends: ['@d3p1/commitlint-config']
};
Also, to be able to validate your commit messages in your environment, install and configure husky
:
npm install --save-dev husky
npx husky install
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
And you are ready to go! From now on, all messages from your commits will be validated to ensure they adhere to the format:
<type>(<scope>): <description> [<issue-number>]
Changelog
Detailed changes for each release are documented in CHANGELOG.md
.
License
This work is published under MIT License.
Author
Always happy to receive a greeting on: