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
  • 1 year ago
  • 7 minutes ago
  • 5 years ago

Installs

  • Total 147K
  • Win 70K
  • OS X 53K
  • Linux 25K
Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10
Windows 44 58 60 54 39 30 38 86 61 46 47 64 24 30 26 45 63 46 36 28 27 43 51 34 38 38 24 17 26 38 58 42 39 22 28 43 42 70 52 52 28 27 38 50 55 46
OS X 23 26 28 36 27 21 14 27 41 54 42 34 15 17 28 31 35 31 22 14 17 31 34 34 37 33 16 13 23 28 36 34 29 17 12 27 34 27 34 30 12 10 26 32 42 39
Linux 17 9 24 13 15 13 14 15 21 11 16 17 10 8 21 30 19 16 13 3 9 13 20 12 9 16 11 6 14 8 22 12 24 9 8 12 17 15 9 15 9 6 14 12 13 17

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