Getting started
Install
Install @commitlint/cli and a @commitlint/config-* / commitlint-config-* of your choice as devDependency and configure commitlint to use it.
sh
npm install -D @commitlint/cli @commitlint/config-conventionalsh
yarn add -D @commitlint/cli @commitlint/config-conventionalsh
pnpm add -D @commitlint/cli @commitlint/config-conventionalsh
bun add -d @commitlint/cli @commitlint/config-conventionalsh
deno add -D npm:@commitlint/cli npm:@commitlint/config-conventional
# Deno 2 only: create a local node_modules directory for Node.js module resolution
deno install --node-modules-dir=autoConfiguration
Configure commitlint to use conventional config
sh
echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.jssh
# Here we use the node command to avoid encoding issue on Windows.
node -e "fs.writeFileSync('commitlint.config.js', process.argv[1])" "export default { extends: ['@commitlint/config-conventional'] };"Refer to configuration documentation for more information.