middleware-must-call-next - ESLint plugin rules
This rule requires middleware functions registered via defineMiddlewares to reference their next parameter.
Severity#
warn. This rule is enabled in the recommended preset.
What it Targets#
This rule targets the src/api/middlewares.ts file. It reports a middleware function that declares a next parameter but never references it, which stops the middleware chain.
The following code is reported by the rule:
Instead, call next so the chain continues:
Why it's Important#
A middleware that doesn't call (or end the response) leaves the request hanging, so the route handler is never reached. Referencing keeps the middleware chain moving.
Learn more in the Middlewares documentation.
Fixable#
This rule isn't auto-fixable.
Turn it Off#
To turn off this rule, set it to off in your ESLint configuration:
Or disable it for a single line using an inline comment: