Skip to content

Commit c8fb1d8

Browse files
committed
Write file only if error messages were returned
1 parent 2f24017 commit c8fb1d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/eslint-ignore-errors.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ execFile('eslint', ['--format', 'json', process.argv[2]], (error, stdout) => {
3838
addedLines += 1
3939
})
4040

41-
fs.writeFileSync(filename, jsLines.join('\n'), 'utf8')
41+
if (result.messages.length !== 0) {
42+
fs.writeFileSync(filename, jsLines.join('\n'), 'utf8')
43+
}
4244
})
4345
})
4446

0 commit comments

Comments
 (0)