... The confusion is with the sequence -]. Does it mean \-] or -\]] JSLint is not smart enough to figure that out. Neither are most of us. So code it like you...
841
altearius
Aug 24, 2009 2:47 pm
Can you clarify this? His opening bracket is not escaped, so if he escapes his closing bracket, won't that cause an "unterminated character class" error? It...
840
douglascrockford
douglascrock...
Aug 24, 2009 2:04 pm
... You escape it to reduce the likelihood of error or misinterpretation....
839
pauanyu
Aug 24, 2009 2:02 pm
... This is fixed now. Using @import "foo" doesn't work, but @import url("foo") does....
838
woomla
Aug 24, 2009 8:40 am
"use strict"; function t() { var name, norm; name = 'js/js-js.js'; norm = name.replace(/([\.\/-])/g, ''); return name === norm; } gives me this Error: Problem...
837
douglascrockford
douglascrock...
Aug 23, 2009 1:03 am
... JSLint now accepts the url form of @import. It will continue to reject the string form of @import....
836
pauanyu
Aug 22, 2009 1:55 pm
@charset "UTF-8"; @import 'foo'; @import url('foo39;); @import "foo"; @import url("foo"); JSLint chokes on the above....
835
pauanyu
Aug 22, 2009 1:55 pm
... It appears that cookies are now saved for ~12 days. Thanks, Douglas!...
834
pauanyu
Aug 22, 2009 1:53 pm
... Sorry, I write functional, not object-oriented, so I've never had any reason to have intentionally-unused arguments, though I can see that others might...
833
pauanyu
Aug 21, 2009 11:23 pm
... Fair enough, but your comments don't really apply to me, so I am still kindly asking for a longer-length cookie....
832
pauanyu
Aug 21, 2009 11:23 pm
... That is true, but I'm not advocating it throw an error. Simply that it would show up in the "Unused" list in the summary. I have had plenty of times where...
831
Michael Lorton
mlorton
Aug 21, 2009 11:23 pm
... do you need "b" to be the second argument? ... The otherwise always-sharp Pauanyu had a senior moment there and forgot about object-oriented programming,...
830
altearius
Aug 21, 2009 11:18 pm
I am also in favor of returning the previous functionality of the long-term cookie. Maintaining a /*jslint*/ block at the top of every JavaScript file that I...
829
jpdavenportjr
Aug 21, 2009 8:29 pm
I see the problem. There cannot be a space between "/*" and "global". Just like there cannot be one between "/*" and "jslint", if that's how I decide to...
828
inexorabletash
Aug 21, 2009 4:34 pm
... Compatibility with an existing API. For example, you're implementing a callback function and the caller provides two arguments. Admittedly, you could...
827
Dominic Mitchell
happygiraffe...
Aug 21, 2009 3:27 pm
... Ah but that's why you need to integrate it into your build system. That's why I wrote jslint4java. If you commit bad JavaScript then you break the build....
826
Arthur Blake
blakesys
Aug 21, 2009 2:24 pm
Oh, and one other good reason: The comment serves as a reminder that the file should really be checked via jslint whenever it is modified (getting other...
825
Arthur Blake
blakesys
Aug 21, 2009 2:23 pm
Just expressing my humble opinion... another few good reasons: 1. your code can be used in other JSLint environments (instead of just the web front end) and be...
824
pauanyu
Aug 21, 2009 2:17 pm
... I have to wonder... if you never use the variable "a" in your code, why do you need "b" to be the second argument? Why not write: function foo(b) { var c =...
823
pauanyu
Aug 21, 2009 2:17 pm
... Why would I want to add this to top of every one of my dozens and dozens of JavaScript, CSS, and HTML files: /*jslint white: true, onevar: true, browser:...
822
Arthur Blake
blakesys
Aug 20, 2009 3:47 pm
IMHO, even nicer and more useful than using the cookie, is simply specifying the jslintoptions at the top of your JS file! ... That way you can customize the...
821
Michael Lorton
mlorton
Aug 20, 2009 3:43 pm
... I don't think that "a" is unused -- in particular, it makes it possible for b to be declared. Consider the following: function foo(a, b) { var c = b; } ...
820
pauanyu
Aug 20, 2009 3:24 pm
Previously, the cookie JSLint used to store the settings was a rather long-lived cookie. Recently, this was changed so the cookie would expire at the end of...
819
pauanyu
Aug 20, 2009 3:23 pm
function foo(a, b) { var c; } In the above, the local variables "a" and "b" are never used, yet they are not listed as "Unused". Instead, only "c" is listed. ...
818
Paul Novitski
paul.novitski
Aug 20, 2009 7:34 am
jslint complains if I use a function before it's defined, e.g.: window.onload = initialize; function initialize() { ... } I can certainly understand why one...
817
Michael Lorton
mlorton
Aug 19, 2009 4:45 pm
The world, as they say, is a very big place. I myself almost never use NAMED functions. That is, I never do this: function f() { ... }; Sometimes, not often,...
816
Cheney, Edward A SSG ...
sandyhead25
Aug 19, 2009 4:25 pm
... I understand the need to use such functions for scope and containment, but what benefit do anonymous functions serve compared to named functions,...
815
Douglas Crockford
douglascrock...
Aug 18, 2009 11:20 pm
... Thanks. Please try it now....
814
Douglas Crockford
douglascrock...
Aug 18, 2009 10:59 pm
... So it would seem. ... /*global CMECF */ See http://www.jslint.com/lint.html#global...
813
Jacob Davenport
jpdavenportjr
Aug 18, 2009 10:45 pm
Am I crazy? I thought I could add this comment at the top: /* global CMECF window */ And then I could reference my CMECF global (analogous to the YAHOO...