Skip to content

Commit

Permalink
fix: subjectFullStop triple dot title ending
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho committed Aug 15, 2023
1 parent c585a9d commit 1f6e272
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion @commitlint/rules/src/subject-full-stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ export const subjectFullStop: SyncRule<string> = (
const input = parsed.header;

const negated = when === 'never';
const hasStop = input[input.length - 1] === value;
let hasStop = null;

if(value !== '.')
{
hasStop = input[input.length - 1] === value;
}
else
{
hasStop = input.endsWith(".") && !input.endsWith("..");

This comment has been minimized.

Copy link
@knocte

knocte Aug 15, 2023

@Mersho shouldn't the second string be "..."?

This comment has been minimized.

}

return [
negated ? !hasStop : hasStop,
Expand Down

0 comments on commit 1f6e272

Please sign in to comment.