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

Make sure there are no hanging promises #1042

Closed
IanKrieger opened this issue Jan 31, 2024 · 14 comments
Closed

Make sure there are no hanging promises #1042

IanKrieger opened this issue Jan 31, 2024 · 14 comments
Labels
good first issue Good for newcomers stale pending closure due to inactivity

Comments

@IanKrieger
Copy link
Contributor

IanKrieger commented Jan 31, 2024

enable the below eslint config and fix any errors:

    "@typescript-eslint/no-floating-promises": "error",
    "@typescript-eslint/no-misused-promises": "error",
@IanKrieger IanKrieger added the good first issue Good for newcomers label Jan 31, 2024
@shubrautt
Copy link
Contributor

@IanKrieger can I work on this issue?

@IanKrieger
Copy link
Contributor Author

Yes you can, @shubrautt

@shubrautt
Copy link
Contributor

image
@IanKrieger should I add void keyword or need to handle the promise?

@IanKrieger
Copy link
Contributor Author

I think in cases where we are setting a form value, we should await them, making the onClick async: onClick{async () => ...}

@shubrautt
Copy link
Contributor

I think we need to set checksVoidReturn to be false, to avoid this error @typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }]

@IanKrieger
Copy link
Contributor Author

I don't think we need that rule, but If you could provide an example of a line in the codebase that is failing because this check does not exist, we can go from there and I can give some direction on how to handle that.

@shubrautt
Copy link
Contributor

This is the file where I'm getting error.
image

@shubrautt
Copy link
Contributor

Same error also exist on other files also

@IanKrieger
Copy link
Contributor Author

Hmm, well since I do wish for the value updates to propagate, and I do not like the workarounds I've seen, I am fine with { "checksVoidReturn": false }

Thank you for asking

@shubrautt
Copy link
Contributor

image

what should I use while solving no-floating-promises errors, async/await or then/catch?

@IanKrieger
Copy link
Contributor Author

I think void in this scenario is ok, as any actions we want to take should be in the hook definition.

@shubrautt
Copy link
Contributor

shubrautt commented Feb 13, 2024

#1049, @IanKrieger I have pushed the code, How can I figure out where things need to be handled?.

Copy link

This issue is stale because it has been open for over a year with no activity. Remove stale label or add a comment to avoid this being closed in a weeks time.

@github-actions github-actions bot added the stale pending closure due to inactivity label Feb 13, 2025
Copy link

This issue was closed because it has been inactive for a week since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers stale pending closure due to inactivity
Projects
None yet
Development

No branches or pull requests

2 participants