|
|
|
|
|
by bilalq
1543 days ago
|
|
>> failing to catch errors and handle rejected promises, etc. > This is an issue and has led to bugs. > Pretty much anything where there's some implicit details that the compiler or linters can't reason about programmers find a way to get wrong. One thing I like about the hooks linter setup is that what it encourages you to do by default will prevent most bugs, only lead to potential performance issues, unnecessary rerenders, unnecessary refetches. This is something that can be mitigated via the no-floating-promises linter rule if you're using TypeScript[0]. For the cases where you actually want to just swallow errors, you can just add a `.catch(noop)`. This makes such situations explicit. You can get even stricter with the no-misued-promises rule[1]. [0]: https://github.com/typescript-eslint/typescript-eslint/blob/... [1]: https://github.com/typescript-eslint/typescript-eslint/blob/... |
|