The linter will warn when it sees an expression that is typically used only for its value in a place where its value is not used. This often happens when a programmer meant to call a function but didn't.
or confused a comparison with an assignmentmyObject.myMethod;
or typedfoo == bar;
+
instead of +=
or typedoutput + part;
,
instead of ;
changing the meaning
of return statements in hard to read ways.
if (c) return 4, foo()
If you have an expression like this that legitimately has a side
effect, just put void
in front of it to tell the linter,
"I am discarding the value explicitly", so instead of
doel.parentNode.selectedIndex; // Safari HACK
The optimizer will take out the unnecessary void.void el.parentNode.selectedIndex; // Safari HACK
As always, to turn this off, put the error message name
NO_SIDE_EFFECT
in the