mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
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.
|
||
|---|---|---|
| .. | ||
| examples | ||
| fixtures | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| CHANGELOG.md | ||