4

So, I'm finding myself writing React a lot, and not finding myself happy doing so in EMACS. I've been resorting to Visual Studio Code, which is a fine editor but suffers seriously by not being EMACS.

There seem to be a whole bunch of bits and pieces around, but little coherence. What is needed to make EMACS play nicely with modern Javascript, Node, and frameworks like React?

Charlie Martin
  • 349
  • 1
  • 9

2 Answers2

3

From my experience, you will need just js2-mode for ECMAScript in general, and rjsx-mode (a mode which derives from js2-mode) for jsx editing. These will provide you with some real-time linting like an IDE, and if you need more you can use something like flycheck, and there are plenty of extensions that take advantage of the AST provided by js2-mode.

You might need to customize some settings for js2-mode which you can do easily with M-x customize-group.

3

I suggest you install Indium (https://indium.readthedocs.io/) to get a stepping debugger, REPL and object inspector. Tern, company-tern, and js2-mode, js2-refactor, xref-js2, eslintd-fix, gulp-task-runner and yasnippet are very useful too.

Damien Cassou
  • 877
  • 4
  • 14