diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 0d21286..43eac0a 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,42 +1,16 @@ /** - * Custom config for commitlint based on Linchpin needs/conventions. + * Commit linting for this project. * - * This config only slightly modifies the default config to allow for "improve" as a type - * and adds support for ClickUp or Github issue numbers in the commit message. + * The rules live in @linchpinagency/commitlint-config so every Linchpin project + * lints commits the same way and a convention change ships from one place + * instead of drifting per repo. * - * Format Example + * Format example * - * feat(LINCHPIN-4850): Add new feature or GitHub issue number or NO-TASK if cowboying it on the fly. + * feat(PROJ-123): Add new feature + * + * or, with no task, NO-TASK or a GitHub issue number such as #42. */ module.exports = { - extends: ["@commitlint/config-conventional"], - rules: { - 'type-enum': [ - 2, - 'always', - [ - 'improve', - 'build', - 'chore', - 'ci', - 'docs', - 'feat', - 'fix', - 'perf', - 'refactor', - 'revert', - 'style', - 'test', - 'update', - ], - ], - 'subject-case': [1, 'always', ['sentence-case']], - }, - parserPreset: { - parserOpts: { - headerPattern: - /^(improve|build|ci|feat|fix|docs|style|revert|perf|refactor|test|chore)\(((?:[A-Z]+-\d+)|(?:NO-TASK)|(?:\#\d+))\):\s?([\w\d\s,\-]*)/, - headerCorrespondence: ['type', 'scope', 'subject'], - }, - } + extends: [ '@linchpinagency/commitlint-config' ], }; diff --git a/package-lock.json b/package-lock.json index 8ec2d14..415f1a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@commitlint/cli": "^21.0.0", "@commitlint/config-conventional": "^21.0.0", "@inquirer/prompts": "^8.2.1", + "@linchpinagency/commitlint-config": "^1.2.0", "@types/node": "^24.0.0", "@vercel/detect-agent": "^1.2.4", "commander": "^15.0.0", @@ -688,6 +689,20 @@ } } }, + "node_modules/@linchpinagency/commitlint-config": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@linchpinagency/commitlint-config/-/commitlint-config-1.2.0.tgz", + "integrity": "sha512-xysTh3qrlV11nZyByHjqheDp5Jct3GHX0RNZpXoAI20lCimEMHHWjtITfRPaNzq+z4vUL9SPUzByaDCCGVQf2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@commitlint/cli": ">=17.0.0", + "@commitlint/config-conventional": ">=17.0.0" + } + }, "node_modules/@oxc-project/types": { "version": "0.143.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.143.0.tgz", diff --git a/package.json b/package.json index d9afb68..264208a 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@commitlint/cli": "^21.0.0", "@commitlint/config-conventional": "^21.0.0", "@inquirer/prompts": "^8.2.1", + "@linchpinagency/commitlint-config": "^1.2.0", "@types/node": "^24.0.0", "@vercel/detect-agent": "^1.2.4", "commander": "^15.0.0",