Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLintBear: Show errors shown in stderr #788

Merged
merged 1 commit into from
Sep 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions bears/js/ESLintBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@


@linter(executable='eslint',
use_stdin=True)
use_stdin=True,
use_stderr=True)
class ESLintBear:
"""
Check JavaScript and JSX code for style issues and semantic errors.
Expand Down Expand Up @@ -48,10 +49,15 @@ def generate_config(filename, file):
return '{"extends": "eslint:recommended"}'

def process_output(self, output, filename, file):
if not file or not output:
if output[1]:
self.warn("While running {0}, some issues were found:"
.format(self.__class__.__name__))
self.warn(output[1])

if not file or not output[0]:
return

output = json.loads(output)
output = json.loads(output[0])
lines = "".join(file)

assert len(output) == 1
Expand Down