prettier/README.md

20 lines
528 B
Markdown
Raw Normal View History

2016-11-29 20:26:03 +03:00
```
$ git clone https://github.com/jlongster/jscodefmt.git
$ cd jscodefmt
$ npm install -g .
$ jscodefmt file.js
```
It's most useful when integrated with your editor, so see `editors` to
2016-11-30 18:02:23 +03:00
for editor support. Atom and Emacs is currently supported.
2016-11-29 20:26:03 +03:00
2016-11-30 18:02:23 +03:00
More docs on editor integration will come soon. To integrate in Emacs,
add the following code. This will format the file when saved.
2016-11-29 20:26:03 +03:00
```elisp
(require 'jscodefmt)
(add-hook 'js-mode-hook
(lambda ()
(add-hook 'before-save-hook 'jscodefmt-before-save)))
```