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 6K
  • Win 2K
  • OS X 3K
  • Linux 1K
Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9
Windows 1 3 5 8 13 14 5 3 4 4 9 10 9 3 2 4 7 8 4 8 3 5 3 6 11 5 4 10 4 2 2 7 10 15 8 6 2 6 9 5 7 6 5 6 3 8
OS X 4 8 9 11 12 18 12 4 13 7 24 6 10 11 5 9 12 15 9 13 19 4 7 9 8 6 10 9 9 5 4 8 14 8 8 5 5 6 9 12 8 5 4 13 16 10
Linux 0 3 5 1 1 1 1 5 2 2 2 2 9 7 2 1 1 7 2 6 4 1 3 4 7 6 3 3 0 4 4 3 1 2 1 1 1 1 2 6 3 6 3 0 1 3

Readme

Source
raw.​githubusercontent.​com

Standard Format

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