Minor refactor & revision across the board

This commit is contained in:
Henrik Lissner 2018-08-31 02:50:47 +02:00
parent fd8f8c5108
commit 0cf9d1f2f2
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 19 additions and 19 deletions

View file

@ -77,14 +77,15 @@
:config
(set-electric! 'rjsx-mode :chars '(?\} ?\) ?. ?>))
(set-docsets! 'rjsx-mode +javascript-docsets)
(add-hook! 'rjsx-mode-hook
;; jshint doesn't know how to deal with jsx
(push 'javascript-jshint flycheck-disabled-checkers))
(when (featurep! :feature syntax-checker)
(add-hook! 'rjsx-mode-hook
;; jshint doesn't know how to deal with jsx
(push 'javascript-jshint flycheck-disabled-checkers)))
;; `rjsx-electric-gt' relies on js2's parser to tell it when the cursor is in
;; a self-closing tag, so that it can insert a matching ending tag at point.
;; However, the parser doesn't run immediately, so a fast typist can outrun
;; it, causing tags to stay unclosed, so force it to parse.
;; it, causing tags to stay unclosed, so we force it to parse.
(defun +javascript|reparse (n)
;; if n != 1, rjsx-electric-gt calls rjsx-maybe-reparse itself
(if (= n 1) (rjsx-maybe-reparse)))