Google releases its own Javascript Lint tool

  • Here's a couple of lines to let you use this with :make (on a single file) and the QuickFix window in Vim:

        au BufNewFile,BufRead *.js set makeprg=gjslint\ %
        au BufNewFile,BufRead *.js set errorformat=%-P-----\ FILE\ \ :\ \ %f\ -----,Line\ %l\\,\ E:%n:\ %m,%-Q,%-GFound\ %s,%-GSome\ %s,%-Gfixjsstyle%s,%-Gscript\ can\ %s,%-G
    
    If any experts in Vim's makeprg/errorformat want to clean this up, that would be awesome. I just hacked it together and it seems to work well enough.

  • The installation instructions tell you to run "easy_install http://closure-linter.googlecode.com/files/closure_linter-la.... All well and good, but install instructions that don't reference specific version numbers freak me out. I might have gotten a little too much reproducibility religion, with all that that entails, but it seems better than being so cavalier when setting up environments.

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

  • I was hoping I could run this realtime in vim, but it appears too slow on a 1000 line JS file.

  • Ouch, they shipped with a broken fixjsstyle command: http://groups.google.com/group/closure-linter-discuss/browse... Luckily it didn't break my jsfile, but that's kind of clumsy.

  • It fails on file I have thrown at it with some complexity other than jquery.