I suggest to pilot the indentation as jslint option: For instance, /*jslint indent: 2 */ If I lint source files with different code styling, I can write the ...
376
Douglas Crockford
douglascrock...
Feb 11, 2009 9:45 pm
Anticipating the next edition of ECMAScript, JSLint now allows the useExtension suffix on the use strict directive. It also allows the use strict directive as...
377
gregraven@...
gregraven...
Feb 17, 2009 3:26 pm
I think it would be great if the JSLint Yahoo! Widget had the clear, recommended, and good parts selectors found on jslint.com. It would save a bit of time and...
378
Jakob Kruse
thekrucible
Feb 17, 2009 3:44 pm
Please have a look at the "JSLint Multi" widget available here: http://code.google.com/p/jslint-multi-widget/ It doesn't have quite what you ask, but it does...
379
Douglas Crockford
douglascrock...
Feb 17, 2009 4:56 pm
... Now that there is the Multi Widget, I am not going to maintain the original widget....
380
Merlin
harry152566
Feb 17, 2009 5:53 pm
... Very nice Widget. It is, however, possible to have a better arrangement of the JSLint option panes. See my Widget Tester Widget at...
381
Jakob Kruse
thekrucible
Feb 17, 2009 6:22 pm
... Good ... option panes. ... options and to set ... Macintosh. ... the last (two?) lines ... turn red. ... Unfortunately, none of the developers on the...
382
gregraven@...
gregraven...
Feb 18, 2009 2:07 pm
... Pity. I MUCH prefer the way your original version works....
383
bertbelder
Mar 4, 2009 8:48 pm
It seems that using a variable named "constructor" that is not declared (which in itself is wrong off course) always produces a strange error. The rhino...
385
bertbelder
Mar 4, 2009 9:11 pm
It would be cool if it were possible to surpress warnings/errors that originate form a certain line. For example, occasionaly I conciously use an unfiltered...
386
Douglas Crockford
douglascrock...
Mar 4, 2009 9:14 pm
... Thanks for the report. Please try it again....
387
bertbelder
Mar 4, 2009 9:26 pm
Wow! I've never had a response to a bug report that quickly, ever. It's fixed indeed. Thanks. -Bert...
388
Noah Peters
boyopeg
Mar 5, 2009 1:38 am
Try this: var o = {test: 4}; /*jslint forin: false*/ for (k in o) { alert(k); } /*jslint forin: true*/ ... -- We know the hard things are possible, we just...
389
santini.alberto
Mar 5, 2009 8:17 pm
... Linted on itself: Error: Problem at line 180 character 1: Expected an assignment or function call and instead saw an expression. "use strict"; Problem at...
390
zoney70
Mar 6, 2009 6:37 pm
I find the requirement for using braces excessively anal in such if compounds as: if (/*expression*/) {/*single statement*/} else {/*single statement*/} Is...
391
Douglas Crockford
douglascrock...
Mar 6, 2009 6:44 pm
... My advice is that you get used to it. For the cost of two characters, your code will be less error prone. That is a really good tradeoff....
392
Michael Lorton
mlorton
Mar 6, 2009 6:47 pm
True that! Most C-like languages allow the brace-less consequent, but it's evil! Evil, I say! Seriously, it's difficult to read and error-prone. M. ...
393
James Clark
sbj@...
Mar 6, 2009 7:00 pm
... Another option is to just add the feature to your own copy of fulljslint.js. I did this for just this scenario. Add a 'braces39; option, then add a boolean...
394
zoney70
Mar 6, 2009 7:09 pm
... it's evil! Evil, I say! ... it's evil! Evil, I say! ... Seriously, having lived on the planet for seven decades and programmed for nearly five of them, I...
395
zoney70
Mar 6, 2009 7:15 pm
Are there any (Windows platform) javascript-aware editors (syntax highlighting) out there that auto-format for jslint (such as proper indenting, automatic...
396
santini.alberto
Mar 6, 2009 8:45 pm
... I know the following editors/ide doing that: emacs, vi, scite, aptana studio. Regards, Alberto...
397
Stoyan Stefanov
ssttoobg
Mar 7, 2009 12:53 am
One possible pitfall is if by any chance you pass something that is not an integer to the Array constructor new Array(3) is like [undefined, undefined,...
398
Douglas Crockford
douglascrock...
Mar 7, 2009 2:43 pm
... The eval exclusion was for the benefit of JSONT and json2. They represent uses of eval that are beneficial. I have no excuse for the line breaking option....
399
Douglas Crockford
douglascrock...
Mar 10, 2009 8:09 pm
A robust coding style demands that symbols should be declared before they are used. But how is this possible in the case of mutually recursive functions? If...
400
Alexandre Morgaut
morgaut_a
Mar 11, 2009 1:17 pm
With the difference that in the first way the function b is declared in the scope of function a Whereas in the second way function a and b are in the same...
401
Jakob Kruse
thekrucible
Mar 11, 2009 1:29 pm
The way I read this, in the first example the function ‘b’ is recreated (which would take time) every time ‘a’ is called. Strictly speaking you would...
402
Alexandre Morgaut
morgaut_a
Mar 11, 2009 2:00 pm
I agree with you Jakob For myself I may have declared the function with an empty function var a = function() {}; So that : - a validator which would check then...
403
bertbelder
Mar 13, 2009 2:43 am
Thank's, I didn't realize that it was possible to set jslint options for a part of the file. However, there are still warnings I'd like to suprpress sometimes...
404
Douglas Crockford
douglascrock...
Mar 13, 2009 8:20 pm
... I think it is better to fix your code than to document that it is intentionally faulty....
405
Fred Lorrain
grumelo68
Mar 23, 2009 3:08 pm
If I have such kind of code try { something } catch (e) {} Means I don't care about e, I will not use it. Unfortunately I have to write catch(e) because catch...