I mean to run it like this:
node.exe lint.js my_js_file.js
And then get output to a console.
What do I need to download ? Do I need just to save http://www.jslint.com/
to disk and then grab some attached js file or I need to look for special version for node.js ?
npm install jshint -g
from CMDInstall
jshint
globally then you can use it from the command line.All this is assuming that you already have
node
andnpm
running on you windows machine.Edit
I just noticed that I responded with an answer for
jshint
instead ofjslint
, the as the other answer points out, they are similar but not the same. My answer holds true for both though.For
jslint
:March's answer is for jsHint. Minor changes for jsLint, with an "L", if that's precisely what you want.
Here's a decent guide for Ubuntu. Most of it translates: http://blog.simplytestable.com/installing-jslint-for-command-line-use-on-ubuntu/
So once you've installed node, you can do the following:
Note that I borrowed the path from the Ubuntu directions for my
C:\
drive. You can put the jslint module wherever you want. Just ensure that you change the path in the jslint call, below.Now I can run jslint against any file I want using the jslint module I've installed. I downloaded jQuery development 1.11 just for fun, and saved it to
c:\temp\jquery-1.11.0.js
. So let's jslint it.Etc etc. I'm in
C:\usr\share\node-jslint
, above, but I've used the full path tojslint.js
, so I can use the same call anywhere.And you're linting.