Repository navigation
fix(load): run the parser factory of scoped conventional-changelog presets - #4968
Merged
escapedcat merged 2 commits intoAug 22, 2026
Conversation
…esets A preset published under a scope, such as `@scope/conventional-changelog-preset`, never matched the `conventional-changelog-` name check, so its `parserOpts` factory was never called. The factory function was passed through as-is and the configured parser options were silently dropped. fixes conventional-changelog#2488
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failures identified. The normalization preserves existing unscoped behavior while recognizing the standard
|
| Filename | Overview |
|---|---|
| @commitlint/load/src/utils/load-parser-opts.ts | Safely extends the existing conventional-changelog factory branch to scoped package names without changing other established preset shapes. |
| @commitlint/load/src/utils/load-parser-opts.test.ts | Adds focused regression coverage demonstrating that a scoped preset factory resolves to parser options. |
Reviews (1): Last reviewed commit: "fix(load): run the parser factory of sco..." | Re-trigger Greptile
Member
|
Thanks! |
Merged
via the queue into
conventional-changelog:master
with commit Aug 22, 2026
a42b18c
12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fixes #2488
@commitlint/loadonly invoked a preset'sparserOptsfactory when the preset name started withconventional-changelog-. A preset published under a scope, for example@scope/conventional-changelog-preset, never matched that check, so the factory was passed through untouched and the preset's parser options were silently dropped. commitlint then parsed commits with default options and gave no error.Root cause: the
parser.name.startsWith("conventional-changelog-")guard on the factory branch in@commitlint/load/src/utils/load-parser-opts.ts.Reproduced on the published
@commitlint/load@21.2.2: with two identical factory presets innode_modules,conventional-changelog-myorgresolvesparserOptsto an object while@scope/conventional-changelog-myorgleaves it as a function.Fix
Strip a leading
@scope/before the prefix check, so a scoped preset is recognized the same way an unscoped one already is. Behavior for every other preset shape is unchanged.Test
load-parser-opts.test.tsgains a case for a scoped preset exposing aparserOptsfactory. It fails without the fix (parserOpts stays a function) and passes with it. Full suite stays green.