Repository navigation
fix(#48): align commitlint cli with config-conventional 21 - #49
Conversation
Dependabot (#44) moved @commitlint/config-conventional to 21.2.4 while @commitlint/cli stayed on 16.3.0. commitlint packages are released in lockstep; the v16 loader is not built to load the v21 preset, which needs Node >= 22.12.0 and pulls in ESM-only deps. The husky commit-msg hook runs this pairing on every commit. - package.json: bump @commitlint/cli to ^21.2.4 and raise engines.node to >=22.12.0 (the preset's floor; .nvmrc and the Dockerfile already use Node 24). - package-lock.json: regenerated; all @commitlint/* packages now resolve to major 21 and the v16-only deps are pruned. - README.md: update the Node requirement line. - .github/dependabot.yml: add a commitlint group (all update types) before dev-minor-patch so CLI and preset bump together. Verified on Node 22.22.1 after npm ci: 'feat: add x' passes, 'bad message' fails with type-empty/subject-empty, and `commitlint -E HUSKY_GIT_PARAMS` behaves the same way. Unit tests and eslint pass (2 pre-existing warnings in untouched files). Closes #48 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 9:11 PM UTC · Completed 9:21 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.65 |
|
<!-- fullsend:risk-assessment --> DetailsBot-authored dependency upgrade aligning commitlint versions with large but auto-generated package-lock.json delta; two dependency files and one protected path elevate Tier 1 while low git churn, zero regressions, and a well-scoped matching issue hold the composite at moderate, consistent with the prior assessment. Previous run<!-- fullsend:risk-assessment --> DetailsBot-authored dependency upgrade aligning commitlint versions with large but auto-generated package-lock.json delta; two dependency files and one protected path elevate Tier 1, while low git churn, zero regressions, and a well-scoped matching issue hold the composite at moderate. |
ReviewFindingsMedium
Low
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOltdfQ== --> ReviewFindingsMedium
Labels: Bug-fix PR that updates npm dev dependencies and the lockfile, matching how the repo labels fix and dependency PRs. |
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 9:31 PM UTC · Completed 9:41 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.51 |
|
🤖 Finished Retro · ✅ Success · Started 9:10 AM UTC · Completed 9:19 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.59 |
Retro: PR #49 (align
|
Summary
Dependabot (#44) moved
@commitlint/config-conventionalto 21.2.4 while@commitlint/clistayed on 16.3.0. commitlint packages are released in lockstep, and the v16 loader is not built to load the v21 preset. The v21 preset needs Node >= 22.12.0 and pulls in ESM-only dependencies. The current Husky 9commit-msghook (npx --no -- commitlint --edit "$1") runs this pairing on every commit.Changes
@commitlint/clifrom^16.2.1to^21.2.4, and raiseengines.nodefrom>=20to>=22.12.0. That is the preset's own floor;.nvmrc(24) and the Dockerfile (node:24-alpine) are already above it.npm install --package-lock-only. Every@commitlint/*package now resolves to major 21. The v16-only dependencies (ts-node,meow,cosmiconfig-typescript-loader, ...) are pruned. Pruning also moved the hoistedsemverfrom 7.3.7 to 7.8.6 (still^7), replacing the nested 7.8.1 copies. Other lockfile changes remove unused nested entries.>= 22.12.0.commitlintgroup (@commitlint/*, all version-update types including majors), listed beforedev-minor-patchso the CLI and the preset are always bumped together in one PR. This file is under.github/, so it may need a human approval.Testing
Run on Node 22.22.1 after
npm ci:npm ls @commitlint/cli @commitlint/config-conventional @commitlint/load: all 21.2.4, no v16 packagesecho 'feat: add x' | npx commitlint: exit 0echo 'bad message' | npx commitlint: exit 1 (subject-empty,type-empty)HUSKY_GIT_PARAMS=<file> npx commitlint -E HUSKY_GIT_PARAMS(the former Husky 4 invocation) gave the same results for good and bad messagesnpm test: 19 suites / 39 tests passnpm run lint: 0 errors (2 warnings that were already there, in untouched files)After merging current
main, I rerannpm ci, 39 tests,tsc --noEmit, build, lint (0 errors, 2 existing warnings), and the production audit (0 vulnerabilities). The Husky 9 hook accepts a valid message and rejects an invalid one. These local checks used Node 26.13.0; the merged tree was not rerun on the pinned Node 24.Notes
main. The merge retains its.husky/commit-msghook; a valid message passes and an invalid message is rejected with Commitlint 21.🤖 Generated with Claude Code
Closes #48
Post-script verification
agent/48-align-commitlint-cli)cd7764fb24dfcd7509b805b9823764949866ec21..HEAD)