Getting SublimeLinter Running on Windows

Sublime Text 2 has managed to wrest me away from Komodo Edit, my code buddy of choice for a long time. I like Sublime Text 2 so much that I dropped $60 (gasp!) on it, and I haven’t dropped money on an editor in ages. It’s a fast, beautiful editor, and the plugin ecosystem is very robust.

One of my must-have plugins is SublimeLinter, which highlights lines of code the linter deems to contain (potential) errors, highlights things like TODO lines, and other goodies. It relies on node.js for a number of the base linters (JavaScript and CSS in particular). This seems to just work under Linux, but it just doesn’t under Windows. To get it up and running:

  • Install node.js. Which, by the way, is pretty darn awesome in its own right.
  • Open up Sublime Text, and close all open files.
  • Head to Preferences->Package Settings->SublimeLinter->Settings - User (it will be empty if you haven't messed with it before), and insert the following:

"javascript":"C:/Program Files (x86)/nodejs/node.exe",
"css":"C:/Program Files (x86)/nodejs/node.exe"

  • This is also where you'd put paths to, say, php for linting. Make sure you get the path to node correct - this is the default location on a Windows 7 install. Save the file, close the file, and restart Sublime Text.
  • Marvel at how bad your code is.

You can tweak down the linting options in your settings file. The default CSS linting rules in particular are set to kill. The default JS linting rules aren’t so bad.