@mheob/commitlint-config
v1.2.0
Published
My personal configuration for commitlint.
Downloads
454
Readme
My personal Commitlint config
To make my configurations a bit easier I share my Commitlint config.
Another notable tool for using Conventional Commits is cz-git.
Install
With NPM
npm install -D @mheob/commitlint-config
With YARN
yarn add -D @mheob/commitlint-config
With PNPM
pnpm add -D @mheob/commitlint-config
With BUN
bun add -D @mheob/commitlint-config
Usage
Add this config to your root package.json
.
{
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}
}
Now create a .commitlint.config.js
file in the root of your project with this content:
/** @type {import('cz-git').UserConfig} */
module.exports = {
...require('@mheob/commitlint-config'),
};
If you want to use your own scopes or if you need to override some settings you can do it in the commitlint.config.js
this way:
const fs = require('node:fs');
const path = require('node:path');
const defaultConfig = require('@mheob/commitlint-config');
// dynamically define the scopes
const apps = fs.readdirSync(path.resolve(__dirname, 'apps'));
const packages = fs.readdirSync(path.resolve(__dirname, 'packages'));
/** @type {import('cz-git').UserConfig} */
module.exports = {
...defaultConfig,
prompt: {
...defaultConfig.prompt,
scopes: ['deps', 'release', 'repo', ...apps, ...packages],
useEmoji: false,
},
};