Configuration
Config via file
commitier picks up configuration from the following files:
.commitierrc.commitierrc.json.commitierrc.yaml.commitierrc.yml.commitierrc.js.commitierrc.cjs.commitierrc.mjs.commitierrc.ts.commitierrc.ctscommitier.config.jscommitier.config.cjscommitier.config.mjscommitier.config.tscommitier.config.cts
Configuration files are resolved using cosmiconfig.
Config via package.json
You can add a committier field in package.json
Config Example
1. Config with JSON
Create a .committerrc.json file at root, you can partially add fields to override the default config.
{
"autoEmoji": true,
"autoScope": true,
"defaultType": "fix",
"types": {...}
}2. Config with JS
Create a committier.config.js file at root.
import { defineConfig } from "committier"
export default defineConfig({
autoEmoji: true,
autoScope: true,
defaultType: "fix",
defaultDescription: true,
});About defineConfig()
This is a helper function providing type intellisense, you can just export an object as well.
Default Config
{
"autoEmoji": true, // boolean
"autoScope": false, // boolean | 'replaceToPackageName' (true) | 'defaultToPackageName'
"defaultType": "fix",
"defaultDescription": false, // boolean | "fileName" (true) | "fileBasename" | "filePath"
"types": {
"feat": {
"emoji": "โจ",
"title": "Feature",
"description": "A new feature"
},
"fix": {
"emoji": "๐",
"title": "Bug Fixes",
"description": "A bug fix"
},
"refactor": {
"emoji": "โป๏ธ",
"title": "Code Refactoring",
"description": "A code change that neither fixes a bug nor adds a feature"
},
"perf": {
"emoji": "โก๏ธ",
"title": "Performance Improvements",
"description": "A code change that improves performance"
},
"chore": {
"emoji": "๐จ",
"title": "Chores",
"description": "Other changes that don't modify src or test files",
"scopes": [
{
"match": "release",
"emoji": "๐",
"title": "Release",
"description": "A new release"
}
]
},
"test": {
"emoji": "๐งช",
"title": "Tests",
"description": "Adding missing tests or correcting existing tests"
},
"style": {
"emoji": "๐",
"title": "Styles",
"description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"
},
"docs": {
"emoji": "๐",
"title": "Documentation",
"description": "Documentation only changes"
},
"revert": {
"emoji": "โ",
"title": "Reverts",
"description": "Reverts a previous commit"
},
"build": {
"emoji": "๐ฆ๏ธ",
"title": "Builds",
"description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)"
},
"ci": {
"emoji": "๐ท",
"title": "Continuous Integrations",
"description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)"
},
"breakingChange": {
"emoji": "๐ฅ",
"title": "Breaking Changes",
"description": "Introduce breaking changes."
}
}
}Reference
Prop
Type