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
Fix: Use error templates even when reading from stdin (fixes #7213) #7223
Fix: Use error templates even when reading from stdin (fixes #7213) #7223
Conversation
@not-an-aardvark, thanks for your PR! By analyzing the annotation information on this pull request, we identified @nzakas, @shumphrey and @ilyavolodin to be potential reviewers |
LGTM |
Hmm. Are there any other tests we can run to try to force other errors (which should have "pretty" output) to be thrown while piping code in? The original discussion is about one use case, so it'd be great to have at least a manual test showing another possible case. (Example: Finding nonexistent plugin, maybe?) |
32015ac
to
7adde9e
Compare
LGTM |
Updated the PR to add some tests for the
|
7adde9e
to
2dc3e08
Compare
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just would like another set of eyes.
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
See #7213 for template answers.
Please check each item to ensure your pull request is ready:
What changes did you make? (Give an overview)
This updates
bin/eslint.js
to treat stdin errors like all other errors. ESLint has a genericprocess.on('uncaughtException')
handler that handles error templates, but previously the code for the stdin flag had its own error handling logic. This PR removes the error handling logic fromstdin
, which allows stdin errors to cascade to theuncaughtException
handler.Is there anything you'd like reviewers to focus on?
This PR should not be merged yet, as it still needs tests. However, I didn't notice any existing tests forbin/eslint.js
. Is there a file with tests that I missed, or should I create a new one?edit: The PR now has tests.