We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
process.exitCode
1 parent 2081992 commit 22bc769Copy full SHA for 22bc769
napi/oxlint2/src/index.js
@@ -100,9 +100,11 @@ async function main() {
100
const linter = new Linter();
101
102
const success = await linter.run();
103
- if (!success) {
104
- process.exit(1);
105
- }
+
+ // Note: It's recommended to set `process.exitCode` instead of calling `process.exit()`.
+ // `process.exit()` kills the process immediately and `stdout` may not be flushed before process dies.
106
+ // https://nodejs.org/api/process.html#processexitcode
107
+ if (!success) process.exitCode = 1;
108
}
109
110
main();
0 commit comments