Skip to content

ruyadorno/prettierme

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

prettierme

NPM version Build Status

The fastest way to prettier a single file

About

This is a convenience script around prettierd to run it at maximum speed using netcat.

prettier_d is an amazing tool that keeps a local server running prettier to cut linting time for a single file, so that we can get instant linting in our preferred editor.

Install

$ npm install -g prettierme

Usage

To start the server and lint a file, just run:

$ prettierme file.js

Editor Integration

  • Vim: I'm running an extra vim configuration file that sets up commands to run after saving each file, that allows me to keep a seamless integration with eslintme for syntax/lint errors:
:autocmd BufWritePost *.js silent! !prettierme <afile> >/dev/null 2>&1
:autocmd BufWritePost *.js silent! e | redraw! | SyntasticCheck | SignifyRefresh

Support

Please note that this is a very platform-specific convenience wrapper around prettierd, it only supports unix platforms where netcat is available. For usage in any other systems I'd recommend starting with the prettier cli.

License

MIT © Ruy Adorno