Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Failed to read tmpfile contents for ESLint #1223

Open
brynary opened this issue Nov 26, 2024 · 5 comments
Open

Bug: Failed to read tmpfile contents for ESLint #1223

brynary opened this issue Nov 26, 2024 · 5 comments
Labels

Comments

@brynary
Copy link
Member

brynary commented Nov 26, 2024

What happened?

ESLint is erroring, and then qlty is trying to read a non-existent tmpfile. The tmpfile was never written, because ESLint errored.

The root cause here is that for certain ESLint versions we are misinterpreting some exit codes as success that really mean failure.

What did you expect to happen?

Since ESLint errored

Can you reproduce the problem?

Only sometimes

CLI Version

Current

Relevant log output

No response

@lsegal lsegal added the bug label Nov 26, 2024
@marschattha
Copy link
Member

I remember this came up before.

The issue was that for older versions of Eslint the exit code when there is an issue and when Eslint errors used to be the same, so we could not differentiate when it ran successfully with issues reported or crashed.

Taking a look of what we can do when this happens.

@brynary
Copy link
Member Author

brynary commented Nov 27, 2024

Thanks. Yes, I think it may be the difference between versions e.g. 5 vs 8.

Maybe we can use the same version-specific plugin definition trick we use for v8 vs v9 to solve for this

@marschattha
Copy link
Member

No that won't work in this case, because ESLint 5 with exit code 1 could mean either it has found lint issues (tmpfile will be present) or crashed (tmpfile won't be present).

I think presence of the tmpfile is going to become a branch statement somehow.

@brynary
Copy link
Member Author

brynary commented Nov 27, 2024

Interesting. Does ESLint v5 allow any CLI arguments to customize the exit code behavior?

@marschattha
Copy link
Member

Couldn't find any docs on older versions, but it seems this was an issue before v5, so until 4.x.

Here is the issue surrounding it and the PR which introduced a new exit code 2 for fatal crashes.

I could not find anything that would suggest that there is a flag/cli arg that could change this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants