You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a minor bug in Connect caused by forgetting to return a promise from a function. This seemed like something which could be caught by a linter, so I looked for relevant rules and found no-floating-promises.
However, after turning it on, there's almost 300 errors in the project. It's mostly due to uses of the run function from useAttempt and useAsync where we don't inspect the resulting promise, because we know that 1) the promise won't fail 2) the error is handled through the attempt object. Such callsites can be fixed by changing run() to void run().
As we won't find time to address all 300 callsites, it'd be best to ignore existing errors and start using the rule to prevent new issues from being created.
This requires a couple of things:
Set parserOptions.project to "tsconfig.json" in web/packages/build/.eslintrc.js, otherwise no-floating-promises can't be used.
Setting that option makes ESLint significantly slower. Figure out if there's anything we can do to speed it up.
See Performance Troubleshooting, specifically the part about wide includes. We have a couple of them in our config.
Ignore existing issues reported by no-floating-promises.
There's eslint-disable-inserter, maybe there are other packages too. It could be done through comments, but other ways work too. If it's done through comments, bonus points for using comment descriptions.
The text was updated successfully, but these errors were encountered:
https://typescript-eslint.io/rules/no-floating-promises/
There's a minor bug in Connect caused by forgetting to return a promise from a function. This seemed like something which could be caught by a linter, so I looked for relevant rules and found no-floating-promises.
However, after turning it on, there's almost 300 errors in the project. It's mostly due to uses of the
run
function fromuseAttempt
anduseAsync
where we don't inspect the resulting promise, because we know that 1) the promise won't fail 2) the error is handled through the attempt object. Such callsites can be fixed by changingrun()
tovoid run()
.As we won't find time to address all 300 callsites, it'd be best to ignore existing errors and start using the rule to prevent new issues from being created.
This requires a couple of things:
parserOptions.project
to"tsconfig.json"
inweb/packages/build/.eslintrc.js
, otherwise no-floating-promises can't be used.The text was updated successfully, but these errors were encountered: