 (require 'flycheck)
 ;; use eslint with web-mode for jsx files
 (flycheck-add-mode 'javascript-eslint 'web-mode)
-
-(require 'web-mode)
-(defun web-mode-jsx ()
-    (interactive)
-  (web-mode)
-  (web-mode-set-content-type "jsx"))

;; Load js2-mode.
(add-to-list 'load-path "~/.emacs.d/lib/js2-mode")
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))

(defun js-hook-fun ()

  (let ((entry (assq 'subword-mode minor-mode-alist)))
    (when entry (setcdr entry '(nil)))))

(require 'web-mode)
(add-hook 'js-mode-hook 'js-hook-fun)
(add-hook 'js2-mode-hook 'js-hook-fun)
(add-hook 'web-mode-hook 'js-hook-fun)
(add-hook 'web-mode-hook (lambda ()
                           (web-mode-set-content-type "jsx")))

(add-hook
 'js2-mode-hook
