Make sure there are no hanging promises
enable the below eslint config and fix any errors:
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
@IanKrieger can I work on this issue?
Yes you can, @shubrautt
@IanKrieger should I add void keyword or need to handle the promise?
I think in cases where we are setting a form value, we should await them, making the onClick async: onClick{async () => ...}
I think we need to set checksVoidReturn to be false, to avoid this error @typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }]
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.
This is the file where I'm getting error.
Same error also exist on other files also
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
what should I use while solving no-floating-promises errors, async/await or then/catch?
I think void in this scenario is ok, as any actions we want to take should be in the hook definition.
#1049, @IanKrieger I have pushed the code, How can I figure out where things need to be handled?.
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.
This issue was closed because it has been inactive for a week since being marked as stale.