Prettierd Format
Sublime Text plugin to format files faster using prettierd
Details
Installs
- Total 13K
- Win 7K
- Mac 4K
- Linux 2K
May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | 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 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 5 | 10 | 8 | 11 | 10 | 12 | 14 | 23 | 14 | 12 | 8 | 6 | 14 | 21 | 11 | 12 | 12 | 7 | 6 | 9 | 12 | 14 | 10 | 12 | 4 | 6 | 7 | 11 | 15 | 14 | 12 | 11 | 8 | 11 | 10 | 15 | 8 | 9 | 8 | 10 | 10 | 14 | 17 | 12 | 26 | 11 |
Mac | 1 | 5 | 10 | 4 | 3 | 12 | 10 | 7 | 13 | 10 | 3 | 6 | 8 | 8 | 15 | 12 | 6 | 2 | 0 | 4 | 11 | 7 | 14 | 7 | 3 | 1 | 4 | 6 | 7 | 8 | 8 | 2 | 8 | 16 | 14 | 11 | 13 | 7 | 6 | 4 | 10 | 6 | 9 | 7 | 17 | 5 |
Linux | 0 | 5 | 4 | 1 | 3 | 3 | 5 | 4 | 2 | 5 | 0 | 3 | 11 | 7 | 6 | 7 | 6 | 7 | 7 | 0 | 7 | 9 | 2 | 5 | 5 | 4 | 2 | 2 | 2 | 4 | 6 | 6 | 7 | 9 | 3 | 4 | 7 | 3 | 5 | 2 | 5 | 9 | 3 | 6 | 5 | 6 |
Readme
- Source
- raw.githubusercontent.com
Prettierd Format
Sublime Text plugin to format files faster using prettierd.
Installation
- Install prettierd globally with npm/yarn/pnpm:
npm i -g @fsouza/prettierd
- Install this plugin with Package Control:
Package Control: Install Package
→ Prettierd Format
- 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