scottohara/tvmanager — Issue #22: Unable to suppress JSlint "move all 'var' declarations to top" warnings
Author: scottohara
Created: 2011-11-25 01:42:57+00:00
State: open
Labels: Waiting

Crockford has added a JSlint check that requires all var declarations inside a for loop to be declared first (to guard against variable hoisting).

Unfortunately, there's no option to tolerate these issues (ie. suppress the warnings) yet.

Instead of this:
for (var i = 0; i < something; i++)

he now wants:
var i;
for (i = 0; i < something, i++)

Presumably this is to make it clear that "i" is not scoped to the for block only (ie. it's accessible after the for loop has finished)