Skip to content

Commit 3ab514b

Browse files
committed
ESLintBear: Show errors shown in stderr
In some cases, eslint fails. Because of this, the user can't see any results, nor does the user see any warning that it failed. We now show the stderr to the user as a WARNING. Fixes coala#730
1 parent a95f85e commit 3ab514b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

bears/js/ESLintBear.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99

1010
@linter(executable='eslint',
11-
use_stdin=True)
11+
use_stdin=True,
12+
use_stderr=True)
1213
class ESLintBear:
1314
"""
1415
Check JavaScript and JSX code for style issues and semantic errors.
@@ -48,10 +49,15 @@ def generate_config(filename, file):
4849
return '{"extends": "eslint:recommended"}'
4950

5051
def process_output(self, output, filename, file):
51-
if not file or not output:
52+
if output[1]:
53+
self.warn("While running {0}, some issues were found:"
54+
.format(self.__class__.__name__))
55+
self.warn(output[1])
56+
57+
if not file or not output[0]:
5258
return
5359

54-
output = json.loads(output)
60+
output = json.loads(output[0])
5561
lines = "".join(file)
5662

5763
assert len(output) == 1

0 commit comments

Comments
 (0)