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
orCmd+Shift+P
for OS X - type
install
, selectPackage Control: Install Package
- type
js gutter
, selectJSHint Gutter
Usage
Ctrl+Shift+J
or Cmd+Shift+J
for OS X
Preferences
-
Ctrl+Shift+P
orCmd+Shift+P
for OS X - type
js pref
, selectJSHint: 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
Written by Tom Fenton
Related protips
1 Response
On my PC machine, it is working with Ctrl+Alt+J ..
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Sublime-text
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#