Last Updated: February 25, 2016
·
2.83K
· tfentonz

Sublime Text JSHint Package

Sublime-JSHint is a plugin for graphically displaying lint results in ST2 and ST3.

This is a Sublime Text 2 and 3 plugin allowing you to check your JavaScript code for nasty errors, coding conventions and other goodies. It relies on JSHint, a fork of JSLint (developed by Douglas Crockford). The linter is itself written in JavaScript, so you'll need something (node.js) to interpret JavaScript code outside the browser.

Installation

First install node.js

Node with NPM

From your command line run the following command (add -g to install globally on your system):

npm install jshint

Through Sublime Package Manager

  • Ctrl+Shift+P or Cmd+Shift+P for OS X
  • type install, select Package Control: Install Package
  • type js gutter, select JSHint Gutter

Usage

Ctrl+Shift+J or Cmd+Shift+J for OS X

Preferences

  • Ctrl+Shift+P or Cmd+Shift+P for OS X
  • type js pref, select JSHint: Select Hinting Preferences

My preferences

{
  // Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
  // Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
  // Documentation: http://www.jshint.com/docs/
  "browser": true,
  "esnext": true,
  "devel": true,
  "globals": {
    "Ext": false
  },
  "globalstrict": false,
  "indent": 2,
  "jquery": false,
  "quotmark": true,
  "smarttabs": true,
  "trailing": true,
  "undef": true,
  "unused": "vars"
}

I have added "Ext": false to globals for ExtJS use.

External links

1 Response
Add your response

On my PC machine, it is working with Ctrl+Alt+J ..

over 1 year ago ·