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

@typescript-eslint/no-floating-promises conflicts no-void #278

Open
01397 opened this issue May 23, 2024 · 0 comments
Open

@typescript-eslint/no-floating-promises conflicts no-void #278

01397 opened this issue May 23, 2024 · 0 comments

Comments

@01397
Copy link

01397 commented May 23, 2024

Summary

When there is no need to wait for a Promise to be resolved, two rules are in conflict.

  • @typescript-eslint/no-floating-promises recommends to using void operator to as an explicit marker.
  • no-void prohibits using void
Screenshot 2024-05-23 at 15 50 57

Details

The ESLint official docs recommends using the allowAsStatement option of no-void when using two rules.

With this option set to true, and if you are using no-void, you should turn on the allowAsStatement option.
https://typescript-eslint.io/rules/no-floating-promises/#ignorevoid

Possible solutions

  • Add allowAsStatement option to no-void to developer can use void as markers
  • Add ignoreVoid: false to @typescript/no-floating-promises, and developer use eslint-disable-next-line as markers.
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