Movatterモバイル変換


[0]ホーム

URL:


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

Standard​Format

bybcomnesST3

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

Labelsformatting,javascript

Details

Installs

  • Total20K
  • Win9K
  • Mac8K
  • Linux4K
Jul 13Jul 12Jul 11Jul 10Jul 9Jul 8Jul 7Jul 6Jul 5Jul 4Jul 3Jul 2Jul 1Jun 30Jun 29Jun 28Jun 27Jun 26Jun 25Jun 24Jun 23Jun 22Jun 21Jun 20Jun 19Jun 18Jun 17Jun 16Jun 15Jun 14Jun 13Jun 12Jun 11Jun 10Jun 9Jun 8Jun 7Jun 6Jun 5Jun 4Jun 3Jun 2Jun 1May 31May 30
Windows000000100100110001000000000000000000000000000
Mac000000000000000000000000300000000000000000001
Linux000000000000000000000000000001000000000000000

Readme

Source
raw.​githubusercontent.​com

Standard Format

tests

A Sublime Text 3 plug-in that runsstandard –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.

Supports any tool that accepts astdin andstdout formatting API. The following tools are used by default:

standard --fixsemistandard --fix

action gif

Installation

Install Standard Format usingPackage Control.

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

Standard Format (the Sublime Text Plug-in) requires that you installstandard 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 theStandardFormat.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.
  • Anynode_modules/.bin paths found above the current file. Disable withuse_view_path
  • If your current view isn't saved to disk, any any folders in the project will be walked towards root searching fornode_modules/.bin to add to the path here. Disabled withuse_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 thatStandard Format runs against. Can expand certain pre-defined placeholders (such as{FILENAME}).

Default:

{"commands":[["standard","--stdin","--fix"],["semistandard","--stdin","--fix"]["ts-standard","--stdin","--fix","--stdin-filename","{FILENAME}"]]}
  • 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.

Project local settings

If the default/user settings isn't fined grained enough, you can set project specific settings in.sublime-project project specific settings. Seesublime project docs for more details.

{"settings":{"standard_format":{"format_on_save":true,"commands":[["eslint_d","--stdin","--fix-to-stdout"]]}}}

Hints

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

Linter

Standard Format pairs nicely with the Sublime Textstandard linter:

References


[8]ページ先頭

©2009-2025 Movatter.jp