   )
 
 (defun gp-setup-webdev-indent (n)
+  "Set indentation for webdev related modes to N spaces."
   (setq coffee-tab-width n) ; coffeescript
   (setq javascript-indent-level n) ; javascript-mode
   (setq js-indent-level n) ; js-mode

(setq-default js2-global-externs '("require"))

(defun gp-js2-mode-hook ()
  (tern-mode)
  (subword-mode)
  (auto-complete-mode)

  (setq indent-tabs-mode nil)
  (gp-setup-webdev-indent 2)
  (setq js2-bounce-indent-p t)
  (setq js2-highlight-external-variables nil)
  (setq js2-mode-show-parse-errors nil)
  (flycheck-add-mode 'javascript-eslint 'js2-mode)
  (flycheck-select-checker 'javascript-eslint)
  (setq-default flycheck-disabled-checkers
                (append flycheck-disabled-checkers '(json-jsonlist)))
  (setq-default flycheck-disabled-checkers
                (append flycheck-disabled-checkers '(javascript-jshint)))
               

  ;; we're using eslint for parsing, so js2-can shut up
  (setq js2-mode-show-parse-errors nil)
  
  ;; remove trailing whitespace
  (add-hook 'local-write-file-hooks
