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: ensure that exit code for fatal errors is not overwritten #17683
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function throwError() { | ||
const error = new Error(); | ||
error.stack = "test_error_stack"; | ||
throw error; | ||
} | ||
|
||
process.nextTick(throwError); | ||
|
||
/* | ||
* Promise ensures that this config must be await-ed and therefore | ||
* the error in next tick will be thrown before any linting is done | ||
*/ | ||
module.exports = Promise.resolve([{}]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note that using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, and I noticed the same while experimenting with the test, that it works as intended without the Promise too. I decided to keep exporting the Promise to make sure there must be an async step so that the error is thrown before the linting finishes no matter how we rewrite the code in the future. However, I have now checked more thoroughly what happens while executing this and it seems that multiple |
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.
Can you add some comments around these additions?