Give this code in TypeScript:
const res = arr.reduce((acc, cur) => (cur.id ? ++acc : acc), 0);
How do I stop the linter throwing the errors: