Reputation: 3451
I have a method call as follows where I'm not using the res
parameter but am using the next
parameter. I don't want to use // @ts-ignore
but not sure what the best practice is to handle this situation.
Thoughts?
server.post('/rpc/Account/IsLoggedIn', function(req: any, res: any, next: () => {}) {
req.body = 'abcd'
next();
});
Upvotes: 0
Views: 62
Reputation: 571
Add an underscore _ to the params that you don't wanna use. By doing this, TypeScript won't complain about the unused variables.
server.post('/rpc/Account/IsLoggedIn', function(req: any, _res: any, next: () => {}) {
req.body = 'abcd'
next();
});
Upvotes: 2