Checks
Describe the bug (be clear and concise)
I'm seeing a type mismatch when writing the following code:
createProxyMiddleware({
on: {
proxyReq: responseInterceptor( ... )
}
})
The error is detected by typescript-eslint:
Promise-returning function provided to property where a void return was expected.eslint[@typescript-eslint/no-misused-promises](https://typescript-eslint.io/rules/no-misused-promises)
The types are defined as follows:
// on.proxyRes
type ProxyResCallback<TIncomingMessage = http.IncomingMessage, TServerResponse = http.ServerResponse> = (
proxyRes: TIncomingMessage,
req: TIncomingMessage,
res: TServerResponse,
) => void;
// responseInterceptor
export declare function responseInterceptor<TReq extends http.IncomingMessage = http.IncomingMessage, TRes extends http.ServerResponse = http.ServerResponse>(interceptor: Interceptor<TReq, TRes>): (proxyRes: TReq, req: TReq, res: TRes) => Promise<void>;
I'm not sure if on.proxyRes should support promises, or if the returnValue of responseInterceptor should just be void.
Step-by-step reproduction instructions
Expected behavior (be clear and concise)
There shouldn't be a type mismatch.
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response
Checks
http-proxy-middleware.Describe the bug (be clear and concise)
I'm seeing a type mismatch when writing the following code:
The error is detected by typescript-eslint:
Promise-returning function provided to property where a void return was expected.eslint[@typescript-eslint/no-misused-promises](https://typescript-eslint.io/rules/no-misused-promises)The types are defined as follows:
I'm not sure if
on.proxyResshould support promises, or if the returnValue of responseInterceptor should just bevoid.Step-by-step reproduction instructions
Expected behavior (be clear and concise)
There shouldn't be a type mismatch.
How is http-proxy-middleware used in your project?
What http-proxy-middleware configuration are you using?
-What OS/version and node/version are you seeing the problem?
Additional context (optional)
No response