From 405ba466460f9d987d331e64fe28eaba481b9c62 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 19 Jun 2017 10:25:31 +0200 Subject: Emacs: Install rjsx-mode for React component files --- emacs/.emacs.d/init.org | 12 ++++++++++-- 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 5c44022..1570206 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 6740719..86cf3b5 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 -- cgit 1.4.1