globalbrain / eslint-config

The Global Brain ESLint Config.
MIT License
3 stars 0 forks source link

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

Open brc-dd opened 11 months ago

brc-dd commented 11 months ago

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/

cuebit commented 9 months ago

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(() => {}).