- eslint
- oxlint
- biome
- emacs 29+
- pfuture
(use-package flymake-jsts
:straight '(flymake-jsts :type git :host github :repo "orzechowskid/flymake-jsts" :branch "main"))
Then enable the linter(s) of your choice:
M-x flymake-jsts-eslint-enable(or-oxlint-enable, etc.)M-x flymake-mode
useful variables are members of the flymake-jsts group and can be viewed and modified with the command M-x customize-group [RET] flymake-jsts [RET].
Mapping of linters to binary names. Useful if you want to use eslint_d instead of eslint, for instance.
Mapping of linters to 'project markers': files which denote the root of a project tree for which linting is applied. Useful if you have a config file with a weird name, so it can be found and its directory can be used as $PWD for the linter process.
Non-nil to show the name of a lint rule as part of the Flymake diagnostic message, or nil to suppress.
Non-nil to show extra information for each lint rule (when provided), or nil to suppress.
Type symbols to use when reporting errors. Useful to customize if you want to distinguish Flymake errors from other sources of errors (e.g. LSP).
Non-nil to write tracing info to the *Messages* buffer. It sometimes comes in handy when things aren't working as expected for you.
this is a from-the-ground-up rewrite of flymake-eslint, which was the first elisp package I ever published; I've learned a lot since then! it should be easier to add support for other linters like stylelint, for instance, and it should be a little easier to customize too.
Tip
tsx-mode.el can configure this (and lots more) for you.
eglot is pretty aggressive in taking over your Flymake configuration; it assumes that your language server is the only source of diagnostic messages, and completely overwrites the value of flymake-diagnostic-functions to suit its own needs. One workaround you can try is to add a flymake-jsts backend function after eglot has been enabled:
(add-hook 'eglot-managed-mode-hook
(lambda ()
(flymake-jsts-eslint-enable))
nil t)Alternately, you can tell eglot to stay out of your Flymake configuration and then add eglot's backend yourself:
(add-to-list 'eglot-stay-out-of 'flymake)
(add-hook 'flymake-mode-hook
(lambda ()
(add-hook 'flymake-diagnostic-functions
#'eglot-flymake-backend
nil
t)))GPLv3