forked from eslint/eslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure that exit code for fatal errors is not overwritten (eslin…
…t#17683) * fix: ensure that exit code for fatal errors is not overwritten * Add comments * update test
- Loading branch information
1 parent
4164b2c
commit 1ad6257
Showing
4 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function throwError() { | ||
const error = new Error(); | ||
error.stack = "test_error_stack"; | ||
throw error; | ||
} | ||
|
||
process.nextTick(throwError); | ||
|
||
function delay(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
|
||
async function getConfig() { | ||
await delay(100); | ||
return []; | ||
} | ||
|
||
/* | ||
* Exporting the config as an initially unsettled Promise should ensure that | ||
* the error in next tick will be thrown before any linting is done | ||
*/ | ||
module.exports = getConfig(); |