ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

JSLint

by darrenderidder ST2/ST3 Top 100

JSLint for Sublime Text 2 and 3.

Labels linting

Details

Installs

  • Total 68K
  • Win 31K
  • OS X 26K
  • Linux 11K
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 20 30 99 81 62 91 65 32 24 69 103 100 101 61 47 47 65 71 77 81 88 47 46 89 80 98 86 90 41 33 105 98 64 81 86 37 53 81 86 100 70 71 41 46 81 90
OS X 17 40 65 73 75 80 68 32 37 66 66 83 75 48 39 38 83 70 76 69 57 30 25 62 56 69 81 63 35 37 56 50 61 70 65 40 47 62 71 80 69 72 27 33 55 98
Linux 6 18 48 22 32 25 29 15 15 26 29 30 26 30 6 16 18 34 22 48 35 14 22 38 34 22 35 37 20 18 26 25 30 22 31 22 17 33 30 28 24 30 24 16 23 35

Readme

Source
raw.​githubusercontent.​com

Sublime-JSLint

Fast and easy JSLint build system for Sublime Text and Node.JS.

  • Does not require Java™.
  • It has jslint built in; only needs Node.JS installed on your system.
  • It can automatically run JSLint whenever you save a file.
  • Fully configurable linting options.
  • Jump to errors using F4 / Shift+F4.
  • Works on Linux, MacOS and Windows.

Prerequisites

NodeJS must be installed on your system and you must be able to run 'node' from the command line.

Installation

Using Package Control:

  • Install the Package Control plugin if you don't have it
  • Press Ctrl+Shift+P to bring up the Command Palette (or use Tools > Command Palette menu)
  • Select Package Control: Install Package
  • Type 'JSLint' to find JSLint (with node) for Sublime Text 2
  • Select 'JSLint (with node) for Sublime Text 2' to install

Not using Package Control:

  • Get files from the package archive
  • unzip to Packages/JSLint directory (use “2” or “3” depending on which version you have):
    • Linux: ~/.config/sublime-text-2/Packages/JSLint
    • Mac: ~/Library/Application Support/Sublime Text 2/Packages/JSLint
    • Windows: %APPDATA%/Sublime Text 2/Packages/JSLint
  • Relaunch Sublime Text

Usage

Any of the following will work:

  • Bring up the Command Palette (Command+Shift+P on OS X, Control+Shift+P on Linux/Windows), then type JSLint.
  • Click the Tools > JSLint menu entry.
  • Press CTRL+L.
  • Just save a .js file.

Settings

  • Navigate to Preferences > Package Settings > JSLint > Settings - Default.
  • To preserve custom settings:
    • copy default settings to Preferences > Package Settings > JSLint > Settings - User
    • modify them to your requirements

Troubleshooting

“No such file or directory” when saving

When, on saving a .js file, you get this:

[Errno 2] No such file or directory
[cmd:  [u'node', ...]]

the command to run node might not be in your path.

Mac OS X users, ensure that /usr/local/bin is in your $PATH environment variable.

Linux users, if your node command is 'nodejs', as is the case when installing from some Linux repos,
navigate to Preferences > Package Settings > JSLint > Settings - User to change it, e.g.

{
   "jslint": ["nodejs", "~/.config/sublime-text-2/Packages/JSLint/linter.js"]
}