Skip to content

Commit

Permalink
Recommend js-mode + js2-minor-mode and Emacs 27 for JSX
Browse files Browse the repository at this point in the history
Fixes #140, #330, #389, #411, #451, #459, #462, #482, #490, #409.

This is an alternative to #523.
  • Loading branch information
dgutov committed May 25, 2019
1 parent ae9fea8 commit bf7191c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ The stable versions are hosted at [GNU ELPA](http://elpa.gnu.org/)
You can also install the latest development version from
[MELPA](https://melpa.org/#/getting-started).

React and JSX
======

The currently recommended solution is to install Emacs 27 (still in
development, you can build from source or e.g. install a snapshot from
a [PPA](https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa)) and
use `js-mode` as the major mode. To make use of the JS2 AST and the
packages that integrate with it, we recommend `js2-minor-mode`. See
the corresponding [instructions in the
Commentary](https://github.com/mooz/js2-mode/blob/ae9fea81cf9ed80f403c161fde4d8aff1ceb3769/js2-mode.el#L57).

`js-mode` in Emacs 27 includes full support for syntax highlighting
and indenting of JSX syntax.

[rjsx-mode](https://github.com/felipeochoa/rjsx-mode/) is an
alternative option which comes with certain tradeoffs.

This comment has been minimized.

Copy link
@wyuenho

wyuenho Jun 4, 2019

Contributor

What are the tradeoffs?

This comment has been minimized.

Copy link
@dgutov

dgutov Jun 5, 2019

Author Collaborator

No syntax errors (I think), but less robust indentation, AFAIK.


Emacs 22 and 23
===============

Expand Down

0 comments on commit bf7191c

Please sign in to comment.