JSLint (with the onevar flag turned on) is flagging some javascript code that I have with the following:
Problem at line 5 character 15: Too many var statements.
The reasoning is already described.
Recommendation is to use this form:
var myVar1 = document.getElementById("myDiv1"),
myVar2 = document.getElementById("myDiv2");
or this:
var myVar1, myVar2;
myVar1 = document.getElementById("myDiv1");
myVar2 = document.getElementById("myDiv2");
But this doesn't look very nice, especially if you want to document vars.
So you can just disable this warning temporarly:
/*jslint vars: true*/
/**
* @returns {HTMLDivElement}
*/
var myVar1 = document.getElementById("myDiv1");
/**
* @returns {HTMLDivElement}
*/
var myVar2 = document.getElementById("myDiv2");
/*jslint vars: false*/
Warning: make sure that this is done at the top of a function.
I think this is done because jslint couldn't reliably determine if vars were declared at the top of function or not.