diff options
author | Alan Pearce | 2017-06-19 10:25:31 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-19 10:25:31 +0200 |
commit | 405ba466460f9d987d331e64fe28eaba481b9c62 (patch) | |
tree | c71c84303633aa8be6bbe649d200909984f5c980 | |
parent | 6a3adcad704b8a3c06fc397b5a32a3247dfb36f4 (diff) | |
download | nixfiles-405ba466460f9d987d331e64fe28eaba481b9c62.tar.lz nixfiles-405ba466460f9d987d331e64fe28eaba481b9c62.tar.zst nixfiles-405ba466460f9d987d331e64fe28eaba481b9c62.zip |
Emacs: Install rjsx-mode for React component files
-rw-r--r-- | emacs/.emacs.d/init.org | 12 | ||||
-rw-r--r-- | nix/.config/nixpkgs/emacs.nix | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 5c44022e..15702067 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -2099,8 +2099,7 @@ an AST internally, so it can work with it almost like a lisp. #+BEGIN_SRC emacs-lisp (use-package js2-mode - :mode (("\\.js\\'" . js2-mode) - ("\\.jsx\\'" . js2-jsx-mode)) + :mode (("\\.js\\'" . js2-mode)) :interpreter ("node" . js2-mode) :functions js2-next-error :config (progn @@ -2124,6 +2123,15 @@ an AST internally, so it can work with it almost like a lisp. js2-strict-missing-semi-warning nil))) #+END_SRC +**** rjsx-mode + +A set of advice for js2-jsx-mode to work better with React. + +#+BEGIN_SRC emacs-lisp +(use-package rjsx-mode + :mode (("\\.jsx\\'" . rjsx-mode))) +#+END_SRC + **** js2-refactor Thanks to the AST provided by js2-mode, refactoring is possible. This diff --git a/nix/.config/nixpkgs/emacs.nix b/nix/.config/nixpkgs/emacs.nix index 6740719f..86cf3b5f 100644 --- a/nix/.config/nixpkgs/emacs.nix +++ b/nix/.config/nixpkgs/emacs.nix @@ -133,6 +133,7 @@ in relative-buffers restclient ripgrep + rjsx-mode scala-mode scss-mode shrink-whitespace |