Skip to content

fix(deps): bump @commitlint packages to v20#837

Open
jhoblitt wants to merge 1 commit into
wagoid:masterfrom
jhoblitt:fix/bump-commitlint-v20
Open

fix(deps): bump @commitlint packages to v20#837
jhoblitt wants to merge 1 commit into
wagoid:masterfrom
jhoblitt:fix/bump-commitlint-v20

Conversation

@jhoblitt

Copy link
Copy Markdown

What

Bump all @commitlint/* dependencies from v19 to v20 (and
commitlint-plugin-function-rules to 4.3.2 for peer compatibility), regenerating
package-lock.json.

Why

commitlint 19 bundles conventional-commits-parser@5.x, which misparses a commit
body line that begins with an issue reference (e.g. #123) as the start of the
footer. With footer-leading-blank enabled that yields a false positive, because
the "footer" it invented is not preceded by a blank line.

Minimal repro (fails on the action as shipped, wagoid/commitlint-github-action@v6.2.1):

fix: don't frobnicate the foobar

This commit prevents the foobar from being frobnicated
during operation, and therefore fixes #69.
✖   footer must have leading blank line [footer-leading-blank]

commitlint 20 upgrades the parser to conventional-commits-parser@6.x, which parses
this correctly. Verified locally: the same message fails under the bundled 19.8.1 and
passes under 20.5.3.

Upstream tracker: #896 (open since 2020); see also the reproduction in
conventional-changelog/commitlint#4099.

Why v20 and not v21

commitlint-plugin-function-rules@4.3.x declares peerDependencies["@commitlint/lint"] = ">=19 <21", so it does not yet support commitlint 21 (that needs the plugin's v5
line, which in turn requires commitlint 21 and drops <21). v20 is the highest release
compatible with the currently-pinned plugin.

Node

No Node change required. commitlint 20 only needs Node 18+; the repo's pinned
20.16.0 (Dockerfile / .nvmrc / engines) already satisfies it.

Verification

  • npm run build — ok
  • npm test39/39 pass
  • npm run lint (eslint) — clean
  • Self-lint of this repo's config under commitlint 20 — clean
  • The repro message above now passes; the parser is conventional-commits-parser@6.3.0
    under @commitlint/parse@20.5.0

commitlint 19 bundles conventional-commits-parser 5, which misparses a body line
that begins with an issue reference as the start of the footer and raises a false
footer-leading-blank error. commitlint 20 upgrades to conventional-commits-parser
6, which fixes that parse.

Bump every @commitlint/* dependency from v19 to v20, and
commitlint-plugin-function-rules to 4.3.2 for commitlint 20 peer compatibility.
Node stays at 20.16.0; commitlint 20 requires only Node 18+.

Refs: wagoid/commitlint-github-action#896

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant