chore: resolve various eslint complaints #169
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "eslint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some warnings remain, none of them particularly useful, but I've decided not to disable them. However, I did decide to disable
@typescript-eslint/no-misused-promises
due to basically only being noise, and removed the respective comments made because of it.Sadly express typescript typings don't support async function handlers, therefore we need to use that misused-promises ignore line frequently.
However, I would like to keep the setting enabled, as it is generally quite important to keep on.
Yes it means more noise (until the express situation is handled- there are solutions), but its an important setting to keep enabled.
Is there any example where the
@typescript-eslint/no-misused-promises
lint has flagged a warning and it was actually useful?I had a quick look at ts-eslint and the examples there look like it would be useful.
There seems to be a half-decent "fix": casting the function handler to the correct type
Reference to the problem (express typings are not up2date):
git issue
git issue
Well, just looking at this project specifically, every time the warning was raised, it was either ignored, or a comment was added to suppress it. I feel like just disabling it project-wide is the best move until the upstream issue is resolved.
The upstream issue won't be solved in the near future it seems, based on how long this problem exists.
I'm heavily against turning off typescript checks- the whole reason of using typescript is that we get these warnings.
The comment to suppress these warnings is harmless, bugs resulting from code that is uncaught due to the check being disabled is dangerous.
Also, I would think that I've had the warning happen to me occasionally but I fixed the error, so that would of course make it useful.
I would happily cast every function handler as RequestHandler, then the problem is solved :)
Well, I've reverted that change.