Skip to content

Commit 3141882

Browse files
escapedcatmarionebl
authored andcommitted
fix(cli): avoid linebreak in empty input (#523)
1 parent 7d9e760 commit 3141882

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

@commitlint/cli/src/cli.js

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ async function main(options) {
123123

124124
const messages = (Array.isArray(input) ? input : [input])
125125
.filter(message => typeof message === 'string')
126+
.filter(message => message.trim() !== '')
126127
.filter(Boolean);
127128

128129
if (messages.length === 0 && !checkFromRepository(flags)) {

0 commit comments

Comments
 (0)