JSLint will now providing a warning for code like this: function foo(a) { var i; for (i = 0; i < a.length; i += 1) { a[i].onclick = function (e) { alert(i); };...
When constructing a singleton in JS using an anonymous constructor, JSlint returns a "Weird construction" error. Here's the code: /*globals A*/ A = new...
Hi Although this is really a javascript (not jslint) issue, could you explain why one should make the function valus in a closure. Thanks Alan ... make...
... The common failure case was shown in the example, attaching event handlers in a loop. If the event handlers are bound to variables that are mutated by the...
When immediately invoking a function literal, parens must wrap the expression when it is used in the statement position because of an ambiguity in the grammar...
In jQuery there is the following code when throwing error in an Ajax call: function (XMLHttpRequest, textStatus, errorThrown) { // typically only one of...
Clearly that code is bad. How you fix it depends on what it is supposed to do. If you delete the line containing this; it will behave as it does now....
I do not know what *this;* is intended to do. But because this is placed in the jQuery website official documentation for Ajax, I thought it might be some kind...
Hi I would like to request for the indent level used/checked by jslint, when the whitespace option is turned on, to be made configurable, as an option. Reason:...
Hi, I started today to explore jslint. My first problem was, to figure out, which jslint I actually need/want. There's jslint from Douglas Crockford which I've...
I agree! I also modified the existing jslint, but I added an edit box so I could specify the value (so no hard-coding). But Douglas does such a good job of...
JSLint now accepts an indent parameter that allows setting the number of spaces of indentation when checking strict whitespace. The default is 4. It can be...
Hello! A few -more or less- philosophical questions regarding strict whitespace option: A) Comment: JSLint doesn't like comments within function arg...
JSLint now accepts the "use strict" declaration. This is in anticipation of the next edition of ECMAScript. Strict mode will reject many problematic features...
JSLint does not handle tabs correctly. Mostly, this does not matter, but it does matter when checking indentation. Some text editors allow tab-stops to be...
I think it would be simpler, and probably better, if jslint could "enforce" (check that is) and either-or policy: either indentation is performed using spaces...
It is a good idea when offering code to get it right! Here is a corrected version of my recent post. function detab(data, tabspace) { var i, c, col = 0, out =...
... Tabs are not just bad , they are awful. They have been a source of trouble from the early days of computers. Unless you know where the tab-stops were...
Tabs are problematic largely due to a lack of standardization. They are unnecessary, but still in significant use. JSLint now treats a tab as equivalent to the...
Hi, function myFunc() { var v1 = { option: true }; var v2 = v1.option = false; }; JSLint throws the following error messages for the above code snippet: Error:...
... You are using an assignment expression in a confusing context. Wrap it in parens to show that you are doing it intentionally. function myFunc() { var v1 =...
I tried that but now I get: Error: Problem at line 3 character 10: Parens are not needed here. var v2 = (v1.option = false); I can ignore this message but my...