Many languages allow a convenience in scripting that allows an && to be used as flow control. var foo = [1,2,3,4]; foo[0] && fop = foo.shift(); //assigns the...
Many browsers barf when an object key is a reserved word. Sure, they should be able to figure out that we are in an object.... But IE can't.Example: var foop...
Hi, checking this HTML fails because of the + in type: <link rel="alternate" type="application/rss+xml" title="" href="" /> (same with atom+xml) Without, the...
Hi everybody, I was wondering how to define my root namespace in "strict format" Normally i use the following code: /*global YAHOO, MYNS */ if (!this.MYNS) { ...
Here is a lisp procedure that simply adds 'a' to the absolute value of 'b': (define (a-plus-abs-b a b) ((if (> b 0) + -) a b)) I think this is beautiful, and I...
The code snippet below doesn't give any errors or warnings. But return with and without a value is used. Shouldn't that at least issue a warning? "use strict";...
I wish JSLint had an option that would allow code like this: if (!someVariable) return; I understand the danger of allowing code without braces like: if...
Not a JSLint question, but I know there are really knowledgeable JavaScript developers on this list ... Why can't I add methods to the prototype of the...
When I don't actually need the object instance, I enclose my "new Xxxx()" statements in parenthesis to keep JSLint happy and I assumed some JavaScript...
I have already defined YAHOO and YUI as accepted global variables but JSLint still warns me that "type is unnecessary" in <script> tags. I've seen the messages...
jslint doesn't expect to see new String, but I need it because I want to set a property of the string: var str = new String('somestring39;); str.id = 123; Or is...
Hi, In the code snippet below, b will always be 'is TRUE'. Clearly the intention was that b should be 'a is FALSE'. No javascript error but the result is...
I frequently find that I must convert non-objects into objects. Consider, for example, a function that expects one of it's arguments to be an object. If you...
I am trying to run JSLint from the command line but it stops after displaying the first warning, even if I turn it of by specifying /*jslint passfail: false */...
I am checking if a variable is defined or not, if it is not defined explicitly I am going to define it by doing: if ( typeof(aVariable) == 'undefined39; ) { var...
I have added a new option: [ ] Require Initial Caps for constructors (option.newcap) I highly recommend that you always turn this option on. If you call a...
I've been running a JSlint checking Web service for a year or two over here: http://jslint.webvm.net/mylintrun.js However when I use it, I always get the last...
I see there is an option to allow HTML to contain a fragment instead of a full document. I know how to specify JSLint options in a comment at the top of a...
In JavaScript: A Survey of the Language, you wrote: !! can be used as a prefix operator, converting its operand to a boolean. but JSLint says: Confusing use of...
Using JSLint with emacs and flymake-mode to provide near-live code annotation with lint results has been well documented for a while over on EmacsWiki. It's...
I noticed that JSLint does not detect a problem with HTML ID attributes that begin with a numeral. I ran into a problem the other day where YUI3 was doing...
Hi, A developer in my team is using the CSS code: z-index:+1; to increment the z-index of an element by one. This fails the JSLint validator, I cannot seem to...
I put together a Ruby gem driver for JSLint called jslintrb. It's a small shim around the Ruby Johnson gem, which is a bridge between Ruby and SpiderMonkey,...
Methinks the time spent on the ASCII calligraphic title alone should be worth something... Fine work on the rest as well :) Peace, Dan [Non-text portions of...
I normally don't use with: never in production code. The one case I do like it is in test drivers. I have a test object which has a lot of methods (BDD:...