Rule: forin

Requires a for ... in statement to be filtered with an if statement.

Rationale
for (let key in someObject) {
    if (someObject.hasOwnProperty(key)) {
        // code here
    }
}

Prevents accidental iteration over properties inherited from an object’s prototype. See MDN’s for...in documentation for more information about for...in loops.

Config

Not configurable.

Examples
"forin": true
Schema
null