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

Prettierd Format

Sublime Text plugin to format files faster using prettierd

Details

Installs

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

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

All these options can be configured globally in your user settings, or per project under the "PrettierdFormat" setting:

{
    "settings":
    {
        "PrettierdFormat":
        {
            "format_on_save": true
        }
    }
}


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