Flycheck seems to enable checkers based on the major mode. Meanwhile, web-mode
can be used to edit a variety of different types of files (html, javascript, etc.) which would each have their own distinct set of checker(s) that make sense to use.
For example, I've just enabled linting of my jsx
files using the javascript-eslint
checker, but now when I open an html
file (in web-mode
) flycheck tries to lint that using javascript-eslint
, which fails miserably, of course, since the file is html, not javascript.
Is there any other way to tell flycheck which checker to use other than by the major mode? Is there a way to tell flycheck to enable checkers for a given mode but only if some predicate passes, for example?
There's an answer to this question that recommends completely disabling flycheck depending on the file type, but I don't want to do that since I'd like to lint my other web-mode
files as well.