It works very well as it uses true parsing, not heuristics, to analyse code.
- Download https://js2-mode.googlecode.com/files/js2-20090723b.el
- Rename the file as js2-mode.el
- Move it to a directory in your 'load-path' (~/.emacs.d/ should work),
- Start Emacs,
- Run the following command:
M-x byte-compile-file js2-mode.el
Add the following to your .emacs file:
(require 'js2-mode) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
Some features of the mode are:
- Highlighting of syntax errors and doubtful structures, e.g. missing ';', and undeclared variables,
- The auto-indentation system works.