Flymake backend for CSS and friends using stylelint
- Make sure
stylelint
is installed and present on your emacsexec-path
. For Linux systemsexec-path
usually equals your$PATH
environment variable; for other systems, you're on your own. - Install: download and place inside
~/.emacs.d/lisp
. then edit~/.emacs
or equivalent:
(add-to-list 'load-path "~/.emacs.d/lisp")
(require "flymake-stylelint.el")
- Enable:
(add-hook 'scss-mode-hook ; or whatever the mode-hook is for your mode of choice
(lambda ()
(flymake-stylelint-enable)))
useful variables are members of the flymake-stylelint
group and can be viewed and modified with the command M-x customize-group [RET] flymake-stylelint [RET]
.
(defcustom flymake-stylelint-executable-name "stylelint"
"Name of executable to run when checker is called. Must be present in variable `exec-path'."
:type 'string
:group 'flymake-stylelint)
(defcustom flymake-stylelint-executable-args nil
"Extra arguments to pass to stylelint."
:type 'string
:group 'flymake-stylelint)
(defcustom flymake-stylelint-show-rule-name t
"Set to t to append rule name to end of warning or error message, nil otherwise."
:type 'boolean
:group 'flymake-stylelint)
(defcustom flymake-stylelint-defer-binary-check nil
"Set to t to bypass the initial check which ensures stylelint is present.
Useful when the value of variable `exec-path' is set dynamically and the location of stylelint might not be known ahead of time."
:type 'boolean
:group 'flymake-stylelint)
MIT