| ;;; runs eslint --fix on the current file after save | |
| ;;; alpha quality -- use at your own risk | |
| (defun eslint-fix-file () | |
| (interactive) | |
| (message "eslint --fixing the file" (buffer-file-name)) | |
| (shell-command (concat "eslint --fix " (buffer-file-name)))) | |
| (defun eslint-fix-file-and-revert () | |
| (interactive) | |
| (eslint-fix-file) | |
| (revert-buffer t t)) | |
| (add-hook 'js2-mode-hook | |
| (lambda () | |
| (add-hook 'after-save-hook #'eslint-fix-file-and-revert))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment