-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
no-multiple-resolved
wrongly reports reject
in try/catch block
#382
Comments
Thank you for posting issue. It seems a bug. We can see it in an online demo I personally made. I will look for a way to fix it. |
🎉 This issue has been resolved in version 6.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
try {
resolve(someThrowingFn())
} catch (error) {
reject(error)
} still errors for me. It doesn't error if I do this: try {
const data = someThrowingFn()
resolve(data)
} catch (error) {
reject(error)
} But those two are identical and should behave same way? |
yes, the same for me try {
resolve({ data: await someThrowingFn() })
} catch (error) {
reject(error)
} |
@sequencerr opened as new issue |
Description
The new
no-multiple-resolved
rule (#369) reports an error ifresolve
is used in thetry
block andreject
is used in thecatch
block, even though they can't be both executed:Steps to Reproduce
(see code above)
Expected behavior: No error, since
resolve
is only called when thewriteFile
call succeeds, andreject
is only called if thewriteFile
call fails.Actual behavior: The
reject
call is reported:Versions
Additional Information
Repo to reproduce (but the rule is not enabled there yet):
https://github.com/OpenLightingProject/open-fixture-library/blob/6ee07f7a4a4be9907c1238531acd3ec0deeabdb3/plugins/qlcplus_4.12.2/exportTests/fixture-tool-validation.js#L81-L101
The text was updated successfully, but these errors were encountered: