Friday, August 22nd, 2008

WARNING: JSLint may continue to hurt your feelings

Category: JavaScript, Utility

JSLint is an old tool in the toolbox, created by Douglas Crockford. I am sure you know about it. But, do you know how often it is updated?

You may notice the “Edition 2008-08-18” on the site, which shows that it was updated recently. After being on the jslint group, I see that there are very regular updates such as the last one that I saw:

I added a onevar option. It allows only one var statement per function.

Unused variables are easier to see in the function report.

I removed support for .kon files. Scripts for Yahoo!Widgets are still supported.

I increased the amount of rigor required of HTML files. Initially, checking of HTML was minimal, just enough to locate the scripts. JSLint seems to be evolving into an HTML verifier.

I improved a lot of the checking required for ADsafe.

There are a lot of changes in this update. Please let me know if I broke anything.

It is one thing to create a tool. It is something else to keep rigour on updates. Thanks Doug!

Posted by Dion Almaer at 6:22 am
2 Comments

+++--
3.8 rating from 23 votes

2 Comments »

Comments feed TrackBack URI

It is a nice thing that Douglas updates his tool. But I find him very annoying to communicate with.

JSLint breaks down, when you use the multiline-switch trick:
/*/…/*/…/**/ — and Douglas just replied that I shouldn’t rely on silly tricks… sigh… JSLint also enforce ANSI-C legacy programming with preceding function declaration, instead of letting the programmer decide his favourite patterns…

Comment by Montago — August 22, 2008

I continue to feel like JSLint is wrong in its interpretation (in its reporting) of functions that are used via closure in special statements like setTimeout/setInterval, when using the “Module” pattern. It fails to recognize that an internal function was used if it’s only use was in such a statement call. So, the internal function that calls the setInterval doesn’t get counted as having used that “external” (or “closure”) function. Moreover, if that’s the only place that function is called in your module, then the function itself is not counted as ever having been used. I find it strange that semantics regarding module pattern usage (closure, etc) aren’t reported in the way one would expect, especially given Douglas’ own work in this exact pattern area.

Comment by shadedecho — August 22, 2008

Leave a comment

You must be logged in to post a comment.