To install this package, run in Emacs:
M-x package-install RET js2-mode RET
M-x imenuwill now list test blocks defined with
for await ofsyntax (#543).
js2-minor-mode(see README), rather than
js2-jsx-modewill now trigger a warning in Emacs 27.
js2-include-*-externsare now evaluated on demand. As a result, they can now be effectively used as file- or directory-local variables.
js2-mode-assume-strict, for use with ES6 modules.
js2-object-property, which has no color by default.
js2-getter-setter-nodeis renamed to
js2-method-node, together with its related functions. It already handles generator methods, and we added support for async methods (see below), so the old name would get more confusing.
js2-jsx-mode, deriving from
js2-mode. Supports indentation of JSXElement expressions wrapped within parentheses or as function arguments. Indentation is customizable via
js2-mode now derives from
js-mode. That means the former
function will run
js-mode-hook, as well as
key bindings will default to
js-mode-map where they're not set in
js2-mode-map. And in Emacs 25 or later (including the snapshot
js2-mode uses the indentation code from
feasible, the user options (and functions) now have aliases, but if
you're using Emacs 25 and you see an indentation-related setting
that stopped working, try looking for a corresponding one in the
M-x customize-group RET js RET.
js2-jump-to-definition. It's bound to
default, via remapping
js-find-symbol. To get back to the default
M-. binding (e.g.
find-tag), put this in your init file:
(eval-after-load 'js (define-key js-mode-map (kbd "M-.") nil)) ... ...