banner ad

Node’s Jshint for Sublime text 2

| May 13, 2013 | 0 Comments
0 Flares 0 Flares ×

Jshint is one of the best js syntax checker, another is jslint. There is the jshint for the best text editor: sublime text.

First, you should intall jshint for NodeJS, use npm

npm install -g jshint

Install JSHint with Package Control in sublime text

  1. command-shift-p or control-shift-p in Linux/Windows
  2. type install p, select Package Control: Install Package
  3. type jshint, select JSHint

Run JSHint on an active JavaScript file in Sublime Text 2

  1. control-j or alt-j in Linux/Windows or Tools/Contextual menus or the Command Palette
  2. F4 jump to next error row/column
  3. shift-F4 jump to previous error row-column

Q&A:

1.Use the function form of “use strict”

function format:

(function () {
   "use strict";
   // this function is strict...
}());

(function () {
   // but this function is sloppy...
}());

or you can use /*jslint node: true */ at top of your file 

2. ‘require’ is not defined.

use /*jslint node: true */ at top of your file

Download PDF
0 Flares Twitter 0 Facebook 0 Google+ 0 Pin It Share 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×

Tags: ,

Category: Sublime Text

About the Author ()

My name is John Link.I am 26 years old. My major is Computer science and technology. I am a junior programmer with Python.

Leave a Reply

Your email address will not be published. Required fields are marked *

0 Flares Twitter 0 Facebook 0 Google+ 0 Pin It Share 0 LinkedIn 0 Reddit 0 StumbleUpon 0 0 Flares ×