JSHint any JavaScript file in Sublime Text 2
The best JavaScript syntax checker: JSHint for the best text editor: Sublime Text
Prerequisites: jshint and Sublime Package Control
Mac OS X: Installing node with homebrew or macports is assumed. Use SublimeFixMacPath for setting the correct OS X path. Supports nvm - Node Version Manager
Linux: Make sure jshint is in your environment path.
Windows: Installing node with the Windows Installer from nodejs.org is assumed.
npm install -g jshint
Note: JSHint will use the first .jshintrc file found traversing from the active file in Sublime Text up to your project's root.
command-
shift-
por
control-
shift-
pin Linux/Windows
install p, select
Package Control: Install Package
jshint, select
JSHint
Note: Without Sublime Package Control, you could manually clone to Packages directory as 'JSHint', exactly.
control-
jor
alt-
jin Linux/Windows or Tools/Contextual menus or the Command Palette
F4jump to next error row/column
shift-
F4jump to previous error row-column
Note: The
control-
j/
alt-
jshortcut changes the Build System on the current file to JSHint, then Builds to run JSHint on the file and output any errors for jumping to within the file. You could alternatively set the Build System to Automatic and
command-
b/
control-
b/
F7, but only on files that end with .js.
Install SublimeOnSaveBuild