Skip to search.
jslint_com · JSLint.com

Group Information

  • Members: 502
  • Category: JavaScript
  • Founded: Mar 7, 2008
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

  Messages Help
Advanced
New Edition   Message List  
Reply Message #1730 of 2891 |
I started working on JSLint 10 years ago. It started as a demonstration of a
parsing technique [http://javascript.crockford.com/tdop/tdop.html]. I intended
to then create a JavaScript engine with the compiler and other components
written in JavaScript, but the language contained so many design errors that I
could not bring myself to replicate them all.

So instead I turned the parser into a code quality tool. I thought that
syntactic analysis would be sufficient, so I pulled out the code that created
the parse tree on the theory that that would make it faster. Such thinking is
almost always wrong, as it was indeed in this case. There was no noticeable
performance improvement, and I later discovered that a tree could make JSLint
even more useful.

So I have put the tree back in. You can see the tree by clicking on the [Tree]
button. It displays the tree that was produced by the most recent [JSLint] run.
I plan to completely change the way JSLint handles line breaking and indentation
using that tree. Someday I might also use the tree to write JSMax, the inverse
of JSMin.

So at the moment, JSLint does not consider indentation or line breakage. That
will come later. The only breakage that is checked currently are the cases that
are required because of the dreaded semicolon insertion. Breaking with style is
a surprisingly difficult problem.

Three options are dropped from the new edition. option.immed and option.eqeqeq
are now always on. There have proved to be very good practices, so continuing to
make them optional is not ultimately beneficial. option.lax is no longer needed.

JSLint is now smarter about code paths, so

switch (exp) {
case 1:
if (blah) {
return null;
} else {
return undefined;
}
case 2:
x = 0;
break;

does not require a break for case 1, but it does require a break for case 2. It
is now better able to detect strange loops and other convolutions.

This is a big change. All of my code looks good on the new edition, but I
haven't tested with yours. If I broke something, please report it. Thank you.





Sat Jan 8, 2011 12:17 am

douglascrock...
Offline Offline
Send Email Send Email

Message #1730 of 2891 |
Expand Messages Author Sort by Date

I started working on JSLint 10 years ago. It started as a demonstration of a parsing technique [http://javascript.crockford.com/tdop/tdop.html]. I intended to...
Douglas Crockford
douglascrock... Offline Send Email
Jan 8, 2011
12:17 am

On Sat, Jan 8, 2011 at 1:17 AM, Douglas Crockford ... In fact that's a very good omission. The last version would report that the following code is not...
Felix E. Klee
feklee Offline Send Email
Jan 8, 2011
3:14 pm

... I'm aware of two beautifiers: JSBeautifier.org and jsutility.pjoneil.net Your style looks like the style pjoneil uses....
aceblchboy Offline Send Email Jan 9, 2011
8:21 am

There's a new version of my Yahoo! Widget Tester Widget with JSLint Edition 2011-01-06 at http://tinyurl.com/5unocx . It's also been submitted as an update to...
Merlin
harry152566 Offline Send Email
Jan 8, 2011
4:30 pm

I think it is a shame to loose the eqeqeq option : We have inherited an extremely large JS codebase. On all new code we use eqeqeq, but old code we do not...
Luke Page
page.luke... Offline Send Email
Jan 9, 2011
12:23 pm

Removing the eqeqeq and immed option prevents me from being able to use things such as: var ie = "\v"=="v"; per http://ajaxian.com/archives/ievv as well as a...
Jordan
ljharb Offline Send Email
Jan 10, 2011
4:49 pm

... Clearly code quality is not important to you, or you would not be demanding your right to write incompetent crap....
Douglas Crockford
douglascrock... Offline Send Email
Jan 10, 2011
7:19 pm

I didn't write this code, and would certainly prefer a better solution if you have one in mind. In addition I did not demand anything, I simply requested a...
Jordan
ljharb Offline Send Email
Jan 11, 2011
10:36 pm

... Put the code into a separate file that you don't run through JSLint....
Felix E. Klee
feklee Offline Send Email
Jan 11, 2011
10:53 pm

That is indeed a good suggestion, but that doesn't prevent the file concatenation problem, nor does it invalidate my request for all configuration options to...
Jordan
ljharb Offline Send Email
Jan 11, 2011
11:27 pm

... What do you mean by that?...
Felix E. Klee
feklee Offline Send Email
Jan 11, 2011
11:36 pm

I believe that Mr. Crockford would say something to this effect in response. "Your sadly pathetic bleatings are harshing my mellow." - Douglas Crockford as he...
abyssoft@...
abyssoft... Offline Send Email
Jan 14, 2011
10:57 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help