How to add SublimeLinter and JSHint to Sublime Text

In this short video you will learn how to add SublimeLinter and JSHint to the extremely popular Sublime Text editor.

One of the tools essential for enforcing good JavaScript code habits is JSHint.  JSHint is a forked version of JSLint originally created by Douglas Crockford. As Crockford once said at a Google Tech Talk that JSLint “will hurt your feelings”.  Where JSHint varies from JSLint is that it is both community supported and allows for customizations and disabling features.  It can be configured to be slightly less picky when evaluating your code.

Setting up JSHint in Sublime Text is simple but does require a few steps.

1. Installing Sublime Text Package Manager

Chances are if you have been using Sublime Text for any amount of time you are already familiar with the Package Manager.  If not head on over to packagecontrol.io and follow the simple instructions for installing it in your particular version of Sublime Text.

2. Installing SublimeLinter 3

SublimeLinter is a plugin for Sublime Text that provides linters for various programming languages including Python, JavaScript, CSS, and Ruby.  A linter is basically a plugin within your code editor that notifies you of stylistic or programming errors.  If you read the documentation it states that “SublimeLinter itself is only a framework for linters.  The linters are distributed as independent Sublime Text 3 plugins.”

To install this package in Sublime Text use the shortcut Command+Shift+P to open the “Command Palette” and type in Package Control:Install Package.  Next type in SublimeLinter and click to install.

3. Installing SublimeLinter-jshint

Now that the framework is installed you will need to install the specific linter you are interested in. In this example we will be using JSHint.  Again open the Command Palette and install the package SublimeLinter-jshint.

4. Installing Node.js and SublimeLinter-jshint

SublimeLinter-jshint requires Node.js.  Installing Node is extremely easy, just head over to nodejs.org/download/  and download the pre-built installer for your OS.

Once that is done your last step is to fire up your trusty terminal and enter:

That’s it! You are now free to be harassed by your linter of choice.

Like to leave a comment on this video?

Comments have been automatically closed on this post but don't let that stop you. Head on over to this videos YouTube page and let your voice be heard!

6 comments

    1. Hi Behzad, Yes, in SublimeText’s console type “install” first, then after that type “SublimeLinter-jshint”. Watch the video at the top of the page at the point 2:00. Hope that helps.

Comments are closed.