2

Js2-mode is showing error when there are not registered globals. I've try this code:

(defun js2-hook ()
  ;; setting symbols instead of strings also don't work
  (dolist (global '("angular" "$" "jQuery" "console" "_" "window" "setTimeout"))
    (add-to-list 'js2-additional-externs global)))

(add-hook 'js2-mode-hook 'js2-hook)

but this don't work. How can I set globals, setting js2-additional-externs directly don't work also, because describe-variable says that this variable is automatically local when set.

jcubic
  • 691
  • 1
  • 4
  • 16

1 Answers1

4

It seems that the variable you want to set is js2-global-externs.

js2-additional-externs is intended for setting globals on per-buffer basis, not for all buffers with js2-mode.