Good morning, Your problem seems to be your insistence on declaring a function inside a function call. This is much better (from a readability perspective): ...
2758
caerusx
Jan 23, 2012 11:37 am
Hi For one liners it's better to use lambda forms. No matter how descriptive name is, better to see an actual code immediately, if it just one line. Often...
2759
Jakob Kruse
thekrucible
Jan 23, 2012 11:55 am
Hi The formatting problem you outlined had to do with how your code should be distributed over multiple lines, so it is not “just one line”. If it was just...
2760
caerusx
Jan 23, 2012 12:36 pm
Hi Very often one line function does not fit in the same line with function keyword, so it's naturally to write it as open block. Consider: ...
2761
Jakob Kruse
thekrucible
Jan 23, 2012 12:53 pm
I don’t see this going anywhere, but I’d like to point out that 1) A function call split over 3-4 lines is not a “one line function”. If you would...
2762
caerusx
Jan 23, 2012 1:52 pm
1) I agree, it is not a real problem. When I validated my code I hit just several errors of such kind for 1000+ lines of code. And I was not able to find out...
2763
Benjamin Gandon
bgandon
Jan 23, 2012 2:39 pm
Hi caerusx, hi everyone, I am new to the list too, so I'm not (yet) tired of answering the (easy) ++ question, so I'll answer. 1. I would personally say that...
2764
caerusx
Jan 23, 2012 4:00 pm
Hi Thanks for answer! It makes a sense. But '+=' operator is vulnerable to character swap typo, 'i =+ 1' is also valid javascript expression. The unary...
2765
caerusx
Jan 23, 2012 4:09 pm
Hi I rewrote all my functions declared as var to functions declared as function. (Thanks for giving me an insight that it's safe to declare nested functions)....
2766
douglascrockford
douglascrock...
Jan 27, 2012 6:48 pm
Last year I experimented with type inference in JSLint. I was not satisfied with the results of the experiment, so I am pulling all of that code out. JSLint...
2767
cse_html_validator
cse_html_val...
Jan 31, 2012 5:13 pm
... Thanks for the information on using comments before the DOCTYPE. However, it seems there is no solution to this if one decides they want or need to use...
2768
cse_html_validator
cse_html_val...
Jan 31, 2012 11:47 pm
Also, what if the comment is a server macro or something that will be processed by the server so it doesn't show up to the end user? Is JSLint useless for this...
2769
cse_html_validator
cse_html_val...
Feb 1, 2012 7:02 pm
JSLint wants CSS blocks to end in semicolons, like this: <style type="text/css"> #eid{color:navy} </style> It's perfectly OK to not have a semicolon in...
2770
douglascrockford
douglascrock...
Feb 1, 2012 7:29 pm
... I recommend that you follow JSLint's advice....
2771
Doc Emmett Splendid
emmett.thesane
Feb 1, 2012 9:46 pm
This is a difference between maintainable CSS (which should follow a very strict format) and ~minified~ CSS. Just as JSLint won't pass minified JS (which would...
2772
Sean Kelly
seank_com
Feb 1, 2012 10:12 pm
Personally, I prefer to fix my code to follow JSLint's recommendations. That said, I also put all my Javascript in .js files and include them using script tags...
2773
Rob Richardson
erobrich@...
Feb 2, 2012 12:15 am
It is less effective to lint minified or processed code as anything you discover usually can't be repaired in its current format. Also note that JSLint's CSS...
2774
mariuszn3
Feb 2, 2012 1:35 pm
Hi, I approached a whitespace issue. I have a code that it's impossible to refactor so it's ok for jslint - I can resign from checking whitespace but I don't...
2775
douglascrockford
douglascrock...
Feb 2, 2012 1:43 pm
... You may be going overboard on the function chaining thing. When you break a line after '(', JSLint expects to see an open configuration. So var...
2776
douglascrockford
douglascrock...
Feb 2, 2012 4:04 pm
Or you can break compactly before ')'. var someFunction = function () { 'use strict'; }; someFunction()(someFunction)(someFunction)(someFunction ...
2777
mariuszn3
Feb 3, 2012 7:52 am
Thanks, somehow I didn't think about writing it that way, it indeed makes sense....
2778
Jakob Kruse
thekrucible
Feb 3, 2012 11:01 am
Hi If I run the following code (properly indented) through JSLint at jslint.com with all options cleared, it validates. If I run the exact same code through...
2779
Merlin
harry152566
Feb 3, 2012 11:50 am
... I've tried linting the file t.js on both the full and minimized versions of jslint in Widget Tester. I'm not seeing the fault in either version. Using file...
2780
Jakob Kruse
thekrucible
Feb 3, 2012 1:04 pm
Ah yes. Thanks Harry. Obviously the error is partly mine. The “Bad HTML string” error seems to be caused by an internal JSLint error on an earlier run. If...
2781
Merlin
harry152566
Feb 3, 2012 2:10 pm
... Using Widget Tester: Welcome to Yahoo! Widgets 4.5.2x10A50 on 02/03/12 13:52:08.937 getJSLint:Using today's JSLint file. MD5 sum:...
2782
Jakob Kruse
thekrucible
Feb 3, 2012 2:20 pm
... In case of internal errors, yes. ... Actually, they fail in exactly the same way, but the error message given for this error by different JavaScript...
2783
Merlin
harry152566
Feb 3, 2012 2:36 pm
... Confirmed: In Chrome: Error: Problem at line 7 character 22: Cannot read property 'at' of null Over to Douglas! Harry....
2784
douglascrockford
douglascrock...
Feb 3, 2012 6:03 pm
... Thanks. Please try it now. And by the way, in case anyone has been reading this thread, function quote(s) { return '"39; + s + '"39;; } is a dangerously...
2785
Jakob Kruse
thekrucible
Feb 3, 2012 8:48 pm
Works, thanks! And yes, don’t ever use that function or anything like it. It was a bad example. /Jakob Fra: jslint_com@yahoogroups.com...
2786
douglascrockford
douglascrock...
Feb 11, 2012 12:25 am
Or you can wrap the whole thing in parens: var someFunction = function () { 'use strict'; }; (someFunction() (someFunction) (someFunction) (someFunction) ...