Currently, I am facing an issue with the following demo code:
const callFnWithArgs = (callback: (a: string, b: number) => void) =>
async (a: string, b: number): Promise<void> => {
try {
await callback(a,b)
}
catch(e){
console.log(e)
}
The functionality of the code is working as expected. However, my project has ESLint configured to detect unused variables, and it is flagging 'a' and 'b' on line 1.
Is there any solution for this? I am open to changing the function signature if necessary.
Please note:
- I prefer not to globally disable or bypass the unused vars property in ESLint.
- I do not want to resort to using 'any' type.
- I would like to keep the types within the code to avoid inferring 'any' type.