this package is no longer under active development. Please check out flymake-jsts as an alternative; it's much more solidly built and easier for end-users to customize.
Flymake backend for Javascript using eslint
- Make sure
eslintis installed and present on your emacsexec-path. For Linux systemsexec-pathusually equals your$PATHenvironment variable; for other systems, you're on your own. - Install:
- from MELPA:
M-x package-install [RET] flymake-eslint [RET] - manually: download and place inside
~/.emacs.d/lispthen edit~/.emacsor equivalent:
(add-to-list 'load-path "~/.emacs.d/lisp")
(require "flymake-eslint.el")- with
use-package+straight.el:
(use-package flymake-eslint
:straight '(flymake-eslint :type git :host github :repo "orzechowskid/flymake-eslint"))- Enable:
(add-hook 'web-mode-hook ; or whatever the mode-hook is for your mode of choice
(lambda ()
(flymake-eslint-enable)))useful variables are members of the flymake-eslint group and can be viewed and modified with the command M-x customize-group [RET] flymake-eslint [RET].
(defcustom flymake-eslint-executable-name "eslint"
"Name of executable to run when checker is called. Must be present in variable `exec-path'."
:type 'string
:group 'flymake-eslint)
(defcustom flymake-eslint-executable-args nil
"Extra arguments to pass to eslint."
:type 'string
:group 'flymake-eslint)
(defcustom flymake-eslint-show-rule-name t
"Set to t to append rule name to end of warning or error message, nil otherwise."
:type 'boolean
:group 'flymake-eslint)
(defcustom flymake-eslint-defer-binary-check nil
"Set to t to bypass the initial check which ensures eslint is present.
Useful when the value of variable `exec-path' is set dynamically and the location of eslint might not be known ahead of time."
:type 'boolean
:group 'flymake-eslint)
(defcustom flymake-eslint-project-root nil
"Buffer-local. Set to a filesystem path to use that path as the current working directory of the linting process."
:type 'string
:group 'flymake-eslint)
(defcustom flymake-eslint-prefer-json-diagnostics nil
"Try to use the JSON diagnostic format when runnin ESLint.
This gives more accurate diagnostics but requires having an Emacs
version with JSON support."
:type 'boolean
:group 'flymake-eslint)yes
MIT