Open winny- opened 9 years ago
Use emacs's own js-jsx-mode for React's jsx file.
for anyone else looking to highlight JSX in context of React I used webmode
and this piece of e-lisp to configure it for JSX:
(add-to-list 'auto-mode-alist '("\\.jsx$" . web-mode))
(defadvice web-mode-highlight-part (around tweak-jsx activate)
(if (equal web-mode-content-type "jsx")
(let ((web-mode-enable-part-face nil))
ad-do-it)
ad-do-it))
My suggestion is simple: change the MELPA and README.md descriptions to describe what "major mode for JSX" means.
Does it mean JSX the type-checked Javascript language?
Does it mean JSX the extended syntax used by React.js?
Does it mean JSX the "erlang application for consuming, producing and manipulating json"?
Is it something to do with JSX Audio?
Is it something to do with jsx (Java Serialization to XML)?
...
I agree. It seems like this was here before React, but I think most people looking for JSX will be looking for React's JSX, so it would behoove the project owners to at least clarify somewhere that this is not related to React.
+1 for clarifying language
@jazzonmymind, thank you so much for your piece of code. However, it only seems to work for .jsx files. Is there any way to make it work for .js files? Changing .jsx$ for .js$ doesn't work. Thanks.
Note that there's now a proper major mode for JSX files available on MELPA: https://github.com/felipeochoa/rjsx-mode
I'm sorry for the confusion.
I've changed the title of README by https://github.com/jsx/jsx-mode.el/pull/16. In addition, I think of deleting its recipe from MELPA (https://github.com/melpa/melpa/pull/6547).
Installed from MELPA, assumed it was for the JSX that extends javascript to support XML literals. Maybe add something to the README and MELPA description that reads like "For JSX, the type-checked Javascipt language"? See also: #10.