@mheob/commitlint-config
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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,
	},
};

Readme

Keywords

Package Sidebar

Install

npm i @mheob/commitlint-config

Weekly Downloads

69

Version

1.2.1

License

MIT

Unpacked Size

9.21 kB

Total Files

5

Last publish

Collaborators

  • mheob