Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know how this would differ from jslint? I couldn't find anything immediately obvious.



It gives you a different set of ridiculous warnings about things that have nothing to do with your code's correctness.

Ha ha, only serious

But for real there are many warnings that pretty plainly seem to be about enforcing somebody's preferences -- gjslint wants you to write "function()" but jslint wants you to write "function ()", for example. Enforcing conventions is good, but I'm pretty sure it's orthogonal to flagging real, common problems (in javascript land, things such missing "var" or ";")

Using both and suppressing the stupid warnings doesn't seem like a bad idea, if you can take the time to get it right.


In the example they gave, they had 9 errors. 1 was something that leads to browser incompatibility. (Trailing comma at the end of the array. IE doesn't implement the spec, Firefox does.) 1 was something that often points to logic errors. (Inconsistent indentation.) And the other 7 were someone's idea of correct style.

That said, I suspect that this lint tool will catch some issues where technically correct code can make http://code.google.com/closure/compiler/ unhappy. If you're using the Closure library, that's kind of the whole point.


Note: It would appear the coding-style assertions can be attributed to the "--strict" flag, used in the example.

YMMV, but I get the above impression from the docs (How To) -- http://code.google.com/closure/utilities/docs/linter_howto.h...


A very important difference for me is that jslint is not under a GPL-compatible license. jslint looks like open source, but isn't.

Closure Linter is under Apache v2, which is GPLv3 compatible.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: