Skip to content

Commit 5991060

Browse files
committed
fix: avoid slicing header if not long enough
Recent PR[1] didn't take in account very small subjects in subject-full-stop rule. [1] conventional-changelog#3839
1 parent d0be172 commit 5991060

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

@commitlint/rules/src/subject-full-stop.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export const subjectFullStop: SyncRule<string> = (
1515

1616
const negated = when === 'never';
1717
let hasStop = input[input.length - 1] === value;
18-
if (input.slice(-3) === '...') {
18+
let ellipsis = '...';
19+
if (input.length > ellipsis.length && input.slice(-ellipsis.length) === ellipsis) {
1920
hasStop = false;
2021
}
2122

0 commit comments

Comments
 (0)