Add Jslint Checking To Visual Studio

Using the jsLint tools I provided in my previous post you can add simple checking of an active file within Visual Studio. It also allows you to double click on an issue and go to the corresponding line. Here's a step by step guide.

Choose External Tools from the Tools menu

tools menu - external tools

 

Click Add and enter the values given in the example below just replacing the command path to point to where you downloaded the example files from the previous post. Ticking Use Output window will make the commandline output show in the Visual Studio output window.

add external tool dialog

You should now have a new command available to you from theTools menu called jsLint current file. Open the JavaScript file you want to validate and run this command.

run the test

The results will be sent to the Output window.

jslint output

You can double click on any result and Visual Studio will send you to the offending line.

click and go to line

The final thing you might need to to is add a comment to your JavaScript file to specify any global or predefined variables. You can do this by adding the variables in to a comma separated list like so:

/*global juxtapo,window,console */

Hope this helps

Work with me

Dave is a cohesive team member, widely popular with his colleagues and always inspiring quality, exploration and innovation. One of the true ‘greats’ we’ve had the pleasure to work with

I believe in community, in inspiration and creativity. I believe it's an inspired team and a laser focus on the user's experiece that will produce the best results. I want to help frontend teams live inspired, be productive and scale better.