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

Standard​Format

by bcomnes ST3

:sparkles: Runs standard --fix against the javascript in your ST3 window on save or manually.

Details

Installs

  • Total 9K
  • Win 3K
  • OS X 4K
  • Linux 2K
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 Sep 7 Sep 6 Sep 5
Windows 5 8 10 10 11 6 4 5 11 5 10 10 12 4 8 5 10 5 6 2 9 6 6 10 7 8 4 6 7 14 12 12 9 10 8 12 16 16 6 4 2 2 4 9 8 8
OS X 5 9 7 5 11 4 4 7 10 4 5 7 6 4 7 5 11 6 5 5 10 9 4 13 8 9 4 7 9 10 11 7 11 7 6 19 22 25 6 7 2 5 3 8 8 10
Linux 2 6 6 10 2 2 1 4 4 2 4 9 2 3 4 3 8 4 2 2 1 3 5 5 3 3 4 0 5 3 2 11 4 3 2 5 9 5 3 6 3 1 2 2 5 6

Readme

Source
raw.​githubusercontent.​com

Standard Format

Build Status

A Sublime Text 3 plug-in that runs standard –fix against the javascript code in your ST3 window on save or manually. Can be toggled on or off. Includes a few settings that let you tweak your search path to favor local dependencies over global ones.

action gif

Installation

Install Standard Format using Package Control.

# In the command palate
- package control install
- standard format

Standard Format (the Sublime Text Plug-in) requires that you install standard either locally to your project or globally. It is recomended to save it to your local project.

$ npm install standard@latest --save-dev

Configuration

You can find Standard Format settings in the StandardFormat.sublime-settings file.

Standard Format is agressive about finding your developer dependencies. The search path that it uses by default are in the following order:

  • User added paths: you can add an array of paths in your settings file. You shouldn't need to do this unless you are doing something weird.
  • Any node_modules/.bin paths found above the current file. Disable with use_view_path
  • If your current view isn't saved to disk, any any folders in the project will be walked towards root searching for node_modules/.bin to add to the path here. Disabled with use_project_path_fallback.
  • The global user path is then used if nothing else is found. This is calculated by starting a bash instance and calculating the real user path, including .nvm shims.

Other settings:

  • format_on_save: Boolean. Runs Standard Format on save when set to true. Use the command pallet to quickly toggle this on or off.
  • extensions: String Array. An array of file extensions that you want to be able to run Standard Format against.

  • command: Optional String Array. Customize the command and flags that Standard Format runs against.

  • loud_error: Boolean. Specifies if you get a status bar message or error window if the subprocess encounters an error while formatting.

  • log_errors: Boolean. Lets you log out errors encountered by the formatter. Mainly used to suppress noisy formatting errors.

Hints

Windows is now supported. Please open any issues that you come across.

Linter

Standard Format pairs nicely with the Sublime Text standard linter:

References