js2-mode: use flycheck instead of in-built parser

This commit is contained in:
Henrik Lissner 2016-07-19 15:02:17 -04:00
parent e40023dd71
commit 50f75760d1

View file

@ -3,7 +3,7 @@
(use-package js2-mode (use-package js2-mode
:mode "\\.js$" :mode "\\.js$"
:interpreter "node" :interpreter "node"
:init (add-hook 'js2-mode-hook 'tern-mode) :init (add-hook! js2-mode '(tern-mode flycheck-mode))
:config :config
(def-repl! js2-mode nodejs-repl) (def-repl! js2-mode nodejs-repl)
(def-company-backend! js2-mode (tern)) (def-company-backend! js2-mode (tern))
@ -11,13 +11,12 @@
(def-electric! js2-mode :chars (?\} ?\) ?.) :words ("||" "&&")) (def-electric! js2-mode :chars (?\} ?\) ?.) :words ("||" "&&"))
(setq-default (setq-default
js2-skip-preprocessor-directives t js2-skip-preprocessor-directives t
js2-show-parse-errors nil js2-highlight-external-variables nil
js2-global-externs '("module" "require" "buster" "sinon" "assert" js2-mode-show-parse-errors nil)
"refute" "setTimeout" "clearTimeout"
"setInterval" "clearInterval" "location" (add-hook! lb6-project-mode
"__dirname" "console" "JSON" "jQuery" "$" (when (eq major-mode 'js2-mode)
;; Launchbar API (setq js2-additional-externs '("LaunchBar" "File" "Action" "HTTP" "include" "Lib"))))
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
;; [pedantry intensifies] ;; [pedantry intensifies]
(add-hook! js2-mode (setq mode-name "JS2")) (add-hook! js2-mode (setq mode-name "JS2"))
@ -163,7 +162,5 @@
(def-project-type! gulpjs "gulp" :match "/gulpfile.js$") (def-project-type! gulpjs "gulp" :match "/gulpfile.js$")
;; TODO react
(provide 'module-js) (provide 'module-js)
;;; module-js.el ends here ;;; module-js.el ends here