Add command to reformat JS
This commit is contained in:
parent
92ae084f70
commit
5a2ea9e799
@ -1479,6 +1479,15 @@ Use nvm to manage node versions:
|
||||
:commands (nvm-use nvm-use-for nvm-use-for-buffer))
|
||||
#+END_SRC
|
||||
|
||||
A command to format JS via prettier:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun prettier ()
|
||||
(interactive)
|
||||
(let ((start (if (use-region-p) (region-beginning) (point-min)))
|
||||
(end (if (use-region-p) (region-end) (point-max))))
|
||||
(shell-command-on-region start end "prettier --parser babel" nil t)))
|
||||
#+END_SRC
|
||||
|
||||
* LSP Mode
|
||||
Emacs support for the Language Server Protocol
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user