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
  • 34 minutes ago
  • 6 years ago

Installs

  • Total 165K
  • Win 79K
  • OS X 58K
  • Linux 27K
Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 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
Windows 9 36 33 46 62 53 41 59 30 44 42 52 56 70 64 40 44 43 61 55 37 61 22 40 49 50 61 53 51 32 29 50 64 42 76 76 40 36 52 56 33 56 49 34 31 39
OS X 3 18 14 18 28 24 23 22 8 8 20 27 33 32 29 20 16 28 19 24 16 20 17 17 28 22 19 40 32 7 21 21 20 27 16 31 12 11 35 33 30 41 28 27 11 22
Linux 2 2 13 17 20 20 12 14 10 9 16 20 14 10 12 9 13 12 8 12 9 12 4 15 20 22 23 18 10 10 9 28 16 9 18 11 11 5 12 10 11 19 13 9 11 13

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