| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hey, @ljharb |
Sorry, something went wrong.
There was a problem hiding this comment.
All this does is exit when there’s an error - i thought the issue was an eslint 9+ bug that could be fixed?
Sorry, something went wrong.
|
hey, @ljharb
I understood you. you really want fix the real ESLint 9+ bug so the config loads correctly; not just better behavior when it errors, right? |
Sorry, something went wrong.
|
Hey, @ljharb could you pls review the PR again? 🙏 |
Sorry, something went wrong.
|
Hi, @ljharb how are you? |
Sorry, something went wrong.
|
Hi, @ljharb how are you doing? |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR updates the handling of ESLint versions to ensure compatibility with ESLint 9+ by dynamically checking and loading the appropriate class or functionality. The changes are minimal, clear, and address the issue effectively without introducing unnecessary complexity.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
When CLIEngine is not available (ESLint 9+), whitespace.js loads config by running whitespace-async.js with execSync and parsing its stdout as JSON. The async script had no .catch() on its promise, so rejections became unhandled: the child could exit non-zero and print to stderr while the parent received empty or partial stdout and failed with a generic JSON.parse error, hiding the real failure.
Approach
Changes
On success, only JSON is written to stdout, so the parent’s execSync + JSON.parse continues to work. On failure, the real error goes to stderr and the process exits 1, so execSync throws and the thrown error includes the child’s stderr, making the root cause visible without masking crashes.
Fixes #3238