Skip to content

Commit

Permalink
fix: respect String.protoype.repeat API contract
Browse files Browse the repository at this point in the history
  • Loading branch information
yehudagoldner authored and marionebl committed Nov 25, 2018
1 parent bd5eba3 commit f27e7ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion @commitlint/cli/src/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = flags => {
);
const ds = defaults ? `, defaults to: ${defaults}` : '';
const length = flags.reduce((sum, flag) => sum + flag.length, 0);
return `${fs.join(',')}${' '.repeat(4 + longest - length)}${desc}${ds}`;
return `${fs.join(',')}${' '.repeat(Math.max(4 + longest - length, 0))}${desc}${ds}`;
})
.join('\n');
};

0 comments on commit f27e7ac

Please sign in to comment.