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

Js​Validate

by duereg ST2/ST3

Validate the syntax of any JavaScript file in Sublime Text using Esprima

Details

Installs

  • Total 8K
  • Win 4K
  • OS X 2K
  • Linux 1K
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 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
Windows 0 1 1 6 5 4 0 3 2 2 2 3 2 5 4 2 0 5 6 4 3 1 3 2 1 2 3 5 2 1 4 3 6 4 6 5 0 2 0 6 5 2 1 3 0 3
OS X 2 0 1 2 1 2 0 1 0 0 1 4 1 0 2 0 0 0 1 3 1 2 0 0 1 3 2 0 1 0 2 3 1 5 1 2 1 0 6 2 3 1 0 1 0 1
Linux 0 1 0 0 3 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 2 2 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 2 0 1 0 0 0 2

Readme

Source
raw.​githubusercontent.​com

JsValidate for Sublime Text

Check your JavaScript for syntax errors: Esprima with everyone's favorite text editor: Sublime Text

Prerequisites: EsValidate and Sublime Package Control

Mac OS X: Installing node with homebrew or macports is assumed. The path to esvalidate is hardcoded in this plugin as /usr/local/share/npm/bin:/usr/local/bin:/opt/local/bin. There is no reliable way to get the path from your environment.

Linux: Make sure esvalidate is in your environment path.

Windows: Installing node with the Windows Installer from nodejs.org is assumed.

Install esvalidate with npm

npm install -g esvalidate

Install JsValidate with Package Control in Sublime Text

  1. command-shift-P or control-shift-P in Linux/Windows*
  2. type install p, select Package Control: Install Package
  3. type JsValidate, select JsValidate

Note: Without Sublime Package Control, you could manually copy this project to your Packages directory as 'JsValidate'.

Run JsValidate on an active JavaScript file in Sublime Text

  • control-shift-V or Tools/Contextual menus or the Command Palette
  • F4 jump to next error row/column
  • shift-F4 jump to previous error row-column

Settings

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

Run JsValidate on save

By default, JsValidate does not run on save. To change, simply change the setting run_on_save for the project to true.

Error: unknown report format sublime.

Seeing this error means you are using an outdated version of EsValidate. Update to the latest version and this error should go away.

Blog Posts

I wrote some blog posts about creating this plugin and the esvalidate library here.