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
hono will throw a runtime error of Context is not finalized if there is no return c.xxx(), but there is no typescript check, some functions return c.body(null, 204), which is easy to be forgotten.
So I think if we can add some type check or eslint rules to prevent no return expression
The text was updated successfully, but these errors were encountered:
Currently, it throws a TypeScript error when a handler is not async.
But if it is an async function, we can't make it throw an error because we have to treat the middleware handler as the same as the handler. For example, the code should not throw an error.
app.get('/',async(c,next)=>{awaitnext()})
So an async handler does not throw an error.
Making it throw an error will be difficult or impossible, I think.
What is the feature you are proposing?
hono
will throw a runtime error ofContext is not finalized
if there is noreturn c.xxx()
, but there is no typescript check, some functions returnc.body(null, 204)
, which is easy to be forgotten.So I think if we can add some type check or eslint rules to prevent
no return expression
The text was updated successfully, but these errors were encountered: