04 April 2011

Installing Google's Closure Linter on Windows

I am working on a JavaScript project right now, so I decided to try out Closure Linter, Google's relatively new JavaScript code style verification tool that is part of their Closure Tools collection. I'm using Windows 7 64-bit, and their instructions for using Closure Linter on Windows do not quite make it clear what all needs to be done to get it working.

In case this is helpful to someone else in the future, here are the steps I took (modified from those found at How to Use Closure Linter):
  • Download and install Python 2.7.x for Windows 32-bit. Note that you must choose the 32-bit version of Python from the 2.7.x branch to ensure that you can use the EasyInstaller program needed for the next step.
  • Download and install SetupTools/EasyInstall for Python 2.7.
  • Install Closure Linter:
    • In a command prompt, change directory to to C:\Python27\Scripts
    • Run this command:
      easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
Now you will be able to run Closure Linter using variations on this command:
C:\Python27\Scripts\gjslint --nojsdoc -r DIRECTORY_TO_LINT

Good luck with the tool!

1 comment:

MrFaito said...

Thank you so much for this guide!, i was struggling with the documentation for this tool instalation on windows. I know it's been 4 years but i just wanted to say "thanks for writting this" you have saved one man at least.