{"action":"created","issue":{"url":"https://api.github.com/repos/fxbois/web-mode/issues/473","labels_url":"https://api.github.com/repos/fxbois/web-mode/issues/473/labels{/name}","comments_url":"https://api.github.com/repos/fxbois/web-mode/issues/473/comments","events_url":"https://api.github.com/repos/fxbois/web-mode/issues/473/events","html_url":"https://github.com/fxbois/web-mode/issues/473","id":64955349,"number":473,"title":"Bug? Error trying to use javascript-eslint with web-mode for jsx files, indicates that web-mode forgets to call run-mode-hooks","user":{"login":"jeffbski","id":5689,"avatar_url":"https://avatars.githubusercontent.com/u/5689?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbski","html_url":"https://github.com/jeffbski","followers_url":"https://api.github.com/users/jeffbski/followers","following_url":"https://api.github.com/users/jeffbski/following{/other_user}","gists_url":"https://api.github.com/users/jeffbski/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbski/subscriptions","organizations_url":"https://api.github.com/users/jeffbski/orgs","repos_url":"https://api.github.com/users/jeffbski/repos","events_url":"https://api.github.com/users/jeffbski/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-28T15:36:17Z","updated_at":"2015-04-02T18:54:30Z","closed_at":"2015-03-30T16:01:09Z","body":"In trying to leverage flycheck javascript-eslint with web-mode in editing a react jsx file, I get the following error when flycheck tries to run eslint.\r\n\r\n```\r\nFile mode specification error: (user-error \"Can't use syntax checker javascript-eslint in this buffer\")\r\nWarning: Bug in web-mode: it forgets to call `run-mode-hooks'\r\nFile mode specification error: (user-error \"Can't use syntax checker javascript-eslint in this buffer\")\r\n```\r\n\r\nFYI. If I instead use flycheck jsxhint with web-mode everything works fine, but I am hoping to switch to the more pluggable and powerful eslint. Also with .js files using js2-mode, flycheck is able to use eslint properly. So I know that flycheck mechanism is working for those scenarios.\r\n\r\njavascript-eslint must rely on `run-mode-hooks` being called which it isn't and thus is saying that it is a bug in web-mode. If I understand the error message. I assume run-mode-hooks is a standard hook that every mode should call periodically?\r\n\r\nHere is the web-mode-debug output and the error from messages buffer\r\n\r\n```\r\n--- WEB-MODE DEBUG BEG ---\r\nversions: emacs(24.4) web-mode(\"11.0.29\")\r\nvars: engine(nil) content-type(\"\") file(\"*Messages*\")\r\nsystem: window(ns) config(\"x86_64-apple-darwin14.0.0\")\r\ncolors: fg(\"#708183\") bg(\"#042028\") \r\nminor modes: (buffer-read-only cua-mode show-paren-mode osx-key-mode aquamacs-autoface-mode smart-frame-positioning-mode savehist-mode ido-everywhere linum-mode global-linum-mode)\r\nvars:\r\nweb-mode-enable-current-column-highlight=nil \r\nweb-mode-enable-current-element-highlight=nil \r\nindent-tabs-mode=nil \r\n--- WEB-MODE DEBUG END ---\r\nFile mode specification error: (user-error \"Can't use syntax checker javascript-eslint in this buffer\")\r\nWarning: Bug in web-mode: it forgets to call `run-mode-hooks'\r\nFile mode specification error: (user-error \"Can't use syntax checker javascript-eslint in this buffer\")\r\n```\r\n\r\nMy .emacs that sets up \r\n\r\n```\r\n(require 'flycheck)\r\n;; flycheck jsxhint for jsx files\r\n(flycheck-define-checker jsxhint-checker\r\n  \"A JSX syntax and style checker based on JSXHint.\"\r\n\r\n  :command (\"jsxhint\" source)\r\n  :error-patterns\r\n  ((error line-start (1+ nonl) \": line \" line \", col \" column \", \" (message) line-end))\r\n  :modes (web-mode))\r\n(add-hook 'web-mode-hook\r\n          (lambda ()\r\n            (when (equal web-mode-content-type \"jsx\")\r\n              ;; enable flycheck\r\n              (flycheck-select-checker 'javascript-eslint)\r\n              (flycheck-mode))))\r\n\r\n;; flycheck jshint for js files\r\n(add-hook 'js-mode-hook\r\n          (lambda () (flycheck-mode t)))\r\n```\r\n\r\nI also had to customize the variable flycheck-disabled-checkers to tell it not to use jshint. I think this is mainly for .js files since for .jsx we are telling what checker to use.\r\n\r\n```\r\n '(flycheck-disabled-checkers (quote (json-jsonlint javascript-jshint)))\r\n```\r\n\r\nI am using Aquamacs on OS X\r\n\r\n```\r\nAquamacs 3.2 GNU Emacs 24.4.51.2\r\n(x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)\r\n of 2014-11-07 (Aquamacs-3.2) on watson.local\r\n```\r\n\r\nFrom my packages list\r\n\r\n```\r\n  web-mode           20150321.... installed             major mode for editing web templates\r\n  flycheck           20150326.... installed             Modern on-the-fly syntax checking for GNU Emacs\r\n```\r\n\r\nThanks in advance for any help with this."},"comment":{"url":"https://api.github.com/repos/fxbois/web-mode/issues/comments/89008307","html_url":"https://github.com/fxbois/web-mode/issues/473#issuecomment-89008307","issue_url":"https://api.github.com/repos/fxbois/web-mode/issues/473","id":89008307,"user":{"login":"jeffbski","id":5689,"avatar_url":"https://avatars.githubusercontent.com/u/5689?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffbski","html_url":"https://github.com/jeffbski","followers_url":"https://api.github.com/users/jeffbski/followers","following_url":"https://api.github.com/users/jeffbski/following{/other_user}","gists_url":"https://api.github.com/users/jeffbski/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbski/subscriptions","organizations_url":"https://api.github.com/users/jeffbski/orgs","repos_url":"https://api.github.com/users/jeffbski/repos","events_url":"https://api.github.com/users/jeffbski/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbski/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T18:54:30Z","updated_at":"2015-04-02T18:54:30Z","body":"Documented in a blog post here: http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html"}}