79671676

Date: 2025-06-19 07:38:16
Score: 0.5
Natty:
Report link

How to fix or silence it properly

You have a few options:


1. Use _ as a throwaway variable (common convention)

forawait (const _ of asyncIterable);

Most ESLint configurations will allow _ to be unused (it's a convention for "I don't care about this value").


2. Use an empty block (without even declaring a variable)

Unfortunately, this is not valid syntax in JavaScript

So you must declare a variable, even if unused.


3. Disable ESLint for that line

If you don't want to rename the variable


4. Use .forEach()-like utility instead (if available)

If the library (e.g. ixjs) provides a forEach method, you can do:

await asyncIterable.forEach(() => {});

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): How to fix
  • Low reputation (1):
Posted by: Rohit Singh