isConventionalCommit
Checks whether a commit message’s subject line follows the Conventional Commits format constrained by the given options.
Only the first line is inspected — body and footer are ignored.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
message | string | Full commit message or just its subject line. |
options | ConventionalCommitOptions | Optional constraints (allowed types/scopes, scope requirement). (optional) |
Returns
Section titled “Returns”boolean — true when the subject line matches; false otherwise.
Examples
Section titled “Examples”Validate a commit subject
Section titled “Validate a commit subject”Returns true when the first line follows the Conventional Commits format.
Restrict accepted types
Section titled “Restrict accepted types”Reject any commit whose type is not in the supplied allowlist.
Related Types
Section titled “Related Types”ConventionalCommitOptions
Section titled “ConventionalCommitOptions”Options shared by buildConventionalCommitRegex, parseConventionalCommit,
and isConventionalCommit to constrain the accepted commit format.
