JSLint applies a number of restrictions (some of which can be switched off) in order to promote good and safe programming. Visit Douglas Crockford's excellent website for an explanations of the reasons for these restrictions.
@jslintquestion (albeit rather belatedly, but this may help others in future): Because of the automatic global nature of Javascript, "with" is a very fragile syntax to use.
Take for example, the following piece of code (which can be put at any scope depth with the same results):
var myobj = { name: "Tony" };
with (myobj) {
name = "Bob";
last = "Zmuda";
}
By reading it, you'd think that, logically, not only is myobj.name === "Bob", …but also myobj.last is "Zmuda", right? Incorrect. Instead, you've just created (or possibly clobbered) a global variable named "last", accessible directly or via "window.last".
So, if you were to write another tiny program that did the exact same thing as the above with statement, it'd look something like this (in the global scope, thus the script tags):
var myobj = { name: Tony };
myobj.name = "Bob";
last = "Zmuda";More