Shareable commitlint
config enforcing conventional commits
This package exports a shareable commitlint
configuration that enforces conventional commits.
It also includes a set of utilities for customizing rules.
This package can be used with @commitlint/cli
and @commitlint/prompt-cli
.
Commit parsing options can also be used with conventional-changelog
and conventional-commits-parser
.
yarn add -D @flex-development/commitlint-config @commitlint/cli
From Git:
yarn add -D @flex-development/commitlint-config@flex-development/commitlint-config @commitlint/cli
See Git - Protocols | Yarn for details on requesting a specific branch, commit, or tag.
echo '{\n "extends": "@flex-development"\n}' > .commitlintrc.json
commitlint --from HEAD~1 --to HEAD --verbose
Due to an unresolved commitlint
issue, extended commitlint
configurations do not concatenate scope-enum
,
nor type-enum
. Follow the example below to customize commit scopes and types losslessly.
touch .commitlintrc.cts
/**
* @file Configuration - commitlint
* @module config/commitlint
* @see https://commitlint.js.org
*/
import {
RuleConfigSeverity as Severity,
type UserConfig
} from '@commitlint/types'
import { scopes } from '@flex-development/commitlint-config'
/**
* `commitlint` configuration object.
*
* @const {UserConfig} config
*/
const config: UserConfig = {
extends: ['@flex-development'],
rules: {
'scope-enum': [Severity.Error, 'always', scopes(['bundle', 'transpile'])]
}
}
export default config
You may need to set TS_NODE_PROJECT
if running commitlint
from the command line.
See docs/examples/commitlint.config.cjs
for an example config written in pure CommonJS.
TODO: api documentation.
This package is fully typed with TypeScript.
See CONTRIBUTING.md
.