diff --git a/@commitlint/rules/src/subject-full-stop.ts b/@commitlint/rules/src/subject-full-stop.ts index 050a4f7b16..91c0d9bb42 100644 --- a/@commitlint/rules/src/subject-full-stop.ts +++ b/@commitlint/rules/src/subject-full-stop.ts @@ -6,12 +6,14 @@ export const subjectFullStop: SyncRule = ( when = 'always', value = '.' ) => { - const input = parsed.subject; - if (!input) { + let colonIndex = parsed.header.indexOf(':'); + if (colonIndex > 0 && colonIndex === parsed.header.length - 1) { return [true]; } + const input = parsed.header; + const negated = when === 'never'; const hasStop = input[input.length - 1] === value;