{"id":25104,"library":"commitlint-config-patternplate","title":"commitlint-config-patternplate","description":"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.","status":"active","version":"20.5.3","language":"javascript","source_language":"en","source_url":"https://github.com/conventional-changelog/commitlint","tags":["javascript","conventional-changelog","commitlint","commitlint-config","angular"],"install":[{"cmd":"npm install commitlint-config-patternplate","lang":"bash","label":"npm"},{"cmd":"yarn add commitlint-config-patternplate","lang":"bash","label":"yarn"},{"cmd":"pnpm add commitlint-config-patternplate","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"extended base config providing conventional commit rules","package":"@commitlint/config-conventional","optional":false},{"reason":"runtime peer for resolving and applying rules","package":"@commitlint/lint","optional":false}],"imports":[{"note":"ESM-only since v20; CJS require() will fail with ERR_REQUIRE_ESM","wrong":"const config = require('commitlint-config-patternplate')","symbol":"config-patternplate","correct":"import config from 'commitlint-config-patternplate'"},{"note":"Use CJS config file (.commitlintrc.cjs) if project uses require()","wrong":"module.exports = { extends: ['commitlint-config-patternplate'] }","symbol":"default config","correct":"export default { extends: ['@commitlint/config-conventional'] }"},{"note":"Named export 'rules' available, not a separate file","wrong":"import rules from 'commitlint-config-patternplate/rules'","symbol":"rules","correct":"import { rules } from 'commitlint-config-patternplate'"}],"quickstart":{"code":"// .commitlintrc.js\nimport patternplate from 'commitlint-config-patternplate';\n\nexport default {\n  extends: [patternplate],\n  rules: {\n    'header-max-length': [2, 'always', 72],\n  },\n};","lang":"typescript","description":"Configures commitlint with patternplate style, overriding header max length to 72 characters."},"warnings":[{"fix":"Upgrade Node to v18 or higher","message":"commitlint v20 drops support for Node <18","severity":"breaking","affected_versions":">=20.0.0"},{"fix":"Use dynamic import() in CJS or switch to ESM config (.commitlintrc.js with type:module)","message":"v20 is ESM-only, CJS require() will throw ERR_REQUIRE_ESM","severity":"breaking","affected_versions":">=20.0.0"},{"fix":"Add 'type': 'module' to package.json or rename config to .commitlintrc.mjs","message":"The 'config-patternplate' package no longer ships separate CJS bundle; use .mjs or .js with type:module","severity":"deprecated","affected_versions":">=20.0.0"},{"fix":"Deep clone the rules object before mutation: structuredClone(rules)","message":"Rules imported from 'commitlint-config-patternplate' are mutable; modifying returned object affects global config","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set extends to 'commitlint-config-patternplate' (string), not ./node_modules/...","message":"Avoid referencing 'commitlint-config-patternplate' as a file path; use npm package name only","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Rename config to .commitlintrc.mjs or use dynamic import: const config = await import('commitlint-config-patternplate');","cause":"Config file uses require() but package is ESM-only.","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."},{"fix":"Run: npm install --save-dev @commitlint/config-conventional","cause":"Missing peer dependency '@commitlint/config-conventional'.","error":"Cannot find module '@commitlint/config-conventional'"},{"fix":"Check rule names from patternplate configuration (e.g., header-max-length, scope-case) and ensure they are arrays [level, applicable, value]","cause":"Mistyped rule name or incorrect rule format.","error":"Invalid rule definition: rule 'xxx' must be a function or array of functions"},{"fix":"Upgrade commitlint and all config packages to v20: npm install commitlint@latest @commitlint/cli@latest commitlint-config-patternplate@latest","cause":"commitlint version incompatibility; v20 changed internal rule API.","error":"TypeError: Cannot read properties of undefined (reading 'some')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}