Travis's lame ol' blog

yay, Travis finally changed his blog!

- Monday, August 31, 2009

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

Update: 2011-05-13: JSLint WSH no longer available, see JSHint WSH.


Ever wish that Visual Studio had a JSLint add-in? Inspired by a reply to my tweet, I discovered the following solution.

  1. Grab the WSH version of JSLint.

  2. Add this jslint.bat file to the same folder you have JSLint in:

    @echo off
    cscript jslint.js //Nologo < %1
    echo.
    echo Done.
  3. In Visual Studio → Tools → External Tools…

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

    Title:
    &JSLint
    Command:
    %YourJSLintPath%\jslint.bat
    Arguments:
    $(ItemPath)
    Initial directory:
    %YourJSLintPath%\
    Use Output window
    checked

    VS: External Tools

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

  6. Select the all new JSLint from your tools menu:

    VS: Tools Menu

  7. Try not to let JSLint hurt your feelings too much:

    VS: Output From JSLint

In short, JSLint is awesome.

Archives Feed your aggregator (RSS 2.0)

<August 2009>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

Search

On this page....

Categories

Blogs

Sign In

newtelligence dasBlog 2.2.8279.16125