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

Enable @typescript-eslint/no-floating-promises #29

Open
brc-dd opened this issue Dec 5, 2023 · 1 comment
Open

Enable @typescript-eslint/no-floating-promises #29

brc-dd opened this issue Dec 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@brc-dd
Copy link
Member

brc-dd commented Dec 5, 2023

Needed to make sure the promises are awaited/returned. Currently if you aren't careful enough, often you'll miss that a particular function is async and it should've been awaited. For example - router.replace here - https://github.com/globalbrain/sefirot/pull/406/files#diff-06e685d5200cf3dbea4fd7986f71b9bab23e0c6b85d19e69fefb1ac45be0d041

This rule requires type-information. I'm not sure how tricky that would be for us 👀

PS: Also enable - https://typescript-eslint.io/rules/require-await/

@brc-dd brc-dd added the enhancement New feature or request label Dec 5, 2023
@cuebit
Copy link
Member

cuebit commented Feb 6, 2024

This can be enabled if you create a tsconfig.eslint.json file in the root. But there are other rules that will also be enabled that will unfavourably interfere. I'll examine these and determine ones we will want to disable, otherwise Sefirot complains with over 100 lint errors because of some loose types.

N.B. no-floating-promises also means any promise chains must end with .catch(() => {}).

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

No branches or pull requests

2 participants