@fmss/commitlint-config
v1.0.0
Published
Commitlint config for enforcing consistent commit message conventions and rules
Readme
@fmss/commitlint-config
Commitlint config for enforcing consistent commit message conventions and rules
Installation
$ npm install @fmss/commitlint-configValidation Messages
For detailed examples of valid and invalid commit messages, please see Test Cases Documentation
Usage
Create a .commitlintrc.js file in your project root and use the configuration utility:
import {createConfig} from '@fmss/commitlint-config';
export default createConfig({
/* Enable JIRA issue reference validation */
requireJira: true,
/* Add custom commit types (optional) */
additionalTypes: ['hotfix', 'config'],
/* Add custom scopes (optional) */
additionalScopes: ['auth', 'api', 'ui'],
/**
* Add ignores (optional)
*
* When you create a commit message, this message is passed as a parameter to the functions given in the ignores array,
* if any of them returns true, all other rules will be skipped.
*
* NOT RECOMMENDED unless needed for a special case
*/
ignores: [
(message) => message.startsWith('temp:'),
(message) => message.includes('version changes'),
],
});Configuration Options
| Option | Type | Default | Description |
| ------------------ | ---------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| requireJira | boolean | false | When enabled, enforces JIRA issue references in commit messages |
| additionalTypes | string[] | [] | Additional commit types to allow beyond the defaults |
| additionalScopes | string[] | [] | Additional scopes to allow beyond the defaults |
| ignores | ((message: string) => boolean)[] | [] | Array of functions that take a commit message as a parameter and return a boolean. If any function returns true, all other rules will be skipped for that commit message |
Default Commit Types
chore: Miscellaneous commitsbuild: Changes affecting build system or dependenciesci: Changes to CI configurationdocs: Documentation changesfeat: New featuresfix: Bug fixesperf: Performance improvementsrefactor: Code changes that neither fix bugs nor add featuresrevert: Revert previous commitsstyle: Code style changestest: Adding or updating testsrelease: Release commitsops: Operational changes
