rloomans/new-teamtemp

View on GitHub

Showing 506 of 528 total issues

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
Open

        for ( prefix in a ) {
Severity: Minor
Found in teamtemp/static/jquery-3.6.3.js by eslint

Require Guarding for-in (guard-for-in)

Looping over objects with a for in loop will include properties that are inherited through the prototype chain. This behavior can lead to unexpected items in your for loop.

for (key in foo) {
    doSomething(key);
}

Note that simply checking foo.hasOwnProperty(key) is likely to cause an error in some cases; see [no-prototype-builtins](no-prototype-builtins.md).

Rule Details

This rule is aimed at preventing unexpected behavior that could arise from using a for in loop without filtering the results in the loop. As such, it will warn when for in loops do not filter their results with an if statement.

Examples of incorrect code for this rule:

/*eslint guard-for-in: "error"*/

for (key in foo) {
    doSomething(key);
}

Examples of correct code for this rule:

/*eslint guard-for-in: "error"*/

for (key in foo) {
    if (Object.prototype.hasOwnProperty.call(foo, key)) {
        doSomething(key);
    }
    if ({}.hasOwnProperty.call(foo, key)) {
        doSomething(key);
    }
}

Related Rules

  • [no-prototype-builtins](no-prototype-builtins.md)

Further Reading

TODO found
Open

                # TODO can it recalculate the average here for adhoc filtering
Severity: Minor
Found in teamtemp/views.py by fixme

TODO found
Open

                        // TODO: identify versions
Severity: Minor
Found in teamtemp/static/jquery-3.6.3.js by fixme

TODO found
Open

//    4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
Severity: Minor
Found in teamtemp/static/jquery-3.6.3.js by fixme

TODO found
Open

    // TODO: Now that all calls to _data and _removeData have been replaced
Severity: Minor
Found in teamtemp/static/jquery-3.6.3.js by fixme

TODO found
Open

                            // TODO: identify versions
Severity: Minor
Found in teamtemp/static/jquery-3.6.3.js by fixme
Severity
Category
Status
Source
Language