Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linter): add
oxc/no-async-endpoint-handlers
(#5364)
Adds `no-async-endpoint-handlers` rules, which bans async functions used as endpoint handlers in Express applications. These do not get caught by Express' error handler, causing the server to crash with an unhandled process rejection error. ```js app.use(async (req, res) => { const foo = await api.getFoo(req.query) // server panics if this function rejects return res.json(foo) }) ``` I could not find this rule implemented in any ESLint plugin, but this is a problem I see quite often and I'm tired of dealing with it. I've added it to `oxc` for now, but we should consider adding an `express` or `api` plugin in the future.
- Loading branch information