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

always-return: enable ignoreLastCallback by default #452

Open
gurgunday opened this issue Feb 17, 2024 · 0 comments
Open

always-return: enable ignoreLastCallback by default #452

gurgunday opened this issue Feb 17, 2024 · 0 comments

Comments

@gurgunday
Copy link

gurgunday commented Feb 17, 2024

Description

I think the following is a perfectly valid use case, and I understand the argument against it: possible race conditions, async side effects, etc. But this is the nature of these callbacks, and, the rule is not enforced for .catch anyway, so we could argue the same thing for it too

In reality, this pattern is useful, and having it banned in the recommended config feels a little too intrusive for me

I can provide a PR

Steps to Reproduce

  import("/assets/path/deps/utils.js")
    .then((module) => {
      window.movePicCarousel = module.movePicCarousel; // the last callback doesn't need to return anything
    })
    .catch(console.error);

Expected behavior: [What you expect to happen]
No errors (like when ignoreLastCallback: true)

Actual behavior: [What actually happens]
Error

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

No branches or pull requests

1 participant