These simple PopClip extensions use Prettier to quickly format JavaScript and JSON.
The following instructions are for the "Format JSON" extension. But the "Format JavaScript" one works the same way.
- Download or clone this repo to your computer.
- Double-click the
Format JSON.popclipext
extension to install it in PopClip. - Click the
Install "Format JSON"
button in the confirmation modal. - Confirm that the Format JSON extension is activated.
- Select some poorly formatted, yet valid, JSON.
- Click the JSON icon (curly braces) in PopClip.
- The poorly formatted JSON will be replaced with nicely formatted JSON.
- If you have a
.prettierrc
file in your home dir, those settings will be used. Otherwise Prettier's default settings will be used.