First, thank you for your great validation tool. Demo-JavaScript: var test = function () { var letsHaveSomeFun = {}; for (var entry in letsHaveSomeFun) { ...
2589
Douglas Crockford
douglascrock...
Sep 2, 2011 1:39 pm
... No. Declare all vars at the top of the function to avoid hoisting confusions. This is particularly import with the for statement because of the capture of...
2590
ScottJ
scottj75074
Sep 3, 2011 6:32 am
[I realize I'm late to the discussion, and I apologize if I'm reopening old wounds.] Referring to the change on June 9 that inverted the semantics of many of...
2591
Kent Davidson
kentdavidson
Sep 5, 2011 5:15 pm
Scott, What we do at my company is pull down versions of the jslint code and site and then host it internally on test web servers (e.g....
2592
Rob Richardson
erobrich@...
Sep 6, 2011 3:45 am
Kent, We do this too, but don't run it inside Selenium inside a browser. Rather we run JSLint inside cscript.exe or V8 or rhino or JScript. It makes tests ...
2593
Douglas Crockford
douglascrock...
Sep 6, 2011 5:35 pm
Silicon Valley Codecamp is a free software development conference held at Foothill College in Los Altos, California. I will be presenting there again this...
2594
ScottJ
scottj75074
Sep 6, 2011 6:41 pm
I keep a local copy of jslint too (as part of jslint_on_rails) but that doesn't solve the problem here. The issue is that one change to jslint has caused all...
2595
Kent Davidson
kentdavidson
Sep 6, 2011 7:31 pm
Sorry for misinterpreting your post. I see the issue. Is it possible to simply pre-process the legacy JavaScript before plugging it through JSLint as was...
2596
Marcos Zanona
marcos.zanona
Sep 11, 2011 5:01 pm
Hello I was wondering if it is possible to escape/disable jslint validation for a specific function inside a file like: function off() { /*jslint off*/ ... } ...
2597
Douglas Crockford
douglascrock...
Sep 16, 2011 8:12 pm
... No. Why do you want to insert crappy code into your code?...
2598
Marcos Zanona
marcos.zanona
Sep 17, 2011 4:00 pm
Well, let's say you are using some third-party plugin to implement your javascript code interaction with the website. For easier understanding left pick a...
2599
Robocoder (TM)
robocoder
Sep 18, 2011 2:12 pm
If a multi-line expression contains the ternary operator, the expected indentation level for subsequent lines has increased. http://pastebin.com/T2Prsp8s This...
2600
Xavier MONTILLET
xavierm02...
Sep 18, 2011 4:32 pm
Well JSLint sees if ( a ) { a(); } else { if ( b ) { b( ); } } And you want if ( a ) { a( ); } else if ( b ) { b( ); } It isn't better, just sees it...
2601
Jakob Kruse
thekrucible
Sep 19, 2011 6:48 am
The better solution is to concatenate files in the build phase. Same place you do minification. /Jakob ... [Non-text portions of this message have been...
2602
randy_sargent_999
randy_sargen...
Sep 19, 2011 12:26 pm
I had difficulty finding an up-to-date version of jslint.js that worked from the commandline and was easy to set up, so I wrote one myself. It's a short ruby...
2603
benxwhite
Sep 20, 2011 1:34 pm
It would be nice if there was an option to disable the "Use a named parameter" check. I have a large regular expression that I'm using to find an address in a...
2604
Douglas Crockford
douglascrock...
Sep 20, 2011 3:11 pm
... arguments will be leaving the language. Start getting used to not using it....
2605
Robert Ferney
capnregex
Sep 20, 2011 4:07 pm
'arguments39; is leaving the language? So, how do we handle functions that accept a variable number of arguments? - Robert Ferney ... [Non-text portions of this...
2606
mocthadoohay
Sep 20, 2011 5:08 pm
I've been working on a JS file for a week or so with frequent trips thru JSLint along the way. Today, I getting tons of errors that look like this: Problem at...
2607
Morgaut Alexandre Lou...
morgaut_a
Sep 20, 2011 5:29 pm
I must say I'm facing the same problem ... [Non-text portions of this message have been removed]...
2608
tom.haggie@...
tom.haggie
Sep 20, 2011 5:32 pm
Ditto...
2609
Doc Emmett Splendid
emmett.thesane
Sep 20, 2011 5:56 pm
I've been wondering what the intent is on that as well. Perhaps the new recommended best practise is to pass in a single array argument in that case? ...
2610
Phil
druid_rpg
Sep 20, 2011 6:03 pm
I just ran a chunk of code I have not touched for awhile, that was passing all of the jslint tests. This time complained about a single unexpected ' '. In my...
2611
Xavier MONTILLET
xavierm02...
Sep 20, 2011 8:47 pm
Plus arguments is the only way to determine if an argument was omitted or if it was given the value undefined. Which should react differently on functions that...
2612
Marcel Duran
marcelduran
Sep 20, 2011 9:09 pm
... function f (o) { ....if (o && typeof o.foo !== 'undefined39;) { ........// do something with o.foo ....} ....if (o && typeof o.bar !== 'undefined39; && ...
2613
Robocoder (TM)
robocoder
Sep 20, 2011 11:28 pm
Remove all trailing whitespace (tabs and/or spaces) from the ends of lines....
2614
sandyhead25
Sep 21, 2011 5:04 pm
Simple. Change the format of input to an object literal. Then you can have a variable number of named parameters. Consider the following: var args = {first:...
2615
Xavier MONTILLET
xavierm02...
Sep 21, 2011 5:22 pm
I don't get the point of removing arguments if it forces you to ask for an array as argument... ... [Non-text portions of this message have been removed]...
2616
mocthadoohay
Sep 21, 2011 5:36 pm
I'm using TextMate. Does anyone know of an automated way to remove extra whitespace from lines? It would be incredibly time consuming to do it manually. Also,...
2617
mocthadoohay
Sep 21, 2011 6:40 pm
Answering my own question: TextMate: Bundles: Text: Converting/Stripping: Remove Trailing Spaces in Document Looks like a must before running thru JSLint....