Skip to content

Instantly share code, notes, and snippets.

@blue0513
Forked from ustun/eslint-auto.el
Last active January 3, 2020 15:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blue0513/f503c26bf5cb8a1b6fb6e75f1ec91557 to your computer and use it in GitHub Desktop.
Save blue0513/f503c26bf5cb8a1b6fb6e75f1ec91557 to your computer and use it in GitHub Desktop.
run eslint --fix on emacs file save
;; forked from https://gist.github.com/ustun/73321bfcb01a8657e5b8
(defun eslint-fix-file ()
(interactive)
(call-process-shell-command
(concat "eslint --fix " (buffer-file-name)) nil 0))
(defun eslint-fix-file-and-revert ()
(interactive)
(eslint-fix-file)
(revert-buffer t t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment