Setting up jsLint in VS
So if you work with javascript in your .Net development then you will know that VS is not the best when it comes to error checking js , thankfully though jsLint exists to make your life easier. But wouldn’t it be even easier if you could embed this in VS ?
Using the following steps you can embed it in Visual studio , not only is it a lot faster but a lot more easily customizable.
- Download the jsLint exe from http://www.javascriptlint.com/download.htm
- Extract the files to a public folder on your machine , e.g. The Documents Library , this is required since the default download folder will require you to run the app as admin. 9Note this is applicable only to Vista /Win7)
- In visual studio Add a new External Tool as follows
- In the Command Text box enter the complete path to the jsl.exe , in the arguments Text box enter ( -process $(ItemPath) ).
- Click ok to save the new tool , at this point you can add it to any toolbar using the toolbar customize option or can just assign it a shortcut combo
2 Things to note are the following , the app will only check your currently open and selected file using the ItemPath var and finally you can customize what kind of errors you want to be alerted about and the alert format in the .conf file that is included in the zip file.
If you want to do soloution/project wide checking then you will need to create a batchfile that loops through each file checking for errors. Hopefully this will be my next post.
Let me know if I haven’t explained anything clearly enough.
Thanks
~Stalkerh







