diff --git a/bin/eslint-ignore-errors.js b/bin/eslint-ignore-errors.js
index <HASH>..<HASH> 100755
--- a/bin/eslint-ignore-errors.js
+++ b/bin/eslint-ignore-errors.js
@@ -38,7 +38,9 @@ execFile('eslint', ['--format', 'json', process.argv[2]], (error, stdout) => {
       addedLines += 1
     })
 
-    fs.writeFileSync(filename, jsLines.join('\n'), 'utf8')
+    if (result.messages.length !== 0) {
+      fs.writeFileSync(filename, jsLines.join('\n'), 'utf8')
+    }
   })
 })
Write file only if error messages were returned