jest-runner-eslint icon indicating copy to clipboard operation
jest-runner-eslint copied to clipboard

Catch ESLint lintFiles errors (fixes #96)

Open alunny opened this issue 3 years ago • 4 comments

Hello!

Right now, if an ESLint rule throws an error, the error object includes a reference to the AST node where the error originated, which includes circular data structures. jest-runner-eslint doesn't do anything special for these errors.

If the tests are running in band, this is not an issue: Jest correctly shows the error to the user. However, if the test is running in a child process, the runner tries to send the circular data structure back to the main process, which produces the Converting circular structure to JSON error shown in #96.

This patch puts a try…catch around the call to lintFiles, so the error message can be reported to Jest explicitly, preventing the circular reference from being propagated.

alunny avatar May 11 '22 23:05 alunny

@alunny hey there! sorry I missed this PR.

I merged in main and it seems tests are failing. Could you take a look? 🙂

SimenB avatar Aug 25 '22 13:08 SimenB

Thanks @SimenB , looks like I needed to run Prettier again :)

alunny avatar Sep 12 '22 22:09 alunny

@alunny sorry, missed your ping. triggered CI now - seems like there's still lots of failures 🙂

SimenB avatar Oct 19 '22 07:10 SimenB

@alunny ping

SimenB avatar Jan 16 '23 07:01 SimenB