Severity: Unhandled promise rejection in `whitespace-async.js` when ESLint async path is used
- Vorherrschende Sprache
- JavaScript
- Sterne
- 148k
- Forks
- 26.6k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne bei Zeile 49 in packages/eslint-config-airbnb-base/whitespace-async.js und packages/eslint-config-airbnb/whitespace-async.js und verfolge dann, wie whitespace.js das async-Skript mit execSync aufruft. Überprüfe den Rejection-Pfad und das Ausgabeverhalten des Child-Prozesses. Erledigt ist die Aufgabe, wenn rejected Promises behandelt, der Fehler protokolliert und process.exitCode auf 1 gesetzt wird, damit der Parent kein irreführendes JSON erhält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- eslint, javascript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 78/100