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

JSLint

by 73rhodes ST2/ST3 Top 100

JSLint for Sublime Text 2 and 3.

Labels linting

Details

  • 2015.10.15.21.27.16
  • github.​com
  • github.​com
  • 2 years ago
  • 52 minutes ago
  • 5 years ago

Installs

  • Total 151K
  • Win 71K
  • OS X 54K
  • Linux 25K
Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10
Windows 5 15 27 42 47 53 39 44 43 25 49 58 50 56 55 22 21 45 47 61 52 45 28 25 38 45 47 44 66 19 23 47 40 64 45 38 31 23 60 50 57 49 54 22 27 55
OS X 4 10 18 25 35 29 30 20 15 17 21 28 35 39 28 15 16 28 33 26 28 30 15 18 26 35 42 33 27 11 9 31 31 33 36 29 19 20 34 40 55 34 33 12 18 33
Linux 1 8 4 16 16 12 11 11 7 8 14 13 13 10 13 6 6 17 14 10 15 18 9 4 16 17 19 12 11 4 10 5 19 11 13 9 10 10 20 17 19 11 13 10 5 19

Readme

Source
raw.​githubusercontent.​com

Sublime-JSLint

Easy JSLint for Sublime Text.

  • It has JSLint built in; requires only Node.JS installed on your system.
  • It can automatically run JSLint when you save a .js file.
  • Support for ES6: The Good Parts.
  • Now supports JSON.
  • 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. Alternatively, if you have a different jslint utility already installed on your system, you may update the settings to use it instead.

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"]
}