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
  • 2 hours ago
  • 5 years ago

Installs

  • Total 157K
  • Win 75K
  • OS X 56K
  • Linux 26K
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 12 64 70 55 25 29 57 64 70 49 48 41 34 39 57 49 49 55 37 22 61 61 65 53 60 39 38 57 55 56 52 41 26 33 46 46 54 64 49 16 23 44 60 60 56 62
OS X 7 38 29 21 14 12 33 30 34 34 28 8 14 30 35 32 35 30 12 15 28 31 39 39 26 15 16 27 26 30 30 33 12 18 17 32 26 23 23 12 18 31 18 31 34 22
Linux 2 11 22 25 14 19 12 19 15 14 17 5 5 29 11 21 12 22 3 9 21 15 26 15 18 7 10 14 18 17 6 10 9 9 10 15 16 14 16 7 11 18 13 17 22 18

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