#3237·javascript

Severity: Unhandled promise rejection in `whitespace-async.js` when ESLint async path is used

Author: dataCenter430Created Mar 5, 2026Updated Sep 8, 2026

Summary

When the config is loaded on ESLint 9 (or when CLIEngine is unavailable), whitespace.js runs whitespace-async.js via execSync. That script calls onlyErrorOnRules(...).then(...) with no .catch(). If the promise rejects, the rejection is unhandled.

Impact

  • Process can exit with an unhandled rejection.
  • Child process may write errors (or non-JSON) to stdout, so the parent’s JSON.parse(stdout) can throw and fail config loading with an unclear error.

Affected files

  • packages/eslint-config-airbnb-base/whitespace-async.js (line 49)
  • packages/eslint-config-airbnb/whitespace-async.js (line 49)

Suggested fix

Add a .catch() that logs the error and sets process.exitCode = 1, so rejections are handled and the child exits with a non-zero code instead of leaving an unhandled rejection.

Screenshot

I'd love to have the chance to contribute to this.