I have included noUnusedLocals , but I have a function that simply checks for the presence of the first element, but does not use it. Is there any pragma to disable this warning for a code block?
Example:
export function has<T>(sequence: Iterable<T>): boolean { for (let element of sequence) { element; // Needed to quiet compiler setting `noUnusedLocals`. return true; } return false; }
The docs say use _ :
Declaring parameters with names starting with _ is exempt from unused parameter checking.
(see this )
But this seems to apply only to parameters , not local variables.
source share