commitlint-config-patternplate

raw JSON →
20.5.3 verified Fri May 01 auth: no javascript

Lint your commits, patternplate-style. This is a shareable commitlint configuration that enforces the patternplate commit convention, based on conventional-changelog. Current stable version is 20.5.3 (April 2026). Release cadence is frequent (~every few weeks) with minor patches and features. Key differentiator: opinionated patternplate style with specific header, scope, and footer rules. Requires commitlint v20 and Node >=v18. ESM-only since v20.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/commitlint-config-patternplate/index.js from /path/to/.commitlintrc.js not supported.
cause Config file uses require() but package is ESM-only.
fix
Rename config to .commitlintrc.mjs or use dynamic import: const config = await import('commitlint-config-patternplate');
error Cannot find module '@commitlint/config-conventional'
cause Missing peer dependency '@commitlint/config-conventional'.
fix
Run: npm install --save-dev @commitlint/config-conventional
error Invalid rule definition: rule 'xxx' must be a function or array of functions
cause Mistyped rule name or incorrect rule format.
fix
Check rule names from patternplate configuration (e.g., header-max-length, scope-case) and ensure they are arrays [level, applicable, value]
error TypeError: Cannot read properties of undefined (reading 'some')
cause commitlint version incompatibility; v20 changed internal rule API.
fix
Upgrade commitlint and all config packages to v20: npm install commitlint@latest @commitlint/cli@latest commitlint-config-patternplate@latest
breaking commitlint v20 drops support for Node <18
fix Upgrade Node to v18 or higher
breaking v20 is ESM-only, CJS require() will throw ERR_REQUIRE_ESM
fix Use dynamic import() in CJS or switch to ESM config (.commitlintrc.js with type:module)
deprecated The 'config-patternplate' package no longer ships separate CJS bundle; use .mjs or .js with type:module
fix Add 'type': 'module' to package.json or rename config to .commitlintrc.mjs
gotcha Rules imported from 'commitlint-config-patternplate' are mutable; modifying returned object affects global config
fix Deep clone the rules object before mutation: structuredClone(rules)
gotcha Avoid referencing 'commitlint-config-patternplate' as a file path; use npm package name only
fix Set extends to 'commitlint-config-patternplate' (string), not ./node_modules/...
npm install commitlint-config-patternplate
yarn add commitlint-config-patternplate
pnpm add commitlint-config-patternplate

Configures commitlint with patternplate style, overriding header max length to 72 characters.

// .commitlintrc.js
import patternplate from 'commitlint-config-patternplate';

export default {
  extends: [patternplate],
  rules: {
    'header-max-length': [2, 'always', 72],
  },
};