This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; runs `prettier-stylelint --write` on the current file after save | |
;;; alpha quality -- use at your own risk | |
(defun prettier-stylelint-fix-file-and-revert () | |
"Prettify current file and apply fixes only in css-mode or scss-mode" | |
(interactive) | |
(when (or (eq major-mode 'css-mode) (eq major-mode 'scss-mode)) | |
(message "prettier-stylelint fixing your file" (buffer-file-name)) ;;optional line, you can remove it | |
(shell-command (concat "prettier-stylelint --quiet --write " (buffer-file-name))) | |
(revert-buffer t t))) |