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

Prettierd Format

by Simone Mastromattei ST3 Trending

Sublime Text plugin to format files faster using prettierd

Details

Installs

  • Total 5K
  • Win 2K
  • Mac 1K
  • Linux 912
May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 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
Windows 1 14 18 13 10 10 17 17 16 17 14 13 4 11 18 18 17 17 7 8 17 18 11 17 9 4 5 18 15 15 13 14 3 14 6 14 15 10 15 8 15 14 14 17 11 13
Mac 0 5 8 6 4 4 8 8 8 8 10 6 2 5 15 7 4 7 4 6 7 4 9 7 4 5 2 9 4 8 5 4 1 5 4 5 9 14 4 5 6 4 6 17 10 3
Linux 0 7 4 7 1 3 7 6 3 2 2 6 13 8 7 8 5 3 0 3 3 3 4 1 6 6 6 2 8 3 4 3 5 1 1 5 5 4 2 3 5 9 2 6 3 5

Readme

Source
raw.​githubusercontent.​com

Prettierd Format

Sublime Text plugin to format files faster using prettierd.


Installation

  1. Install prettierd globally with npm/yarn/pnpm:
npm i -g @fsouza/prettierd
  1. Install this plugin with Package Control:

Package Control: Install PackagePrettierd Format

  1. Restart Sublime Text


Usage

By default it formats on save any file supported by Prettier out-of-the-box.

Commands

To format a file:

  • Prettierd: Format

To save a file without formatting:

  • Prettierd: Save without formatting

Options

Enable/disable format on save:

"format_on_save": true

Add additional extensions (enabled via prettier plugins) to be formatted either on save or commands:

"additional_extensions": ["php"]

Exclude extensions from being formatted on save:

"disabled_extensions_on_save": ["md"]

Exclude directories from being formatted on save:

"disabled_directories_on_save": ["*/node_modules/*"]

Optional, path to prettierd executable. If not specified, it will be searched for in the system:

"prettierd_path": null


Notes

This plugin does nothing else than piping the input to prettierd and replacing the view contents with the output.

It is basically just like executing cat file.js | prettierd file.js with the command line.

For this reason, any issue with prettier plugins or configuration should be investigated on the prettierd repo as it is the underlying tool actually interacting with Prettier.

Astro / Svelte

As of September 2023, there are some upstream issues with Astro and Svelte files.

You can format them with the command LSP: format after installing their LSPs and enabling format on save for each language in the LSP settings.

Using the above command not only respects the .prettierrc configuration but is also very fast.


License

0BSD