traviblog

just some sort of lame blog

Adding An Easy Shortcut to the JSHint javascript validator to Visual Studio

I went to add JSLint to my Visual Studio tools and was disappointed that the WSH version has disappeared (or was discontinued). Luckily the new and improved JSHint supports a WSH wrapper.

  1. Grab JSHLint.

  2. In Visual Studio → Tools → External Tools…

  3. Add a new tool with the following field values:

    Title:
    &JSHint
    Command:
    %systemroot%\system32\cscript.exe
    Arguments:
    //Nologo "%YourJSHintPath%\env\wsh.js" $(ItemPath)
    Initial directory:
    "%YourJSHintPath%\"
    Use Output window
    checked

    JSHint-VSTools-Adding

  4. Open up any *.js file you'd like to validate

  5. Select the all new JSHint from your tools menu:

    JSHint-VSTools-Running

The output that JSHint provides appears to be much more useful than the old JSLint version as well.

Comments

comments powered by Disqus