No error handling around execSync + JSON.parse in whitespace.js (ESLint 9 path)
- Vorherrschende Sprache
- JavaScript
- Sterne
- 148k
- Forks
- 26.6k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## Summary
When `CLIEngine` is not available (e.g. ESLint 9), `whitespace.js` loads the config by running `whitespace-async.js` with `execSync` and then doing `JSON.parse(String(...))` on the result. There is no try/catch around this.
## Impact
- If the child script exits non-zero, prints errors, or prints non-JSON (e.g. ESLint timing or debug output), `execSync` may throw or return non-JSON.
- `JSON.parse` will then throw and the config load fails with a generic parsing error, making it hard to see that the real failure was in the child script.
## Affected files
- `packages/eslint-config-airbnb-base/whitespace.js` (line 55)
- `packages/eslint-config-airbnb/whitespace.js` (line 55)
## Suggested fix
Wrap the `execSync` call and `JSON.parse` in try/catch and rethrow with a clear message (and optionally `cause: err`) so failures are easier to diagnose.
## screenshot
I'd love to work on this.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne bei Zeile 55 in packages/eslint-config-airbnb-base/whitespace.js und packages/eslint-config-airbnb/whitespace.js und verfolge den von execSync und JSON.parse verwendeten Pfad, wenn CLIEngine nicht verfügbar ist. Die Arbeit ist abgeschlossen, wenn Fehler von Child-Skripten und ungültige Ausgaben eine klare Diagnose erzeugen, während das erfolgreiche Laden der Konfiguration weiterhin funktioniert.
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
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100